From de39e31b0e2fe25bdace0f7cc595bf23c3b50647 Mon Sep 17 00:00:00 2001 From: ericm Date: Wed, 22 Nov 2000 01:49:37 +0000 Subject: Overall change: Implemented TIP 5, which exports TkClassProcs/TkSetClassProcs as Tk_ClassProcs/Tk_SetClassProcs, adding a size field to Tk_ClassProcs to allow for future expansion, and renaming the geometryProc to worldChangedProc, which is more in keeping with the actual use of the callback. See ChangeLog for details. --- ChangeLog | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++ generic/tk.decls | 7 +++-- generic/tk.h | 47 +++++++++++++++++++++++++++++++- generic/tkBind.c | 9 ++++--- generic/tkButton.c | 4 +-- generic/tkButton.h | 4 +-- generic/tkCanvas.c | 11 ++++---- generic/tkDecls.h | 11 +++++++- generic/tkEntry.c | 13 +++++---- generic/tkFont.c | 28 +++++++++++++++++--- generic/tkFrame.c | 4 +-- generic/tkInt.decls | 11 ++++---- generic/tkInt.h | 30 ++------------------- generic/tkIntDecls.h | 14 +++------- generic/tkListbox.c | 11 ++++---- generic/tkMenu.c | 12 ++++----- generic/tkMenubutton.c | 4 +-- generic/tkMenubutton.h | 4 +-- generic/tkMessage.c | 13 +++++---- generic/tkScale.c | 11 ++++---- generic/tkScrollbar.c | 4 +-- generic/tkScrollbar.h | 4 +-- generic/tkStubInit.c | 5 ++-- generic/tkText.c | 11 ++++---- generic/tkWindow.c | 16 +++++------ mac/tkMacButton.c | 9 +++---- mac/tkMacMenubutton.c | 9 +++---- mac/tkMacScrlbr.c | 12 ++++----- unix/mkLinks | 4 +++ unix/tkUnixButton.c | 9 +++---- unix/tkUnixMenubu.c | 9 +++---- unix/tkUnixScrlbr.c | 12 ++++----- win/tkWinButton.c | 10 +++---- win/tkWinScrlbr.c | 7 ++--- 34 files changed, 279 insertions(+), 162 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6e333e2..6ca0b5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,75 @@ +2000-11-21 Eric Melski + + Overall change: Implemented TIP 5, which exports + TkClassProcs/TkSetClassProcs as Tk_ClassProcs/Tk_SetClassProcs, + adding a size field to Tk_ClassProcs to allow for future + expansion, and renaming the geometryProc to worldChangedProc, + which is more in keeping with the actual use of the callback. + + * unix/mkLinks: Added link for Tk_SetClassProcs. + + * doc/SetClassProcs.3: Documentation for + Tk_ClassProcs/Tk_SetClassProcs. + + * generic/tkCanvas.c: + * generic/tkEntry.c: + * generic/tkFrame.c: + * generic/tkListbox.c: + * generic/tkMenu.c: + * generic/tkMessage.c: + * generic/tkScale.c: + * generic/tkText.c: Updated to use Tk_ClassProcs/Tk_SetClassProcs + instead of TkClassProcs/TkSetClassProcs. + + * generic/tkMenubutton.c: + * generic/tkScrollbar.c: + * generic/tkButton.c: Updated to use Tk_SetClassProcs instead of + TkSetClassProcs. + + * generic/tkMenubutton.h: + * generic/tkScrollbar.h: + * generic/tkButton.h: + * win/tkWinButton.c: + * win/tkWinScrlbr.c: + * mac/tkMacButton.c: + * mac/tkMacMenubutton.c: + * mac/tkMacScrlbr.c: + * unix/tkUnixButton.c: + * unix/tkUnixMenubu.c: + * unix/tkUnixScrlbr.c: Updated to use Tk_ClassProcs instead of + TkClassProcs. + + * generic/tkDecls.h: + * generic/tkStubInit.c: + * generic/tkIntDecls.h: Regenned from tk.decls, tkInt.decls. + + * generic/tk.h: Added declaration of Tk_ClassProcs, with size + field. Added typedef's for Tk_ClassCreateProc, + Tk_ClassWorldChangedProc, Tk_ClassModalProc. Added definition of + Tk_GetClassProc macro, shorthand for extracting a member of the + Tk_ClassProcs structure. + + * generic/tkInt.h: Removed declaration of TkClassProcs, + TkClassGeometryProc, etc. + + * generic/tkBind.c (Tk_BindEvent): Updated to use Tk_GetClassProc + macro to extract modalProc; added check that the modalProc is non-NULL. + + * generic/tkFont.c (RecomputeWidgets): Updated to use + Tk_GetClassProc macro to extract worldChangedProc; added comment + about the choice of a recursive versus iterative algorithm for + propagating world changed messages. + + * generic/tkWindow.c (Tk_MakeWindowExist): Updated to use + Tk_GetClassProc macro to extract createProc from Tk_ClassProcs. + + * generic/tk.decls: Added declaration for Tk_SetClassProcs. + + * generic/tkInt.decls: Commented out declaration for + TkSetClassProcs, which is made public by this change. The entry + is left in place, but commented, so that future developers will + know not to reuse it's stub number. + 2000-11-21 Donal K. Fellows * doc/ConfigWidg.3: Added deprecation note from Bug #120944 - use diff --git a/generic/tk.decls b/generic/tk.decls index ef1057d..d9b4a32 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.13 2000/10/21 21:22:42 ericm Exp $ +# RCS: @(#) $Id: tk.decls,v 1.14 2000/11/22 01:49:37 ericm Exp $ library tk @@ -1142,7 +1142,10 @@ declare 241 generic { Tk_Window Tk_CreateAnonymousWindow (Tcl_Interp *interp, \ Tk_Window parent, char *screenName) } - +declare 242 generic { + void Tk_SetClassProcs (Tk_Window tkwin, \ + Tk_ClassProcs *procs, ClientData instanceData) +} # Define the platform specific public Tk interface. These functions are # only available on the designated platform. diff --git a/generic/tk.h b/generic/tk.h index 206c864..d91da04 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -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: tk.h,v 1.52 2000/10/05 18:31:25 ericm Exp $ + * RCS: @(#) $Id: tk.h,v 1.53 2000/11/22 01:49:37 ericm Exp $ */ #ifndef _TK @@ -548,6 +548,51 @@ typedef struct Tk_FontMetrics { #define TK_IGNORE_NEWLINES 16 /* + * Widget class procedures used to implement platform specific widget + * behavior. + */ + +typedef Window (Tk_ClassCreateProc) _ANSI_ARGS_((Tk_Window tkwin, + Window parent, ClientData instanceData)); +typedef void (Tk_ClassWorldChangedProc) _ANSI_ARGS_((ClientData instanceData)); +typedef void (Tk_ClassModalProc) _ANSI_ARGS_((Tk_Window tkwin, + XEvent *eventPtr)); + +typedef struct Tk_ClassProcs { + unsigned int size; + Tk_ClassWorldChangedProc *worldChangedProc; + /* Procedure to invoke when the widget needs to + * respond in some way to a change in the + * world (font changes, etc.) */ + Tk_ClassCreateProc *createProc; + /* Procedure to invoke when the + * platform-dependent window needs to be + * created. */ + Tk_ClassModalProc *modalProc; + /* Procedure to invoke after all bindings on a + * widget have been triggered in order to + * handle a modal loop. */ +} Tk_ClassProcs; + +/* + * Simple accessor for Tk_ClassProcs structure. Checks that the structure + * is not NULL, then checks the size field and returns either the requested + * field, if present, or NULL if the structure is too small to have the field + * (or NULL if the structure is NULL). + * + * A more general version of this function may be useful if other + * size-versioned structure pop up in the future: + * + * #define Tk_GetField(name, who, which) \ + * (((who) == NULL) ? NULL : + * (((who)->size <= Tk_Offset(name, which)) ? NULL :(name)->which)) + */ + +#define Tk_GetClassProc(procs, which) \ + (((procs) == NULL) ? NULL : \ + (((procs)->size <= Tk_Offset(Tk_ClassProcs, which)) ? NULL:(procs)->which)) + +/* * Each geometry manager (the packer, the placer, etc.) is represented * by a structure of the following form, which indicates procedures * to invoke in the geometry manager to carry out certain functions. diff --git a/generic/tkBind.c b/generic/tkBind.c index e105d4d..71e5db1 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.13 2000/04/19 01:06:50 ericm Exp $ + * RCS: @(#) $Id: tkBind.c,v 1.14 2000/11/22 01:49:37 ericm Exp $ */ #include "tkPort.h" @@ -1426,7 +1426,7 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr) PendingBinding staticPending; TkWindow *winPtr = (TkWindow *)tkwin; PatternTableKey key; - + Tk_ClassModalProc *modalProc; /* * Ignore events on windows that don't have names: these are windows * like wrapper windows that shouldn't be visible to the @@ -1805,7 +1805,10 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr) winPtr->flags = (winPtr->flags & (unsigned int) ~TK_DEFER_MODAL) | (flags & TK_DEFER_MODAL); if (deferModal) { - (*winPtr->classProcsPtr->modalProc)(tkwin, eventPtr); + modalProc = Tk_GetClassProc(winPtr->classProcsPtr, modalProc); + if (modalProc != NULL) { + (*modalProc)(tkwin, eventPtr); + } } } diff --git a/generic/tkButton.c b/generic/tkButton.c index ea2c10a..23bc057 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.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: tkButton.c,v 1.11 2000/10/01 21:35:27 ericm Exp $ + * RCS: @(#) $Id: tkButton.c,v 1.12 2000/11/22 01:49:37 ericm Exp $ */ #include "tkButton.h" @@ -658,7 +658,7 @@ ButtonCreate(clientData, interp, objc, objv, type) Tk_SetClass(tkwin, classNames[type]); butPtr = TkpCreateButton(tkwin); - TkSetClassProcs(tkwin, &tkpButtonProcs, (ClientData) butPtr); + Tk_SetClassProcs(tkwin, &tkpButtonProcs, (ClientData) butPtr); /* * Initialize the data structure for the button. diff --git a/generic/tkButton.h b/generic/tkButton.h index 97cc1f0..6469d46 100644 --- a/generic/tkButton.h +++ b/generic/tkButton.h @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkButton.h,v 1.7 2000/05/17 21:17:20 ericm Exp $ + * RCS: @(#) $Id: tkButton.h,v 1.8 2000/11/22 01:49:37 ericm Exp $ */ #ifndef _TKBUTTON @@ -287,7 +287,7 @@ typedef struct { * Declaration of variables shared between the files in the button module. */ -extern TkClassProcs tkpButtonProcs; +extern Tk_ClassProcs tkpButtonProcs; /* * Declaration of procedures used in the implementation of the button diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 709375a..0820e02 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.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: tkCanvas.c,v 1.14 2000/04/14 08:33:15 hobbs Exp $ + * RCS: @(#) $Id: tkCanvas.c,v 1.15 2000/11/22 01:49:37 ericm Exp $ */ /* #define USE_OLD_TAG_SEARCH 1 */ @@ -330,10 +330,9 @@ static Tk_Item * TagSearchNext _ANSI_ARGS_((TagSearch *searchPtr)); * that can be invoked from generic window code. */ -static TkClassProcs canvasClass = { - NULL, /* createProc. */ - CanvasWorldChanged, /* geometryProc. */ - NULL /* modalProc. */ +static Tk_ClassProcs canvasClass = { + sizeof(Tk_ClassProcs), /* size */ + CanvasWorldChanged, /* worldChangedProc */ }; @@ -467,7 +466,7 @@ Tk_CanvasObjCmd(clientData, interp, argc, argv) Tcl_InitHashTable(&canvasPtr->idTable, TCL_ONE_WORD_KEYS); Tk_SetClass(canvasPtr->tkwin, "Canvas"); - TkSetClassProcs(canvasPtr->tkwin, &canvasClass, (ClientData) canvasPtr); + Tk_SetClassProcs(canvasPtr->tkwin, &canvasClass, (ClientData) canvasPtr); Tk_CreateEventHandler(canvasPtr->tkwin, ExposureMask|StructureNotifyMask|FocusChangeMask, CanvasEventProc, (ClientData) canvasPtr); diff --git a/generic/tkDecls.h b/generic/tkDecls.h index 31f5808..e4753e1 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.13 2000/10/05 18:31:25 ericm Exp $ + * RCS: @(#) $Id: tkDecls.h,v 1.14 2000/11/22 01:49:37 ericm Exp $ */ #ifndef _TKDECLS @@ -830,6 +830,10 @@ EXTERN void Tk_DeleteClientMessageHandler _ANSI_ARGS_(( EXTERN Tk_Window Tk_CreateAnonymousWindow _ANSI_ARGS_(( Tcl_Interp * interp, Tk_Window parent, char * screenName)); +/* 242 */ +EXTERN void Tk_SetClassProcs _ANSI_ARGS_((Tk_Window tkwin, + Tk_ClassProcs * procs, + ClientData instanceData)); typedef struct TkStubHooks { struct TkPlatStubs *tkPlatStubs; @@ -1084,6 +1088,7 @@ typedef struct TkStubs { void (*tk_CreateClientMessageHandler) _ANSI_ARGS_((Tk_ClientMessageProc * proc)); /* 239 */ void (*tk_DeleteClientMessageHandler) _ANSI_ARGS_((Tk_ClientMessageProc * proc)); /* 240 */ Tk_Window (*tk_CreateAnonymousWindow) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window parent, char * screenName)); /* 241 */ + void (*tk_SetClassProcs) _ANSI_ARGS_((Tk_Window tkwin, Tk_ClassProcs * procs, ClientData instanceData)); /* 242 */ } TkStubs; #ifdef __cplusplus @@ -2062,6 +2067,10 @@ extern TkStubs *tkStubsPtr; #define Tk_CreateAnonymousWindow \ (tkStubsPtr->tk_CreateAnonymousWindow) /* 241 */ #endif +#ifndef Tk_SetClassProcs +#define Tk_SetClassProcs \ + (tkStubsPtr->tk_SetClassProcs) /* 242 */ +#endif #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ diff --git a/generic/tkEntry.c b/generic/tkEntry.c index f9031b9..4a01d12 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.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: tkEntry.c,v 1.17 2000/05/29 01:43:14 hobbs Exp $ + * RCS: @(#) $Id: tkEntry.c,v 1.18 2000/11/22 01:49:37 ericm Exp $ */ #include "tkInt.h" @@ -736,10 +736,9 @@ static int ComputeFormat _ANSI_ARGS_((Spinbox *sbPtr)); * that can be invoked from generic window code. */ -static TkClassProcs entryClass = { - NULL, /* createProc. */ - EntryWorldChanged, /* geometryProc. */ - NULL /* modalProc. */ +static Tk_ClassProcs entryClass = { + sizeof(Tk_ClassProcs), /* size */ + EntryWorldChanged, /* worldChangedProc */ }; @@ -839,7 +838,7 @@ Tk_EntryObjCmd(clientData, interp, objc, objv) entryPtr->validate = VALIDATE_NONE; Tk_SetClass(entryPtr->tkwin, "Entry"); - TkSetClassProcs(entryPtr->tkwin, &entryClass, (ClientData) entryPtr); + Tk_SetClassProcs(entryPtr->tkwin, &entryClass, (ClientData) entryPtr); Tk_CreateEventHandler(entryPtr->tkwin, ExposureMask|StructureNotifyMask|FocusChangeMask, EntryEventProc, (ClientData) entryPtr); @@ -3740,7 +3739,7 @@ Tk_SpinboxObjCmd(clientData, interp, objc, objv) sbPtr->buRelief = TK_RELIEF_FLAT; Tk_SetClass(entryPtr->tkwin, "Spinbox"); - TkSetClassProcs(entryPtr->tkwin, &entryClass, (ClientData) entryPtr); + Tk_SetClassProcs(entryPtr->tkwin, &entryClass, (ClientData) entryPtr); Tk_CreateEventHandler(entryPtr->tkwin, PointerMotionMask|ExposureMask|StructureNotifyMask|FocusChangeMask, EntryEventProc, (ClientData) entryPtr); diff --git a/generic/tkFont.c b/generic/tkFont.c index 913c335..b5a4c2c 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.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: tkFont.c,v 1.10 2000/02/03 21:27:26 ericm Exp $ + * RCS: @(#) $Id: tkFont.c,v 1.11 2000/11/22 01:49:38 ericm Exp $ */ #include "tkPort.h" @@ -831,10 +831,30 @@ static void RecomputeWidgets(winPtr) TkWindow *winPtr; /* Window to which command is sent. */ { - if ((winPtr->classProcsPtr != NULL) - && (winPtr->classProcsPtr->geometryProc != NULL)) { - (*winPtr->classProcsPtr->geometryProc)(winPtr->instanceData); + Tk_ClassWorldChangedProc *proc; + proc = Tk_GetClassProc(winPtr->classProcsPtr, worldChangedProc); + if (proc != NULL) { + (*proc)(winPtr->instanceData); } + + /* + * Notify all the descendants of this window that the world has changed. + * + * This could be done recursively or iteratively. The recursive version + * is easier to implement and understand, and typically, windows with a + * -font option will be leaf nodes in the widget heirarchy (buttons, + * labels, etc.), so the recursion depth will be shallow. + * + * However, the additional overhead of the recursive calls may become + * a performance problem if typical usage alters such that -font'ed widgets + * appear high in the heirarchy, causing deep recursion. This could happen + * with text widgets, or more likely with the (not yet existant) labeled + * frame widget. With these widgets it is possible, even likely, that a + * -font'ed widget (text or labeled frame) will not be a leaf node, but + * will instead have many descendants. If this is ever found to cause + * a performance problem, it may be worth investigating an iterative + * version of the code below. + */ for (winPtr = winPtr->childList; winPtr != NULL; winPtr = winPtr->nextPtr) { RecomputeWidgets(winPtr); } diff --git a/generic/tkFrame.c b/generic/tkFrame.c index 3ebe0f2..cf356ce 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.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: tkFrame.c,v 1.6 2000/02/10 08:52:32 hobbs Exp $ + * RCS: @(#) $Id: tkFrame.c,v 1.7 2000/11/22 01:49:38 ericm Exp $ */ #include "default.h" @@ -451,7 +451,7 @@ CreateFrame(clientData, interp, objc, objv, toplevel, appName) /* * Store backreference to frame widget in window structure. */ - TkSetClassProcs(new, NULL, (ClientData) framePtr); + Tk_SetClassProcs(new, NULL, (ClientData) framePtr); mask = ExposureMask | StructureNotifyMask | FocusChangeMask; if (toplevel) { diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 94112c1..c3405dc 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -9,7 +9,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.18 2000/11/21 16:18:05 dkf Exp $ +# RCS: @(#) $Id: tkInt.decls,v 1.19 2000/11/22 01:49:38 ericm Exp $ library tk @@ -396,10 +396,11 @@ declare 83 generic { void TkSelPropProc (XEvent *eventPtr) } -declare 84 generic { - void TkSetClassProcs (Tk_Window tkwin, \ - TkClassProcs *procs, ClientData instanceData) -} +# Exported publically as Tk_SetClassProcs in 8.4a2 +#declare 84 generic { +# void TkSetClassProcs (Tk_Window tkwin, \ +# TkClassProcs *procs, ClientData instanceData) +#} declare 85 generic { void TkSetWindowMenuBar (Tcl_Interp *interp, \ diff --git a/generic/tkInt.h b/generic/tkInt.h index de0c907..bd7764f 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.33 2000/08/08 19:21:19 ericm Exp $ + * RCS: $Id: tkInt.h,v 1.34 2000/11/22 01:49:38 ericm Exp $ */ #ifndef _TKINT @@ -46,32 +46,6 @@ typedef int (TkBindEvalProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, XEvent *eventPtr, Tk_Window tkwin, KeySym keySym)); typedef void (TkBindFreeProc) _ANSI_ARGS_((ClientData clientData)); -typedef Window (TkClassCreateProc) _ANSI_ARGS_((Tk_Window tkwin, - Window parent, ClientData instanceData)); -typedef void (TkClassGeometryProc) _ANSI_ARGS_((ClientData instanceData)); -typedef void (TkClassModalProc) _ANSI_ARGS_((Tk_Window tkwin, - XEvent *eventPtr)); - - -/* - * Widget class procedures used to implement platform specific widget - * behavior. - */ - -typedef struct TkClassProcs { - TkClassCreateProc *createProc; - /* Procedure to invoke when the - platform-dependent window needs to be - created. */ - TkClassGeometryProc *geometryProc; - /* Procedure to invoke when the geometry of a - window needs to be recalculated as a result - of some change in the system. */ - TkClassModalProc *modalProc; - /* Procedure to invoke after all bindings on a - widget have been triggered in order to - handle a modal loop. */ -} TkClassProcs; /* * One of the following structures is maintained for each cursor in @@ -782,7 +756,7 @@ typedef struct TkWindow { * Information used by widget classes. */ - TkClassProcs *classProcsPtr; + Tk_ClassProcs *classProcsPtr; ClientData instanceData; /* diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index 4ae9367..e8e4250 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.11 2000/11/21 16:18:05 dkf Exp $ + * RCS: @(#) $Id: tkIntDecls.h,v 1.12 2000/11/22 01:49:38 ericm Exp $ */ #ifndef _TKINTDECLS @@ -289,10 +289,7 @@ EXTERN void TkSelEventProc _ANSI_ARGS_((Tk_Window tkwin, EXTERN void TkSelInit _ANSI_ARGS_((Tk_Window tkwin)); /* 83 */ EXTERN void TkSelPropProc _ANSI_ARGS_((XEvent * eventPtr)); -/* 84 */ -EXTERN void TkSetClassProcs _ANSI_ARGS_((Tk_Window tkwin, - TkClassProcs * procs, - ClientData instanceData)); +/* Slot 84 is reserved */ /* 85 */ EXTERN void TkSetWindowMenuBar _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, char * oldMenuName, @@ -606,7 +603,7 @@ typedef struct TkIntStubs { void (*tkSelEventProc) _ANSI_ARGS_((Tk_Window tkwin, XEvent * eventPtr)); /* 81 */ void (*tkSelInit) _ANSI_ARGS_((Tk_Window tkwin)); /* 82 */ void (*tkSelPropProc) _ANSI_ARGS_((XEvent * eventPtr)); /* 83 */ - void (*tkSetClassProcs) _ANSI_ARGS_((Tk_Window tkwin, TkClassProcs * procs, ClientData instanceData)); /* 84 */ + void *reserved84; void (*tkSetWindowMenuBar) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, char * oldMenuName, char * menuName)); /* 85 */ KeySym (*tkStringToKeysym) _ANSI_ARGS_((char * name)); /* 86 */ int (*tkThickPolyLineToArea) _ANSI_ARGS_((double * coordPtr, int numPoints, double width, int capStyle, int joinStyle, double * rectPtr)); /* 87 */ @@ -1175,10 +1172,7 @@ extern TkIntStubs *tkIntStubsPtr; #define TkSelPropProc \ (tkIntStubsPtr->tkSelPropProc) /* 83 */ #endif -#ifndef TkSetClassProcs -#define TkSetClassProcs \ - (tkIntStubsPtr->tkSetClassProcs) /* 84 */ -#endif +/* Slot 84 is reserved */ #ifndef TkSetWindowMenuBar #define TkSetWindowMenuBar \ (tkIntStubsPtr->tkSetWindowMenuBar) /* 85 */ diff --git a/generic/tkListbox.c b/generic/tkListbox.c index d931ad7..25e8563 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.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: tkListbox.c,v 1.18 2000/07/28 16:41:40 ericm Exp $ + * RCS: @(#) $Id: tkListbox.c,v 1.19 2000/11/22 01:49:38 ericm Exp $ */ #include "tkPort.h" @@ -434,10 +434,9 @@ static void MigrateHashEntries _ANSI_ARGS_ ((Tcl_HashTable *table, * that can be invoked from generic window code. */ -static TkClassProcs listboxClass = { - NULL, /* createProc. */ - ListboxWorldChanged, /* geometryProc. */ - NULL /* modalProc. */ +static Tk_ClassProcs listboxClass = { + sizeof(Tk_ClassProcs), /* size */ + ListboxWorldChanged, /* worldChangedProc */ }; @@ -576,7 +575,7 @@ Tk_ListboxObjCmd(clientData, interp, objc, objv) listPtr->flags = 0; Tk_SetClass(listPtr->tkwin, "Listbox"); - TkSetClassProcs(listPtr->tkwin, &listboxClass, (ClientData) listPtr); + Tk_SetClassProcs(listPtr->tkwin, &listboxClass, (ClientData) listPtr); Tk_CreateEventHandler(listPtr->tkwin, ExposureMask|StructureNotifyMask|FocusChangeMask, ListboxEventProc, (ClientData) listPtr); diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 0aac47e..b539186 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.8 2000/08/03 20:36:16 ericm Exp $ + * RCS: @(#) $Id: tkMenu.c,v 1.9 2000/11/22 01:49:38 ericm Exp $ */ /* @@ -363,15 +363,15 @@ static void UnhookCascadeEntry _ANSI_ARGS_((TkMenuEntry *mePtr)); * the geometry proc to be called. */ -static TkClassProcs menuClass = { - NULL, /* createProc. */ - MenuWorldChanged /* geometryProc. */ +static Tk_ClassProcs menuClass = { + sizeof(Tk_ClassProcs), /* size */ + MenuWorldChanged /* worldChangedProc */ }; /* *-------------------------------------------------------------- * - * Tk_CreateMenuCmd -- + * TkCreateMenuCmd -- * * Called by Tk at initialization time to create the menu * command. @@ -523,7 +523,7 @@ MenuCmd(clientData, interp, objc, objv) TkMenuInitializeDrawingFields(menuPtr); Tk_SetClass(menuPtr->tkwin, "Menu"); - TkSetClassProcs(menuPtr->tkwin, &menuClass, (ClientData) menuPtr); + Tk_SetClassProcs(menuPtr->tkwin, &menuClass, (ClientData) menuPtr); if (Tk_InitOptions(interp, (char *) menuPtr, menuPtr->optionTablesPtr->menuOptionTable, menuPtr->tkwin) != TCL_OK) { diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c index 6599269..bfe43d3 100644 --- a/generic/tkMenubutton.c +++ b/generic/tkMenubutton.c @@ -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: tkMenubutton.c,v 1.4 1999/04/24 01:50:49 stanton Exp $ + * RCS: @(#) $Id: tkMenubutton.c,v 1.5 2000/11/22 01:49:38 ericm Exp $ */ #include "tkMenubutton.h" @@ -240,7 +240,7 @@ Tk_MenubuttonObjCmd(clientData, interp, objc, objv) Tk_SetClass(tkwin, "Menubutton"); mbPtr = TkpCreateMenuButton(tkwin); - TkSetClassProcs(tkwin, &tkpMenubuttonClass, (ClientData) mbPtr); + Tk_SetClassProcs(tkwin, &tkpMenubuttonClass, (ClientData) mbPtr); /* * Initialize the data structure for the button. diff --git a/generic/tkMenubutton.h b/generic/tkMenubutton.h index eb7e030..979f23d 100644 --- a/generic/tkMenubutton.h +++ b/generic/tkMenubutton.h @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenubutton.h,v 1.5 1999/04/16 01:51:19 stanton Exp $ + * RCS: @(#) $Id: tkMenubutton.h,v 1.6 2000/11/22 01:49:38 ericm Exp $ */ #ifndef _TKMENUBUTTON @@ -211,7 +211,7 @@ typedef struct { * Declaration of variables shared between the files in the button module. */ -extern TkClassProcs tkpMenubuttonClass; +extern Tk_ClassProcs tkpMenubuttonClass; /* * Declaration of procedures used in the implementation of the button diff --git a/generic/tkMessage.c b/generic/tkMessage.c index e42b581..5a3b3e1 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.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: tkMessage.c,v 1.8 2000/09/06 19:02:01 hobbs Exp $ + * RCS: @(#) $Id: tkMessage.c,v 1.9 2000/11/22 01:49:38 ericm Exp $ */ #include "tkPort.h" @@ -195,17 +195,16 @@ static void DisplayMessage _ANSI_ARGS_((ClientData clientData)); * that can be invoked from generic window code. */ -static TkClassProcs messageClass = { - NULL, /* createProc. */ - MessageWorldChanged, /* geometryProc. */ - NULL /* modalProc. */ +static Tk_ClassProcs messageClass = { + sizeof(Tk_ClassProcs), /* size */ + MessageWorldChanged, /* worldChangedProc */ }; /* *-------------------------------------------------------------- * - * Tk_MessageCmd -- + * Tk_MessageObjCmd -- * * This procedure is invoked to process the "message" Tcl * command. See the user documentation for details on what @@ -282,7 +281,7 @@ Tk_MessageObjCmd(clientData, interp, objc, objv) msgPtr->cursor = None; Tk_SetClass(msgPtr->tkwin, "Message"); - TkSetClassProcs(msgPtr->tkwin, &messageClass, (ClientData) msgPtr); + Tk_SetClassProcs(msgPtr->tkwin, &messageClass, (ClientData) msgPtr); Tk_CreateEventHandler(msgPtr->tkwin, ExposureMask|StructureNotifyMask|FocusChangeMask, MessageEventProc, (ClientData) msgPtr); diff --git a/generic/tkScale.c b/generic/tkScale.c index d81afb8..8327ab7 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -18,7 +18,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkScale.c,v 1.12 2000/04/14 08:33:16 hobbs Exp $ + * RCS: @(#) $Id: tkScale.c,v 1.13 2000/11/22 01:49:38 ericm Exp $ */ #include "tkPort.h" @@ -185,10 +185,9 @@ static void ScaleSetVariable _ANSI_ARGS_((TkScale *scalePtr)); * that can be invoked from generic window code. */ -static TkClassProcs scaleClass = { - NULL, /* createProc. */ - ScaleWorldChanged, /* geometryProc. */ - NULL /* modalProc. */ +static Tk_ClassProcs scaleClass = { + sizeof(Tk_ClassProcs), /* size */ + ScaleWorldChanged, /* worldChangedProc */ }; @@ -314,7 +313,7 @@ Tk_ScaleObjCmd(clientData, interp, objc, objv) scalePtr->takeFocusPtr = NULL; scalePtr->flags = NEVER_SET; - TkSetClassProcs(scalePtr->tkwin, &scaleClass, (ClientData) scalePtr); + Tk_SetClassProcs(scalePtr->tkwin, &scaleClass, (ClientData) scalePtr); Tk_CreateEventHandler(scalePtr->tkwin, ExposureMask|StructureNotifyMask|FocusChangeMask, ScaleEventProc, (ClientData) scalePtr); diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c index eec060e..71e4e21 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.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: tkScrollbar.c,v 1.4 1999/12/14 06:52:30 hobbs Exp $ + * RCS: @(#) $Id: tkScrollbar.c,v 1.5 2000/11/22 01:49:38 ericm Exp $ */ #include "tkPort.h" @@ -153,7 +153,7 @@ Tk_ScrollbarCmd(clientData, interp, argc, argv) Tk_SetClass(new, "Scrollbar"); scrollPtr = TkpCreateScrollbar(new); - TkSetClassProcs(new, &tkpScrollbarProcs, (ClientData) scrollPtr); + Tk_SetClassProcs(new, &tkpScrollbarProcs, (ClientData) scrollPtr); /* * Initialize fields that won't be initialized by ConfigureScrollbar, diff --git a/generic/tkScrollbar.h b/generic/tkScrollbar.h index 4e119e1..f16880a 100644 --- a/generic/tkScrollbar.h +++ b/generic/tkScrollbar.h @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkScrollbar.h,v 1.5 1999/12/14 06:52:30 hobbs Exp $ + * RCS: @(#) $Id: tkScrollbar.h,v 1.6 2000/11/22 01:49:38 ericm Exp $ */ #ifndef _TKSCROLLBAR @@ -171,7 +171,7 @@ typedef struct TkScrollbar { * Declaration of scrollbar class procedures structure. */ -extern TkClassProcs tkpScrollbarProcs; +extern Tk_ClassProcs tkpScrollbarProcs; /* * Declaration of scrollbar configuration options. diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 560fbb2..94263c5 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -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: tkStubInit.c,v 1.25 2000/11/21 16:18:05 dkf Exp $ + * RCS: @(#) $Id: tkStubInit.c,v 1.26 2000/11/22 01:49:38 ericm Exp $ */ #include "tkInt.h" @@ -131,7 +131,7 @@ TkIntStubs tkIntStubs = { TkSelEventProc, /* 81 */ TkSelInit, /* 82 */ TkSelPropProc, /* 83 */ - TkSetClassProcs, /* 84 */ + NULL, /* 84 */ TkSetWindowMenuBar, /* 85 */ TkStringToKeysym, /* 86 */ TkThickPolyLineToArea, /* 87 */ @@ -953,6 +953,7 @@ TkStubs tkStubs = { Tk_CreateClientMessageHandler, /* 239 */ Tk_DeleteClientMessageHandler, /* 240 */ Tk_CreateAnonymousWindow, /* 241 */ + Tk_SetClassProcs, /* 242 */ }; /* !END!: Do not edit above this line. */ diff --git a/generic/tkText.c b/generic/tkText.c index 2ab2e2a..ef1ae4d 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkText.c,v 1.17 2000/07/25 00:05:40 ericm Exp $ + * RCS: @(#) $Id: tkText.c,v 1.18 2000/11/22 01:49:38 ericm Exp $ */ #include "default.h" @@ -310,10 +310,9 @@ static int DumpSegment _ANSI_ARGS_((Tcl_Interp *interp, char *key, * that can be invoked from generic window code. */ -static TkClassProcs textClass = { - NULL, /* createProc. */ - TextWorldChanged, /* geometryProc. */ - NULL /* modalProc. */ +static Tk_ClassProcs textClass = { + sizeof(Tk_ClassProcs), /* size */ + TextWorldChanged, /* worldChangedProc */ }; @@ -440,7 +439,7 @@ Tk_TextCmd(clientData, interp, argc, argv) textPtr->insertMarkPtr = TkTextSetMark(textPtr, "insert", &startIndex); Tk_SetClass(textPtr->tkwin, "Text"); - TkSetClassProcs(textPtr->tkwin, &textClass, (ClientData) textPtr); + Tk_SetClassProcs(textPtr->tkwin, &textClass, (ClientData) textPtr); Tk_CreateEventHandler(textPtr->tkwin, ExposureMask|StructureNotifyMask|FocusChangeMask, TextEventProc, (ClientData) textPtr); diff --git a/generic/tkWindow.c b/generic/tkWindow.c index d20ffc8..e6fccf9 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.28 2000/11/03 19:38:25 hobbs Exp $ + * RCS: @(#) $Id: tkWindow.c,v 1.29 2000/11/22 01:49:38 ericm Exp $ */ #include "tkPort.h" @@ -1578,6 +1578,7 @@ Tk_MakeWindowExist(tkwin) TkWindow *winPtr2; Window parent; Tcl_HashEntry *hPtr; + Tk_ClassCreateProc *createProc; int new; if (winPtr->window != None) { @@ -1593,10 +1594,9 @@ Tk_MakeWindowExist(tkwin) parent = winPtr->parentPtr->window; } - if (winPtr->classProcsPtr != NULL - && winPtr->classProcsPtr->createProc != NULL) { - winPtr->window = (*winPtr->classProcsPtr->createProc)(tkwin, parent, - winPtr->instanceData); + createProc = Tk_GetClassProc(winPtr->classProcsPtr, createProc); + if (createProc != NULL) { + winPtr->window = (*createProc)(tkwin, parent, winPtr->instanceData); } else { winPtr->window = TkpMakeWindow(winPtr, parent); } @@ -2149,7 +2149,7 @@ Tk_SetClass(tkwin, className) /* *---------------------------------------------------------------------- * - * TkSetClassProcs -- + * Tk_SetClassProcs -- * * This procedure is used to set the class procedures and * instance data for a window. @@ -2165,9 +2165,9 @@ Tk_SetClass(tkwin, className) */ void -TkSetClassProcs(tkwin, procs, instanceData) +Tk_SetClassProcs(tkwin, procs, instanceData) Tk_Window tkwin; /* Token for window to modify. */ - TkClassProcs *procs; /* Class procs structure. */ + Tk_ClassProcs *procs; /* Class procs structure. */ ClientData instanceData; /* Data to be passed to class procedures. */ { register TkWindow *winPtr = (TkWindow *) tkwin; diff --git a/mac/tkMacButton.c b/mac/tkMacButton.c index 1eb4231..d308ddd 100644 --- a/mac/tkMacButton.c +++ b/mac/tkMacButton.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacButton.c,v 1.13 2000/05/17 21:17:21 ericm Exp $ + * RCS: @(#) $Id: tkMacButton.c,v 1.14 2000/11/22 01:49:38 ericm Exp $ */ #include "tkButton.h" @@ -104,10 +104,9 @@ static void ButtonExitProc _ANSI_ARGS_((ClientData clientData)); * The class procedure table for the button widgets. */ -TkClassProcs tkpButtonProcs = { - NULL, /* createProc. */ - TkButtonWorldChanged, /* geometryProc. */ - NULL /* modalProc. */ +Tk_ClassProcs tkpButtonProcs = { + sizeof(Tk_ClassProcs), /* size */ + TkButtonWorldChanged, /* worldChangedProc */ }; /* diff --git a/mac/tkMacMenubutton.c b/mac/tkMacMenubutton.c index 41dc954..4c274e6 100644 --- a/mac/tkMacMenubutton.c +++ b/mac/tkMacMenubutton.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacMenubutton.c,v 1.6 1999/09/21 06:42:33 hobbs Exp $ + * RCS: @(#) $Id: tkMacMenubutton.c,v 1.7 2000/11/22 01:49:38 ericm Exp $ */ #include "tkMenubutton.h" @@ -34,10 +34,9 @@ typedef struct MacMenuButton { * procedures that can be invoked from generic window code. */ -TkClassProcs tkpMenubuttonClass = { - NULL, /* createProc. */ - TkMenuButtonWorldChanged, /* geometryProc. */ - NULL /* modalProc. */ +Tk_ClassProcs tkpMenubuttonClass = { + sizeof(Tk_ClassProcs), /* size */ + TkMenuButtonWorldChanged, /* worldChangedProc */ }; /* diff --git a/mac/tkMacScrlbr.c b/mac/tkMacScrlbr.c index df030e0..1a3f82d 100644 --- a/mac/tkMacScrlbr.c +++ b/mac/tkMacScrlbr.c @@ -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: tkMacScrlbr.c,v 1.4 2000/02/10 08:56:12 jingham Exp $ + * RCS: @(#) $Id: tkMacScrlbr.c,v 1.5 2000/11/22 01:49:38 ericm Exp $ */ #include "tkScrollbar.h" @@ -113,13 +113,13 @@ static pascal void ThumbActionProc _ANSI_ARGS_((void)); static void UpdateControlValues _ANSI_ARGS_((MacScrollbar *macScrollPtr)); /* - * The class procedure table for the scrollbar widget. + * The class procedure table for the scrollbar widget. Leave the proc fields + * initialized to NULL, which should happen automatically because of the scope + * at which the variable is declared. */ -TkClassProcs tkpScrollbarProcs = { - NULL, /* createProc. */ - NULL, /* geometryProc. */ - NULL /* modalProc */ +Tk_ClassProcs tkpScrollbarProcs = { + sizeof(Tk_ClassProcs) /* size */ }; /* diff --git a/unix/mkLinks b/unix/mkLinks index cbbf2f9..79155ea 100644 --- a/unix/mkLinks +++ b/unix/mkLinks @@ -28,6 +28,10 @@ if test "$x" != "xyzzyTestingAVeryLongFileName.foo"; then exit fi +if test -r SetClassProcs.3; then + rm -f Tk_SetClassProcs.3 + ln SetClassProcs.3 Tk_SetClassProcs.3 +fi if test -r 3DBorder.3; then rm -f Tk_Alloc3DBorderFromObj.3 rm -f Tk_Get3DBorder.3 diff --git a/unix/tkUnixButton.c b/unix/tkUnixButton.c index 92dc8ea..46dff22 100644 --- a/unix/tkUnixButton.c +++ b/unix/tkUnixButton.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixButton.c,v 1.7 2000/07/29 01:08:54 ericm Exp $ + * RCS: @(#) $Id: tkUnixButton.c,v 1.8 2000/11/22 01:49:38 ericm Exp $ */ #include "tkButton.h" @@ -26,10 +26,9 @@ typedef struct UnixButton { * The class procedure table for the button widgets. */ -TkClassProcs tkpButtonProcs = { - NULL, /* createProc. */ - TkButtonWorldChanged, /* geometryProc. */ - NULL /* modalProc. */ +Tk_ClassProcs tkpButtonProcs = { + sizeof(Tk_ClassProcs), /* size */ + TkButtonWorldChanged, /* worldChangedProc */ }; /* diff --git a/unix/tkUnixMenubu.c b/unix/tkUnixMenubu.c index de2693f..8e46f46 100644 --- a/unix/tkUnixMenubu.c +++ b/unix/tkUnixMenubu.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixMenubu.c,v 1.4 1999/09/21 06:43:01 hobbs Exp $ + * RCS: @(#) $Id: tkUnixMenubu.c,v 1.5 2000/11/22 01:49:38 ericm Exp $ */ #include "tkMenubutton.h" @@ -19,10 +19,9 @@ * procedures that can be invoked from generic window code. */ -TkClassProcs tkpMenubuttonClass = { - NULL, /* createProc. */ - TkMenuButtonWorldChanged, /* geometryProc. */ - NULL /* modalProc. */ +Tk_ClassProcs tkpMenubuttonClass = { + sizeof(Tk_ClassProcs), /* size */ + TkMenuButtonWorldChanged, /* worldChangedProc */ }; /* diff --git a/unix/tkUnixScrlbr.c b/unix/tkUnixScrlbr.c index 4821653..fc3e7f8 100644 --- a/unix/tkUnixScrlbr.c +++ b/unix/tkUnixScrlbr.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixScrlbr.c,v 1.2 1998/09/14 18:23:57 stanton Exp $ + * RCS: @(#) $Id: tkUnixScrlbr.c,v 1.3 2000/11/22 01:49:38 ericm Exp $ */ #include "tkScrollbar.h" @@ -32,13 +32,13 @@ typedef struct UnixScrollbar { } UnixScrollbar; /* - * The class procedure table for the scrollbar widget. + * The class procedure table for the scrollbar widget. All fields except + * size are left initialized to NULL, which should happen automatically + * since the variable is declared at this scope. */ -TkClassProcs tkpScrollbarProcs = { - NULL, /* createProc. */ - NULL, /* geometryProc. */ - NULL /* modalProc. */ +Tk_ClassProcs tkpScrollbarProcs = { + sizeof(Tk_ClassProcs) /* size */ }; diff --git a/win/tkWinButton.c b/win/tkWinButton.c index 1aff26b..0578b35 100644 --- a/win/tkWinButton.c +++ b/win/tkWinButton.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinButton.c,v 1.11 2000/11/03 01:22:16 hobbs Exp $ + * RCS: @(#) $Id: tkWinButton.c,v 1.12 2000/11/22 01:49:38 ericm Exp $ */ #define OEMRESOURCE @@ -89,10 +89,10 @@ static void InitBoxes _ANSI_ARGS_((void)); * The class procedure table for the button widgets. */ -TkClassProcs tkpButtonProcs = { - CreateProc, /* createProc. */ - TkButtonWorldChanged, /* geometryProc. */ - NULL /* modalProc. */ +Tk_ClassProcs tkpButtonProcs = { + sizeof(Tk_ClassProcs), /* size */ + TkButtonWorldChanged, /* worldChangedProc */ + CreateProc, /* createProc */ }; diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c index 1a9cbc9..70fae0e 100644 --- a/win/tkWinScrlbr.c +++ b/win/tkWinScrlbr.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinScrlbr.c,v 1.6 2000/11/03 01:22:17 hobbs Exp $ + * RCS: @(#) $Id: tkWinScrlbr.c,v 1.7 2000/11/22 01:49:38 ericm Exp $ */ #include "tkWinInt.h" @@ -87,9 +87,10 @@ static void UpdateScrollbarMetrics _ANSI_ARGS_((void)); * The class procedure table for the scrollbar widget. */ -TkClassProcs tkpScrollbarProcs = { +Tk_ClassProcs tkpScrollbarProcs = { + sizeof(Tk_ClassProcs), /* size */ + NULL, /* worldChangedProc */ CreateProc, /* createProc */ - NULL, /* geometryProc */ ModalLoopProc, /* modalProc */ }; -- cgit v0.12