summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrjohnson <rjohnson>1998-09-30 19:01:19 (GMT)
committerrjohnson <rjohnson>1998-09-30 19:01:19 (GMT)
commit482d5ce35c802162132e4eee4a59ff453f45f531 (patch)
treee8f9ce0fdf1594b3d40b87fa21119fb159b1e874
parent068cb6c58c21179128dd33d86208e199e83e4d64 (diff)
downloadtk-482d5ce35c802162132e4eee4a59ff453f45f531.zip
tk-482d5ce35c802162132e4eee4a59ff453f45f531.tar.gz
tk-482d5ce35c802162132e4eee4a59ff453f45f531.tar.bz2
Removed old/unused function declarations
removed unused file on Mac implementation made bell cmd an obj cmd - improved it's test suite
-rw-r--r--generic/tk.h18
-rw-r--r--generic/tkCmds.c33
-rw-r--r--generic/tkImgPhoto.c6
-rw-r--r--generic/tkInt.h22
-rw-r--r--generic/tkWindow.c4
-rw-r--r--mac/tkMacInt.h7
-rw-r--r--mac/tkMacPort.h3
-rw-r--r--mac/tkMacProlog.c61
-rw-r--r--tests/bell.test5
-rw-r--r--unix/tkUnixPort.h9
-rw-r--r--win/tkWinPort.h4
11 files changed, 39 insertions, 133 deletions
diff --git a/generic/tk.h b/generic/tk.h
index 6fcff0b..ddfd176 100644
--- a/generic/tk.h
+++ b/generic/tk.h
@@ -7,11 +7,12 @@
* Copyright (c) 1989-1994 The Regents of the University of California.
* Copyright (c) 1994 The Australian National University.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
+ * Copyright (c) 1998 by Scriptics Corporation.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tk.h,v 1.12 1998/09/14 18:23:02 stanton Exp $
+ * RCS: @(#) $Id: tk.h,v 1.13 1998/09/30 19:01:19 rjohnson Exp $
*/
#ifndef _TK
@@ -1008,13 +1009,11 @@ struct Tk_PhotoImageFormat {
#define Tk_DoWhenIdle Tcl_DoWhenIdle
#define Tk_Sleep Tcl_Sleep
-/* Additional stuff that has moved to Tcl: */
-
-#define Tk_AfterCmd Tcl_AfterCmd
#define Tk_EventuallyFree Tcl_EventuallyFree
#define Tk_FreeProc Tcl_FreeProc
#define Tk_Preserve Tcl_Preserve
#define Tk_Release Tcl_Release
+#define Tk_FileeventCmd Tcl_FileEventCmd
/*
*--------------------------------------------------------------
@@ -1456,10 +1455,9 @@ EXTERN void Tk_UpdatePointer _ANSI_ARGS_((Tk_Window tkwin,
* Tcl commands exported by Tk:
*/
-EXTERN int Tk_AfterCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
-EXTERN int Tk_BellCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
+EXTERN int Tk_BellObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
EXTERN int Tk_BindCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int argc, char **argv));
EXTERN int Tk_BindtagsCmd _ANSI_ARGS_((ClientData clientData,
@@ -1474,16 +1472,12 @@ EXTERN int Tk_ClipboardCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int argc, char **argv));
EXTERN int Tk_ChooseColorCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int argc, char **argv));
-EXTERN int Tk_ChooseFontCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
EXTERN int Tk_DestroyCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int argc, char **argv));
EXTERN int Tk_EntryCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int argc, char **argv));
EXTERN int Tk_EventCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int argc, char **argv));
-EXTERN int Tk_FileeventCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
EXTERN int Tk_FrameCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int argc, char **argv));
EXTERN int Tk_FocusCmd _ANSI_ARGS_((ClientData clientData,
diff --git a/generic/tkCmds.c b/generic/tkCmds.c
index 28f3202..e16b490 100644
--- a/generic/tkCmds.c
+++ b/generic/tkCmds.c
@@ -6,11 +6,12 @@
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1996 Sun Microsystems, Inc.
+ * Copyright (c) 1998 by Scriptics Corporation.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkCmds.c,v 1.3 1998/09/14 18:23:08 stanton Exp $
+ * RCS: @(#) $Id: tkCmds.c,v 1.4 1998/09/30 19:01:19 rjohnson Exp $
*/
#include "tkPort.h"
@@ -33,7 +34,7 @@ static void WaitWindowProc _ANSI_ARGS_((ClientData clientData,
/*
*----------------------------------------------------------------------
*
- * Tk_BellCmd --
+ * Tk_BellObjCmd --
*
* This procedure is invoked to process the "bell" Tcl command.
* See the user documentation for details on what it does.
@@ -48,29 +49,31 @@ static void WaitWindowProc _ANSI_ARGS_((ClientData clientData,
*/
int
-Tk_BellCmd(clientData, interp, argc, argv)
+Tk_BellObjCmd(clientData, interp, objc, objv)
ClientData clientData; /* Main window associated with interpreter. */
Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
{
Tk_Window tkwin = (Tk_Window) clientData;
- size_t length;
+ int index;
+ char *string;
+ static char *optionStrings[] = {
+ "-displayof", NULL
+ };
- if ((argc != 1) && (argc != 3)) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " ?-displayof window?\"", (char *) NULL);
+ if ((objc != 1) && (objc != 3)) {
+ Tcl_WrongNumArgs(interp, 1, objv, "?-displayof window?");
return TCL_ERROR;
}
- if (argc == 3) {
- length = strlen(argv[1]);
- if ((length < 2) || (strncmp(argv[1], "-displayof", length) != 0)) {
- Tcl_AppendResult(interp, "bad option \"", argv[1],
- "\": must be -displayof", (char *) NULL);
+ if (objc == 3) {
+ if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
+ &index) != TCL_OK) {
return TCL_ERROR;
}
- tkwin = Tk_NameToWindow(interp, argv[2], tkwin);
+ string = Tcl_GetStringFromObj(objv[2], NULL);
+ tkwin = Tk_NameToWindow(interp, string, tkwin);
if (tkwin == NULL) {
return TCL_ERROR;
}
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index 1f3aaea..c4d1768 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -11,11 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * Author: Paul Mackerras (paulus@cs.anu.edu.au),
- * Department of Computer Science,
- * Australian National University.
- *
- * RCS: @(#) $Id: tkImgPhoto.c,v 1.2 1998/09/14 18:23:13 stanton Exp $
+ * RCS: @(#) $Id: tkImgPhoto.c,v 1.3 1998/09/30 19:01:20 rjohnson Exp $
*/
#include "tkInt.h"
diff --git a/generic/tkInt.h b/generic/tkInt.h
index d07155f..fd26ad9 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: $Id: tkInt.h,v 1.7 1998/09/14 18:23:13 stanton Exp $
+ * RCS: $Id: tkInt.h,v 1.8 1998/09/30 19:01:20 rjohnson Exp $
*/
#ifndef _TKINT
@@ -711,8 +711,6 @@ EXTERN char * TkAlignImageData _ANSI_ARGS_((XImage *image,
int alignment, int bitOrder));
EXTERN TkWindow * TkAllocWindow _ANSI_ARGS_((TkDisplay *dispPtr,
int screenNum, TkWindow *parentPtr));
-EXTERN int TkAreaToPolygon _ANSI_ARGS_((double *polyPtr,
- int numPoints, double *rectPtr));
EXTERN void TkBezierPoints _ANSI_ARGS_((double control[],
int numSteps, double *coordPtr));
EXTERN void TkBezierScreenPoints _ANSI_ARGS_((Tk_Canvas canvas,
@@ -742,9 +740,6 @@ EXTERN unsigned long TkCreateBindingProcedure _ANSI_ARGS_((
ClientData object, char *eventString,
TkBindEvalProc *evalProc, TkBindFreeProc *freeProc,
ClientData clientData));
-EXTERN Pixmap TkCreateBitmapFromData _ANSI_ARGS_((Display* display,
- Drawable d, CONST char* data,
- unsigned int width, unsigned int height));
EXTERN TkCursor * TkCreateCursorFromData _ANSI_ARGS_((Tk_Window tkwin,
char *source, char *mask, int width, int height,
int xHot, int yHot, XColor fg, XColor bg));
@@ -767,8 +762,6 @@ EXTERN void TkDoConfigureNotify _ANSI_ARGS_((TkWindow *winPtr));
EXTERN void TkDrawInsetFocusHighlight _ANSI_ARGS_((
Tk_Window tkwin, GC gc, int width,
Drawable drawable, int padding));
-EXTERN void TkEventCleanupProc _ANSI_ARGS_((
- ClientData clientData, Tcl_Interp *interp));
EXTERN void TkEventDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
EXTERN void TkFillPolygon _ANSI_ARGS_((Tk_Canvas canvas,
double *coordPtr, int numPoints, Display *display,
@@ -811,9 +804,6 @@ EXTERN int TkGetInterpNames _ANSI_ARGS_((Tcl_Interp *interp,
EXTERN int TkGetMiterPoints _ANSI_ARGS_((double p1[], double p2[],
double p3[], double width, double m1[],
double m2[]));
-#ifndef TkGetNativeProlog
-EXTERN int TkGetNativeProlog _ANSI_ARGS_((Tcl_Interp *interp));
-#endif
EXTERN void TkGetPointerCoords _ANSI_ARGS_((Tk_Window tkwin,
int *xPtr, int *yPtr));
EXTERN int TkGetProlog _ANSI_ARGS_((Tcl_Interp *interp));
@@ -821,8 +811,6 @@ EXTERN void TkGetServerInfo _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Window tkwin));
EXTERN void TkGrabDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
EXTERN int TkGrabState _ANSI_ARGS_((TkWindow *winPtr));
-EXTERN TkWindow * TkIDToWindow _ANSI_ARGS_((Window window,
- TkDisplay *display));
EXTERN void TkIncludePoint _ANSI_ARGS_((Tk_Item *itemPtr,
double *pointPtr));
EXTERN void TkInitXId _ANSI_ARGS_((TkDisplay *dispPtr));
@@ -840,12 +828,6 @@ EXTERN int TkLineToArea _ANSI_ARGS_((double end1Ptr[2],
double end2Ptr[2], double rectPtr[4]));
EXTERN double TkLineToPoint _ANSI_ARGS_((double end1Ptr[2],
double end2Ptr[2], double pointPtr[2]));
-EXTERN int TkListAppend _ANSI_ARGS_((void **headPtrPtr,
- void *itemPtr, size_t size));
-EXTERN int TkListDelete _ANSI_ARGS_((void **headPtrPtr,
- void *itemPtr, size_t size));
-EXTERN void * TkListFind _ANSI_ARGS_((void *headPtr, void *itemPtr,
- size_t size));
EXTERN int TkMakeBezierCurve _ANSI_ARGS_((Tk_Canvas canvas,
double *pointPtr, int numPoints, int numSteps,
XPoint xPoints[], double dblPoints[]));
@@ -993,8 +975,6 @@ EXTERN void TkWmRestackToplevel _ANSI_ARGS_((TkWindow *winPtr,
int aboveBelow, TkWindow *otherPtr));
EXTERN void TkWmSetClass _ANSI_ARGS_((TkWindow *winPtr));
EXTERN void TkWmUnmapWindow _ANSI_ARGS_((TkWindow *winPtr));
-EXTERN int TkXFileProc _ANSI_ARGS_((ClientData clientData,
- int mask, int flags));
/*
* Unsupported commands.
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 6b294e4..64b06a8 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWindow.c,v 1.3 1998/09/14 18:23:20 stanton Exp $
+ * RCS: @(#) $Id: tkWindow.c,v 1.4 1998/09/30 19:01:20 rjohnson Exp $
*/
#include "tkPort.h"
@@ -101,7 +101,7 @@ static TkCmd commands[] = {
* Commands that are part of the intrinsics:
*/
- {"bell", Tk_BellCmd, NULL, 0},
+ {"bell", NULL, Tk_BellObjCmd, 0},
{"bind", Tk_BindCmd, NULL, 1},
{"bindtags", Tk_BindtagsCmd, NULL, 1},
{"clipboard", Tk_ClipboardCmd, NULL, 0},
diff --git a/mac/tkMacInt.h b/mac/tkMacInt.h
index 2d863ae..04b132b 100644
--- a/mac/tkMacInt.h
+++ b/mac/tkMacInt.h
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacInt.h,v 1.4 1998/09/14 18:23:36 stanton Exp $
+ * RCS: @(#) $Id: tkMacInt.h,v 1.5 1998/09/30 19:01:21 rjohnson Exp $
*/
#ifndef _TKMACINT
@@ -292,10 +292,5 @@ extern Tk_Window Tk_TopCoordsToWindow _ANSI_ARGS_((Tk_Window tkwin,
int rootX, int rootY, int *newX, int *newY));
extern MacDrawable * TkMacContainerId _ANSI_ARGS_((TkWindow *winPtr));
extern MacDrawable * TkMacGetHostToplevel _ANSI_ARGS_((TkWindow *winPtr));
-/*
- * The following prototypes need to go into tkMac.h
- */
-EXTERN void Tk_UpdatePointer _ANSI_ARGS_((Tk_Window tkwin,
- int x, int y, int state));
#endif /* _TKMACINT */
diff --git a/mac/tkMacPort.h b/mac/tkMacPort.h
index e83e35a..ecd5a5b 100644
--- a/mac/tkMacPort.h
+++ b/mac/tkMacPort.h
@@ -6,11 +6,12 @@
* #includes for system include files and a few other things.
*
* Copyright (c) 1994-1996 Sun Microsystems, Inc.
+ * Copyright (c) 1998 by Scriptics Corporation.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacPort.h,v 1.2 1998/09/14 18:23:38 stanton Exp $
+ * RCS: @(#) $Id: tkMacPort.h,v 1.3 1998/09/30 19:01:21 rjohnson Exp $
*/
#ifndef _TKMACPORT
diff --git a/mac/tkMacProlog.c b/mac/tkMacProlog.c
deleted file mode 100644
index c996f21..0000000
--- a/mac/tkMacProlog.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * tkMacProlog.c --
- *
- * Implements a method on the Macintosh to get the prolog
- * from the resource fork of our application (or the shared
- * library).
- *
- * Copyright (c) 1996-1997 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * RCS: @(#) $Id: tkMacProlog.c,v 1.2 1998/09/14 18:23:38 stanton Exp $
- */
-
-#include "tkInt.h"
-#include "tclMacInt.h"
-#include <Resources.h>
-
-/*
- *--------------------------------------------------------------
- *
- * TkGetNativeProlog --
- *
- * Locate and load the postscript prolog from the resource
- * fork of the application. If it can't be found then we
- * will try looking for the file in the system folder.
- *
- * Results:
- * A standard Tcl Result. If everything is OK the prolog
- * will be located in the result string of the interpreter.
- *
- * Side effects:
- * None.
- *
- *--------------------------------------------------------------
- */
-
-int
-TkGetNativeProlog(
- Tcl_Interp *interp) /* Places the prolog in the result. */
-{
- Handle resource;
- char *stringPtr;
- int releaseIt;
-
-
- resource = Tcl_MacFindResource(interp, 'TEXT', "prolog", -1,
- NULL, &releaseIt);
-
- if (resource != NULL) {
- stringPtr = Tcl_MacConvertTextResource(resource);
- Tcl_SetResult(interp, stringPtr, TCL_DYNAMIC);
- if (releaseIt) {
- ReleaseResource(resource);
- }
- return TCL_OK;
- } else {
- return TkGetProlog(interp);
- }
-}
diff --git a/tests/bell.test b/tests/bell.test
index c23de2d..0c88769 100644
--- a/tests/bell.test
+++ b/tests/bell.test
@@ -3,11 +3,12 @@
#
# Copyright (c) 1994 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
+# Copyright (c) 1998 by Scriptics Corporation.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: bell.test,v 1.2 1998/09/14 18:23:42 stanton Exp $
+# RCS: @(#) $Id: bell.test,v 1.3 1998/09/30 19:01:22 rjohnson Exp $
if {[string compare test [info procs test]] == 1} {
source defs
@@ -28,6 +29,8 @@ test bell-1.4 {bell command} {
after 500
bell -displayof .
after 200
+ bell -dis .
+ after 200
bell
after 200
bell
diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h
index bea8ee6..5b0800a 100644
--- a/unix/tkUnixPort.h
+++ b/unix/tkUnixPort.h
@@ -7,11 +7,12 @@
*
* Copyright (c) 1991-1993 The Regents of the University of California.
* Copyright (c) 1994-1996 Sun Microsystems, Inc.
+ * Copyright (c) 1998 by Scriptics Corporation.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixPort.h,v 1.2 1998/09/14 18:23:57 stanton Exp $
+ * RCS: @(#) $Id: tkUnixPort.h,v 1.3 1998/09/30 19:01:22 rjohnson Exp $
*/
#ifndef _UNIXPORT
@@ -158,12 +159,6 @@ extern int errno;
srcy, width, height);
/*
- * The following Tk functions are implemented as macros under Windows.
- */
-
-#define TkGetNativeProlog(interp) TkGetProlog(interp)
-
-/*
* Supply macros for seek offsets, if they're not already provided by
* an include file.
*/
diff --git a/win/tkWinPort.h b/win/tkWinPort.h
index 07b0939..55a0300 100644
--- a/win/tkWinPort.h
+++ b/win/tkWinPort.h
@@ -6,11 +6,12 @@
* file that contains #ifdefs to handle different flavors of OS.
*
* Copyright (c) 1995-1996 Sun Microsystems, Inc.
+ * Copyright (c) 1998 by Scriptics Corporation.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinPort.h,v 1.2 1998/09/14 18:24:01 stanton Exp $
+ * RCS: @(#) $Id: tkWinPort.h,v 1.3 1998/09/30 19:01:22 rjohnson Exp $
*/
#ifndef _WINPORT
@@ -89,7 +90,6 @@
* The following Tk functions are implemented as macros under Windows.
*/
-#define TkGetNativeProlog(interp) TkGetProlog(interp)
#define TkpGetPixel(p) (((((p)->red >> 8) & 0xff) \
| ((p)->green & 0xff00) | (((p)->blue << 8) & 0xff0000)) | 0x20000000)