diff options
author | nijtmans <nijtmans> | 2010-05-10 20:58:18 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2010-05-10 20:58:18 (GMT) |
commit | 44d12a1d5aa9b0103f0c3bea1ed81b59d4d383d1 (patch) | |
tree | bce5a861d5ca4dc8dc07981e0771a8076681957e /generic | |
parent | 2e06ee1ffbe3d942b788eb71313d236ce5c412d6 (diff) | |
download | tk-44d12a1d5aa9b0103f0c3bea1ed81b59d4d383d1.zip tk-44d12a1d5aa9b0103f0c3bea1ed81b59d4d383d1.tar.gz tk-44d12a1d5aa9b0103f0c3bea1ed81b59d4d383d1.tar.bz2 |
CONSTify TkCopyAndGlobalEval, TkpSetMainMenubar,
TkpMenuNotifyToplevelCreate, and TkSetWindowMenuBar
Bring Tk_CreateBinding doc and signature (param name) in line.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tk.decls | 4 | ||||
-rw-r--r-- | generic/tkBind.c | 26 | ||||
-rw-r--r-- | generic/tkDecls.h | 6 | ||||
-rw-r--r-- | generic/tkInt.decls | 10 | ||||
-rw-r--r-- | generic/tkIntDecls.h | 23 | ||||
-rw-r--r-- | generic/tkMenu.c | 6 |
6 files changed, 38 insertions, 37 deletions
diff --git a/generic/tk.decls b/generic/tk.decls index e05b320..9e4a06a 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -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: tk.decls,v 1.52 2010/02/17 19:21:15 nijtmans Exp $ +# RCS: @(#) $Id: tk.decls,v 1.53 2010/05/10 20:58:18 nijtmans Exp $ library tk @@ -166,7 +166,7 @@ declare 32 generic { declare 33 generic { unsigned long Tk_CreateBinding(Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, - const char *eventStr, const char *command, int append) + const char *eventStr, const char *script, int append) } declare 34 generic { Tk_BindingTable Tk_CreateBindingTable(Tcl_Interp *interp) diff --git a/generic/tkBind.c b/generic/tkBind.c index e0fcf19..27e9a3b 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -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: tkBind.c,v 1.62 2010/02/13 13:47:49 nijtmans Exp $ + * RCS: @(#) $Id: tkBind.c,v 1.63 2010/05/10 20:58:18 nijtmans Exp $ */ #include "tkInt.h" @@ -107,7 +107,7 @@ typedef struct BindingTable { * * A virtual event is usually never part of the event stream, but instead is * synthesized inline by matching low-level events. However, a virtual event - * may be generated by platform-specific code or by Tcl scripts. In that case, + * may be generated by platform-specific code or by Tcl commands. In that case, * no lookup of the virtual event will need to be done using this table, * because the virtual event is actually in the event stream. */ @@ -284,7 +284,7 @@ typedef struct PhysicalsOwned { /* * One of the following structures exists for each interpreter. This structure * keeps track of the current display and screen in the interpreter, so that a - * script can be invoked whenever the display/screen changes (the script does + * command can be invoked whenever the display/screen changes (the command does * things like point tk::Priv at a display-specific structure). */ @@ -944,7 +944,7 @@ Tk_CreateBinding( * associated. */ const char *eventString, /* String describing event sequence that * triggers binding. */ - const char *command, /* Contains Tcl command to execute when + const char *script, /* Contains Tcl script to execute when * binding triggers. */ int append) /* 0 means replace any existing binding for * eventString; 1 means append to that @@ -995,17 +995,17 @@ Tk_CreateBinding( oldStr = psPtr->clientData; if ((append != 0) && (oldStr != NULL)) { - size_t length1 = strlen(oldStr), length2 = strlen(command); + size_t length1 = strlen(oldStr), length2 = strlen(script); newStr = ckalloc((unsigned) length1 + length2 + 2); memcpy(newStr, oldStr, length1); newStr[length1] = '\n'; - memcpy(newStr+length1+1, command, length2+1); + memcpy(newStr+length1+1, script, length2+1); } else { - size_t length = strlen(command); + size_t length = strlen(script); newStr = ckalloc((unsigned) length+1); - memcpy(newStr, command, length+1); + memcpy(newStr, script, length+1); } if (oldStr != NULL) { ckfree(oldStr); @@ -1195,10 +1195,10 @@ Tk_DeleteBinding( * * Tk_GetBinding -- * - * Return the command associated with a given event string. + * Return the script associated with a given event string. * * Results: - * The return value is a pointer to the command string associated with + * The return value is a pointer to the script associated with * eventString for object in the domain given by bindingTable. If there * is no binding for eventString, or if eventString is improperly formed, * then NULL is returned and an error message is left in the interp's @@ -1374,9 +1374,9 @@ Tk_DeleteAllBindings( * None. * * Side effects: - * Depends on the command associated with the matching binding. + * Depends on the script associated with the matching binding. * - * All Tcl bindings scripts for each object are accumulated before the + * All Tcl binding scripts for each object are accumulated before the * first binding is evaluated. If the action of a Tcl binding is to * change or delete a binding, or delete the window associated with the * binding, all the original Tcl binding scripts will still fire. @@ -4637,7 +4637,7 @@ TkKeysymToString( int TkCopyAndGlobalEval( Tcl_Interp *interp, /* Interpreter in which to evaluate script. */ - char *script) /* Script to evaluate. */ + const char *script) /* Script to evaluate. */ { Tcl_DString buffer; int code; diff --git a/generic/tkDecls.h b/generic/tkDecls.h index 8c0184e..dacb04c 100644 --- a/generic/tkDecls.h +++ b/generic/tkDecls.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: tkDecls.h,v 1.46 2010/02/17 19:21:16 nijtmans Exp $ + * RCS: @(#) $Id: tkDecls.h,v 1.47 2010/05/10 20:58:18 nijtmans Exp $ */ #ifndef _TKDECLS @@ -250,7 +250,7 @@ EXTERN Tk_Window Tk_CoordsToWindow(int rootX, int rootY, EXTERN unsigned long Tk_CreateBinding(Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, const char *eventStr, - const char *command, int append); + const char *script, int append); #endif #ifndef Tk_CreateBindingTable_TCL_DECLARED #define Tk_CreateBindingTable_TCL_DECLARED @@ -1737,7 +1737,7 @@ typedef struct TkStubs { void (*tk_ConfigureWindow) (Tk_Window tkwin, unsigned int valueMask, XWindowChanges *valuePtr); /* 30 */ Tk_TextLayout (*tk_ComputeTextLayout) (Tk_Font font, const char *str, int numChars, int wrapLength, Tk_Justify justify, int flags, int *widthPtr, int *heightPtr); /* 31 */ Tk_Window (*tk_CoordsToWindow) (int rootX, int rootY, Tk_Window tkwin); /* 32 */ - unsigned long (*tk_CreateBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, const char *eventStr, const char *command, int append); /* 33 */ + unsigned long (*tk_CreateBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, const char *eventStr, const char *script, int append); /* 33 */ Tk_BindingTable (*tk_CreateBindingTable) (Tcl_Interp *interp); /* 34 */ Tk_ErrorHandler (*tk_CreateErrorHandler) (Display *display, int errNum, int request, int minorCode, Tk_ErrorProc *errorProc, ClientData clientData); /* 35 */ void (*tk_CreateEventHandler) (Tk_Window token, unsigned long mask, Tk_EventProc *proc, ClientData clientData); /* 36 */ diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 01be8a0..eea2ea4 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -10,7 +10,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.decls,v 1.60 2009/12/16 22:00:31 nijtmans Exp $ +# RCS: @(#) $Id: tkInt.decls,v 1.61 2010/05/10 20:58:18 nijtmans Exp $ library tk @@ -59,7 +59,7 @@ declare 9 generic { int innerWidth, int innerHeight, int *xPtr, int *yPtr) } declare 10 generic { - int TkCopyAndGlobalEval(Tcl_Interp *interp, char *script) + int TkCopyAndGlobalEval(Tcl_Interp *interp, const char *script) } declare 11 generic { unsigned long TkCreateBindingProcedure(Tcl_Interp *interp, @@ -255,7 +255,7 @@ declare 66 generic { Window TkpMakeWindow(TkWindow *winPtr, Window parent) } declare 67 generic { - void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp1, char *menuName) + void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp, const char *menuName) } declare 68 generic { TkDisplay *TkpOpenDisplay(const char *display_name) @@ -276,7 +276,7 @@ declare 73 generic { void TkpRedirectKeyEvent(TkWindow *winPtr, XEvent *eventPtr) } declare 74 generic { - void TkpSetMainMenubar(Tcl_Interp *interp, Tk_Window tkwin, char *menuName) + void TkpSetMainMenubar(Tcl_Interp *interp, Tk_Window tkwin, const char *menuName) } declare 75 generic { int TkpUseWindow(Tcl_Interp *interp, Tk_Window tkwin, const char *string) @@ -314,7 +314,7 @@ declare 83 generic { declare 85 generic { void TkSetWindowMenuBar(Tcl_Interp *interp, Tk_Window tkwin, - char *oldMenuName, char *menuName) + const char *oldMenuName, const char *menuName) } declare 86 generic { KeySym TkStringToKeysym(const char *name) diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index 4b5d51f..020b584 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.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: tkIntDecls.h,v 1.49 2010/02/05 10:56:43 nijtmans Exp $ + * RCS: @(#) $Id: tkIntDecls.h,v 1.50 2010/05/10 20:58:18 nijtmans Exp $ */ #ifndef _TKINTDECLS @@ -101,7 +101,8 @@ EXTERN void TkComputeAnchor(Tk_Anchor anchor, Tk_Window tkwin, #ifndef TkCopyAndGlobalEval_TCL_DECLARED #define TkCopyAndGlobalEval_TCL_DECLARED /* 10 */ -EXTERN int TkCopyAndGlobalEval(Tcl_Interp *interp, char *script); +EXTERN int TkCopyAndGlobalEval(Tcl_Interp *interp, + const char *script); #endif #ifndef TkCreateBindingProcedure_TCL_DECLARED #define TkCreateBindingProcedure_TCL_DECLARED @@ -426,8 +427,8 @@ EXTERN Window TkpMakeWindow(TkWindow *winPtr, Window parent); #ifndef TkpMenuNotifyToplevelCreate_TCL_DECLARED #define TkpMenuNotifyToplevelCreate_TCL_DECLARED /* 67 */ -EXTERN void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp1, - char *menuName); +EXTERN void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp, + const char *menuName); #endif #ifndef TkpOpenDisplay_TCL_DECLARED #define TkpOpenDisplay_TCL_DECLARED @@ -466,7 +467,7 @@ EXTERN void TkpRedirectKeyEvent(TkWindow *winPtr, #define TkpSetMainMenubar_TCL_DECLARED /* 74 */ EXTERN void TkpSetMainMenubar(Tcl_Interp *interp, - Tk_Window tkwin, char *menuName); + Tk_Window tkwin, const char *menuName); #endif #ifndef TkpUseWindow_TCL_DECLARED #define TkpUseWindow_TCL_DECLARED @@ -523,8 +524,8 @@ EXTERN void TkSelPropProc(XEvent *eventPtr); #define TkSetWindowMenuBar_TCL_DECLARED /* 85 */ EXTERN void TkSetWindowMenuBar(Tcl_Interp *interp, - Tk_Window tkwin, char *oldMenuName, - char *menuName); + Tk_Window tkwin, const char *oldMenuName, + const char *menuName); #endif #ifndef TkStringToKeysym_TCL_DECLARED #define TkStringToKeysym_TCL_DECLARED @@ -1126,7 +1127,7 @@ typedef struct TkIntStubs { void (*tkChangeEventWindow) (XEvent *eventPtr, TkWindow *winPtr); /* 7 */ int (*tkClipInit) (Tcl_Interp *interp, TkDisplay *dispPtr); /* 8 */ void (*tkComputeAnchor) (Tk_Anchor anchor, Tk_Window tkwin, int padX, int padY, int innerWidth, int innerHeight, int *xPtr, int *yPtr); /* 9 */ - int (*tkCopyAndGlobalEval) (Tcl_Interp *interp, char *script); /* 10 */ + int (*tkCopyAndGlobalEval) (Tcl_Interp *interp, const char *script); /* 10 */ unsigned long (*tkCreateBindingProcedure) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, const char *eventString, TkBindEvalProc *evalProc, TkBindFreeProc *freeProc, ClientData clientData); /* 11 */ TkCursor * (*tkCreateCursorFromData) (Tk_Window tkwin, const char *source, const char *mask, int width, int height, int xHot, int yHot, XColor fg, XColor bg); /* 12 */ int (*tkCreateFrame) (ClientData clientData, Tcl_Interp *interp, int argc, const char *const *argv, int toplevel, const char *appName); /* 13 */ @@ -1183,14 +1184,14 @@ typedef struct TkIntStubs { void (*tkpMakeContainer) (Tk_Window tkwin); /* 64 */ void (*tkpMakeMenuWindow) (Tk_Window tkwin, int transient); /* 65 */ Window (*tkpMakeWindow) (TkWindow *winPtr, Window parent); /* 66 */ - void (*tkpMenuNotifyToplevelCreate) (Tcl_Interp *interp1, char *menuName); /* 67 */ + void (*tkpMenuNotifyToplevelCreate) (Tcl_Interp *interp, const char *menuName); /* 67 */ TkDisplay * (*tkpOpenDisplay) (const char *display_name); /* 68 */ int (*tkPointerEvent) (XEvent *eventPtr, TkWindow *winPtr); /* 69 */ int (*tkPolygonToArea) (double *polyPtr, int numPoints, double *rectPtr); /* 70 */ double (*tkPolygonToPoint) (double *polyPtr, int numPoints, double *pointPtr); /* 71 */ int (*tkPositionInTree) (TkWindow *winPtr, TkWindow *treePtr); /* 72 */ void (*tkpRedirectKeyEvent) (TkWindow *winPtr, XEvent *eventPtr); /* 73 */ - void (*tkpSetMainMenubar) (Tcl_Interp *interp, Tk_Window tkwin, char *menuName); /* 74 */ + void (*tkpSetMainMenubar) (Tcl_Interp *interp, Tk_Window tkwin, const char *menuName); /* 74 */ int (*tkpUseWindow) (Tcl_Interp *interp, Tk_Window tkwin, const char *string); /* 75 */ void *reserved76; void (*tkQueueEventForAllChildren) (TkWindow *winPtr, XEvent *eventPtr); /* 77 */ @@ -1201,7 +1202,7 @@ typedef struct TkIntStubs { void (*tkSelInit) (Tk_Window tkwin); /* 82 */ void (*tkSelPropProc) (XEvent *eventPtr); /* 83 */ void *reserved84; - void (*tkSetWindowMenuBar) (Tcl_Interp *interp, Tk_Window tkwin, char *oldMenuName, char *menuName); /* 85 */ + void (*tkSetWindowMenuBar) (Tcl_Interp *interp, Tk_Window tkwin, const char *oldMenuName, const char *menuName); /* 85 */ KeySym (*tkStringToKeysym) (const char *name); /* 86 */ int (*tkThickPolyLineToArea) (double *coordPtr, int numPoints, double width, int capStyle, int joinStyle, double *rectPtr); /* 87 */ void (*tkWmAddToColormapWindows) (TkWindow *winPtr); /* 88 */ diff --git a/generic/tkMenu.c b/generic/tkMenu.c index f044370..9b2b4e3 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.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: tkMenu.c,v 1.59 2010/02/17 20:58:32 jenglish Exp $ + * RCS: @(#) $Id: tkMenu.c,v 1.60 2010/05/10 20:58:18 nijtmans Exp $ */ /* @@ -3164,10 +3164,10 @@ void TkSetWindowMenuBar( Tcl_Interp *interp, /* The interpreter the toplevel lives in. */ Tk_Window tkwin, /* The toplevel window. */ - char *oldMenuName, /* The name of the menubar previously set in + const char *oldMenuName, /* The name of the menubar previously set in * this toplevel. NULL means no menu was set * previously. */ - char *menuName) /* The name of the new menubar that the + const char *menuName) /* The name of the new menubar that the * toplevel needs to be set to. NULL means * that their is no menu now. */ { |