diff options
author | dkf <dkf@noemail.net> | 2005-09-21 10:54:40 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2005-09-21 10:54:40 (GMT) |
commit | 7537bf04e127c7ba65e38552d995651e41af54bf (patch) | |
tree | 568c1c4a6a82c9fe3153dba25af68d61019419bc /generic | |
parent | a47bf693ef326c744b4ce15119a01fa2144fdfce (diff) | |
download | tk-7537bf04e127c7ba65e38552d995651e41af54bf.zip tk-7537bf04e127c7ba65e38552d995651e41af54bf.tar.gz tk-7537bf04e127c7ba65e38552d995651e41af54bf.tar.bz2 |
Tk-internal exit handler improvements. [Bug 749908]
FossilOrigin-Name: 73102fdf2a3f56d3dea3151fcd5945b718f13ef0
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkEvent.c | 1338 | ||||
-rw-r--r-- | generic/tkInt.decls | 1460 | ||||
-rw-r--r-- | generic/tkInt.h | 1095 | ||||
-rw-r--r-- | generic/tkWindow.c | 17 |
4 files changed, 1773 insertions, 2137 deletions
diff --git a/generic/tkEvent.c b/generic/tkEvent.c index 388fa49..fa81b65 100644 --- a/generic/tkEvent.c +++ b/generic/tkEvent.c @@ -1,18 +1,18 @@ /* * tkEvent.c -- * - * This file provides basic low-level facilities for managing - * X events in Tk. + * This file provides basic low-level facilities for managing X events in + * Tk. * * Copyright (c) 1990-1994 The Regents of the University of California. * Copyright (c) 1994-1995 Sun Microsystems, Inc. * Copyright (c) 1998-2000 Ajuba Solutions. * Copyright (c) 2004 George Peter Staplin * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkEvent.c,v 1.28 2005/06/03 19:03:23 wolfsuit Exp $ + * RCS: @(#) $Id: tkEvent.c,v 1.29 2005/09/21 10:54:40 dkf Exp $ */ #include "tkPort.h" @@ -20,53 +20,52 @@ #include <signal.h> /* - * There's a potential problem if a handler is deleted while it's - * current (i.e. its procedure is executing), since Tk_HandleEvent - * will need to read the handler's "nextPtr" field when the procedure - * returns. To handle this problem, structures of the type below - * indicate the next handler to be processed for any (recursively - * nested) dispatches in progress. The nextHandler fields get - * updated if the handlers pointed to are deleted. Tk_HandleEvent - * also needs to know if the entire window gets deleted; the winPtr - * field is set to zero if that particular window gets deleted. + * There's a potential problem if a handler is deleted while it's current + * (i.e. its function is executing), since Tk_HandleEvent will need to read + * the handler's "nextPtr" field when the function returns. To handle this + * problem, structures of the type below indicate the next handler to be + * processed for any (recursively nested) dispatches in progress. The + * nextHandler fields get updated if the handlers pointed to are deleted. + * Tk_HandleEvent also needs to know if the entire window gets deleted; the + * winPtr field is set to zero if that particular window gets deleted. */ typedef struct InProgress { - XEvent *eventPtr; /* Event currently being handled. */ - TkWindow *winPtr; /* Window for event. Gets set to None if - * window is deleted while event is being - * handled. */ - TkEventHandler *nextHandler; /* Next handler in search. */ - struct InProgress *nextPtr; /* Next higher nested search. */ + XEvent *eventPtr; /* Event currently being handled. */ + TkWindow *winPtr; /* Window for event. Gets set to None if + * window is deleted while event is being + * handled. */ + TkEventHandler *nextHandler;/* Next handler in search. */ + struct InProgress *nextPtr; /* Next higher nested search. */ } InProgress; /* * For each call to Tk_CreateGenericHandler or Tk_CreateClientMessageHandler, - * an instance of the following structure will be created. All of the - * active handlers are linked into a list. + * an instance of the following structure will be created. All of the active + * handlers are linked into a list. */ typedef struct GenericHandler { - Tk_GenericProc *proc; /* Procedure to dispatch on all X events. */ - ClientData clientData; /* Client data to pass to procedure. */ - int deleteFlag; /* Flag to set when this handler is deleted. */ + Tk_GenericProc *proc; /* Function to dispatch on all X events. */ + ClientData clientData; /* Client data to pass to function. */ + int deleteFlag; /* Flag to set when this handler is + * deleted. */ struct GenericHandler *nextPtr; /* Next handler in list of all generic * handlers, or NULL for end of list. */ } GenericHandler; /* - * There's a potential problem if Tk_HandleEvent is entered recursively. - * A handler cannot be deleted physically until we have returned from - * calling it. Otherwise, we're looking at unallocated memory in advancing to - * its `next' entry. We deal with the problem by using the `delete flag' and + * There's a potential problem if Tk_HandleEvent is entered recursively. A + * handler cannot be deleted physically until we have returned from calling + * it. Otherwise, we're looking at unallocated memory in advancing to its + * `next' entry. We deal with the problem by using the `delete flag' and * deleting handlers only when it's known that there's no handler active. - * */ /* - * The following structure is used for queueing X-style events on the - * Tcl event queue. + * The following structure is used for queueing X-style events on the Tcl + * event queue. */ typedef struct TkWindowEvent { @@ -123,25 +122,37 @@ static unsigned long eventMasks[TK_LASTEVENT] = { MouseWheelMask /* MouseWheelEvent */ }; +/* + * For each exit handler created with a call to TkCreateExitHandler or + * TkCreateThreadExitHandler there is a structure of the following type: + */ + +typedef struct ExitHandler { + Tcl_ExitProc *proc; /* Function to call when process exits. */ + ClientData clientData; /* One word of information to pass to proc. */ + struct ExitHandler *nextPtr;/* Next in list of all exit handlers for this + * application, or NULL for end of list. */ +} ExitHandler; /* - * The structure below is used to store Data for the Event module that - * must be kept thread-local. The "dataKey" is used to fetch the - * thread-specific storage for the current thread. + * The structure below is used to store Data for the Event module that must be + * kept thread-local. The "dataKey" is used to fetch the thread-specific + * storage for the current thread. */ typedef struct ThreadSpecificData { - int handlersActive; /* The following variable has a non-zero - * value when a handler is active. */ - InProgress *pendingPtr; /* Topmost search in progress, or - * NULL if none. */ + int handlersActive; /* The following variable has a non-zero value + * when a handler is active. */ + InProgress *pendingPtr; /* Topmost search in progress, or NULL if + * none. */ /* * List of generic handler records. */ - GenericHandler *genericList; /* First handler in the list, or NULL. */ - GenericHandler *lastGenericPtr; /* Last handler in list. */ + GenericHandler *genericList;/* First handler in the list, or NULL. */ + GenericHandler *lastGenericPtr; + /* Last handler in list. */ /* * List of client message handler records. @@ -151,33 +162,25 @@ typedef struct ThreadSpecificData { GenericHandler *lastCmPtr; /* Last handler in list. */ /* - * If someone has called Tk_RestrictEvents, the information below - * keeps track of it. + * If someone has called Tk_RestrictEvents, the information below keeps + * track of it. */ Tk_RestrictProc *restrictProc; - /* Procedure to call. NULL means no + /* Function to call. NULL means no * restrictProc is currently in effect. */ ClientData restrictArg; /* Argument to pass to restrictProc. */ + ExitHandler *firstExitPtr; /* First in list of all exit handlers for this + * thread. */ + int inExit; /* True when this thread is exiting. This is + * used as a hack to decide to close the + * standard channels. */ } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; /* - * For each exit handler created with a call to TkCreateExitHandler - * there is a structure of the following type: - */ - -typedef struct ExitHandler { - Tcl_ExitProc *proc; /* Procedure to call when process exits. */ - ClientData clientData; /* One word of information to pass to proc. */ - struct ExitHandler *nextPtr;/* Next in list of all exit handlers for - * this application, or NULL for end of list. */ -} ExitHandler; - -/* - * There is both per-process and per-thread exit handlers. - * The first list is controlled by a mutex. The other is in - * thread local storage. + * There are both per-process and per-thread exit handlers. The first list is + * controlled by a mutex. The other is in thread local storage. */ static ExitHandler *firstExitPtr = NULL; @@ -186,95 +189,79 @@ static ExitHandler *firstExitPtr = NULL; TCL_DECLARE_MUTEX(exitMutex) /* - * Prototypes for procedures that are only referenced locally within - * this file. + * Prototypes for functions that are only referenced locally within this file. */ -static void DelayedMotionProc _ANSI_ARGS_((ClientData clientData)); -static int WindowEventProc _ANSI_ARGS_((Tcl_Event *evPtr, - int flags)); -static int TkXErrorHandler _ANSI_ARGS_((ClientData clientData, - XErrorEvent *errEventPtr)); - -static int InvokeGenericHandlers _ANSI_ARGS_(( - ThreadSpecificData *tsdPtr, - XEvent *eventPtr)); - -static int GetButtonMask _ANSI_ARGS_((unsigned int Button)); - -static void UpdateButtonEventState _ANSI_ARGS_((XEvent *eventPtr)); - -static void InvokeClientMessageHandlers _ANSI_ARGS_(( - ThreadSpecificData *tsdPtr, - Tk_Window tkwin, - XEvent *eventPtr)); - -static int RefreshKeyboardMappingIfNeeded _ANSI_ARGS_(( - XEvent *eventPtr)); - -static unsigned long GetEventMaskFromXEvent _ANSI_ARGS_((XEvent *eventPtr)); - -static Window ParentXId _ANSI_ARGS_((Display *display, Window w)); - -static TkWindow * GetTkWindowFromXEvent _ANSI_ARGS_((XEvent *eventPtr)); - +static void DelayedMotionProc(ClientData clientData); +static int GetButtonMask(unsigned int Button); +static unsigned long GetEventMaskFromXEvent(XEvent *eventPtr); +static TkWindow * GetTkWindowFromXEvent(XEvent *eventPtr); +static void InvokeClientMessageHandlers(ThreadSpecificData *tsdPtr, + Tk_Window tkwin, XEvent *eventPtr); +static int InvokeFocusHandlers(TkWindow **winPtrPtr, + unsigned long mask, XEvent *eventPtr); +static int InvokeGenericHandlers(ThreadSpecificData *tsdPtr, + XEvent *eventPtr); +static int InvokeMouseHandlers(TkWindow *winPtr, + unsigned long mask, XEvent *eventPtr); +static Window ParentXId(Display *display, Window w); +static int RefreshKeyboardMappingIfNeeded(XEvent *eventPtr); +static int TkXErrorHandler(ClientData clientData, + XErrorEvent *errEventPtr); +static void UpdateButtonEventState(XEvent *eventPtr); +static int WindowEventProc(Tcl_Event *evPtr, int flags); #ifdef TK_USE_INPUT_METHODS -static int InvokeInputMethods _ANSI_ARGS_((TkWindow *winPtr, - XEvent *eventPtr)); +static int InvokeInputMethods(TkWindow *winPtr, XEvent *eventPtr); #if TK_XIM_SPOT -static void CreateXIMSpotMethods _ANSI_ARGS_((TkWindow *winPtr)); -#endif - +static void CreateXIMSpotMethods(TkWindow *winPtr); +#endif /* TK_XIM_SPOT */ #endif /* TK_USE_INPUT_METHODS */ - -static int InvokeMouseHandlers _ANSI_ARGS_((TkWindow *winPtr, - unsigned long mask, XEvent *eventPtr)); - -static int InvokeFocusHandlers _ANSI_ARGS_((TkWindow **winPtrPtr, - unsigned long mask, XEvent *eventPtr)); - /* *---------------------------------------------------------------------- * * InvokeFocusHandlers -- - * - * Call focus-related code to look at FocusIn, FocusOut, Enter, - * and Leave events; depending on its return * value, ignore the - * event. - * - * Results: - * 0 further processing can be done on the event. - * 1 we are done with the event passed. - * + * + * Call focus-related code to look at FocusIn, FocusOut, Enter, and Leave + * events; depending on its return value, ignore the event. + * + * Results: + * 0 further processing can be done on the event. + * 1 we are done with the event passed. + * * Side effects: - * The *winPtrPtr in the caller may be changed to the TkWindow - * for the window with focus. + * The *winPtrPtr in the caller may be changed to the TkWindow for the + * window with focus. * *---------------------------------------------------------------------- */ static int -InvokeFocusHandlers(winPtrPtr, mask, eventPtr) - TkWindow **winPtrPtr; - unsigned long mask; - XEvent *eventPtr; +InvokeFocusHandlers( + TkWindow **winPtrPtr, + unsigned long mask, + XEvent *eventPtr) { if ((mask & (FocusChangeMask|EnterWindowMask|LeaveWindowMask)) && (TkFocusFilterEvent(*winPtrPtr, eventPtr) == 0)) { return 1; } + /* + * MouseWheel events are not focus specific on Mac OS X. + */ + #ifdef MAC_OSX_TK - /* MouseWheel events are not focus specific on Mac OS X */ - if (mask & (KeyPressMask|KeyReleaseMask)) { +#define FOCUS_DIRECTED_EVENT_MASK (KeyPressMask|KeyReleaseMask) #else - if (mask & (KeyPressMask|KeyReleaseMask|MouseWheelMask)) { +#define FOCUS_DIRECTED_EVENT_MASK (KeyPressMask|KeyReleaseMask|MouseWheelMask) #endif + + if (mask & FOCUS_DIRECTED_EVENT_MASK) { (*winPtrPtr)->dispPtr->lastEventTime = eventPtr->xkey.time; *winPtrPtr = TkFocusKeyEvent(*winPtrPtr, eventPtr); if (*winPtrPtr == NULL) { - return 1; + return 1; } } @@ -286,30 +273,30 @@ InvokeFocusHandlers(winPtrPtr, mask, eventPtr) * * InvokeMouseHandlers -- * - * Call a grab-related procedure to do special processing on - * pointer events. + * Call a grab-related function to do special processing on pointer + * events. + * + * Results: + * 0 further processing can be done on the event. + * 1 we are done with the event passed. * - * Results: - * 0 further processing can be done on the event. - * 1 we are done with the event passed. - * * Side effects: - * New events may be queued from TkPointerEvent and grabs may be - * added/removed. The eventPtr may be changed by TkPointerEvent - * in some cases. + * New events may be queued from TkPointerEvent and grabs may be added + * and/or removed. The eventPtr may be changed by TkPointerEvent in some + * cases. * *---------------------------------------------------------------------- */ static int -InvokeMouseHandlers(winPtr, mask, eventPtr) - TkWindow *winPtr; - unsigned long mask; - XEvent *eventPtr; +InvokeMouseHandlers( + TkWindow *winPtr, + unsigned long mask, + XEvent *eventPtr) { if (mask & (ButtonPressMask|ButtonReleaseMask|PointerMotionMask |EnterWindowMask|LeaveWindowMask)) { - + if (mask & (ButtonPressMask|ButtonReleaseMask)) { winPtr->dispPtr->lastEventTime = eventPtr->xbutton.time; } else if (mask & PointerMotionMask) { @@ -317,15 +304,17 @@ InvokeMouseHandlers(winPtr, mask, eventPtr) } else { winPtr->dispPtr->lastEventTime = eventPtr->xcrossing.time; } - + if (TkPointerEvent(eventPtr, winPtr) == 0) { - /* - * The event should be ignored to make grab work - * correctly (as the comment for TkPointerEvent states). + /* + * The event should be ignored to make grab work correctly (as the + * comment for TkPointerEvent states). */ + return 1; } - } + } + return 0; } @@ -334,37 +323,38 @@ InvokeMouseHandlers(winPtr, mask, eventPtr) * * CreateXIMSpotMethods -- * - * Create the X input methods for our winPtr. XIM is only ever - * enabled on Unix. + * Create the X input methods for our winPtr. XIM is only ever enabled on + * Unix. + * + * Results: + * None. * - * Results: - * None. - * * Side effects: - * An input context is created or we Tcl_Panic. + * An input context is created or we Tcl_Panic. * *---------------------------------------------------------------------- */ #if defined(TK_USE_INPUT_METHODS) && TK_XIM_SPOT static void -CreateXIMSpotMethods(winPtr) - TkWindow *winPtr; +CreateXIMSpotMethods( + TkWindow *winPtr) { TkDisplay *dispPtr = winPtr->dispPtr; if (dispPtr->flags & TK_DISPLAY_XIM_SPOT) { XVaNestedList preedit_attr; XPoint spot = {0, 0}; - + if (dispPtr->inputXfs == NULL) { /* * We only need to create one XFontSet */ - char **missing_list; - int missing_count; - char *def_string; - + + char **missing_list; + int missing_count; + char *def_string; + dispPtr->inputXfs = XCreateFontSet(dispPtr->display, "-*-*-*-R-Normal--14-130-75-75-*-*", &missing_list, &missing_count, &def_string); @@ -372,7 +362,7 @@ CreateXIMSpotMethods(winPtr) XFreeStringList(missing_list); } } - + preedit_attr = XVaCreateNestedList(0, XNSpotLocation, &spot, XNFontSet, dispPtr->inputXfs, NULL); if (winPtr->inputContext != NULL) { @@ -402,31 +392,31 @@ CreateXIMSpotMethods(winPtr) *---------------------------------------------------------------------- * * InvokeInputMethods -- - * Pass the event to the input method(s), if there are any, and - * discard the event if the input method(s) * insist. Create the - * input context for the window if * it hasn't already been done - * (XFilterEvent needs this * context). - * - * When the event is a FocusIn event, set the input context focus - * to the receiving window. This is needed for certain * versions - * of Solaris, but we are still not sure whether it * is being - * done in the right way. - * - * Results: - * 1 when we are done with the event. - * 0 when the event can be processed further. - * + * + * Pass the event to the input method(s), if there are any, and discard + * the event if the input method(s) insist. Create the input context for + * the window if it hasn't already been done (XFilterEvent needs this + * context). + * + * When the event is a FocusIn event, set the input context focus to the + * receiving window. This is needed for certain versions of Solaris, but + * we are still not sure whether it is being done in the right way. + * + * Results: + * 1 when we are done with the event. + * 0 when the event can be processed further. + * * Side effects: - * Input contexts/methods may be created. + * Input contexts/methods may be created. * *---------------------------------------------------------------------- */ #ifdef TK_USE_INPUT_METHODS static int -InvokeInputMethods(winPtr,eventPtr) - TkWindow *winPtr; - XEvent *eventPtr; +InvokeInputMethods( + TkWindow *winPtr, + XEvent *eventPtr) { TkDisplay *dispPtr = winPtr->dispPtr; @@ -471,60 +461,60 @@ InvokeInputMethods(winPtr,eventPtr) *---------------------------------------------------------------------- * * GetTkWindowFromXEvent -- - * - * Attempt to find which TkWindow is associated with an event. - * If it fails we attempt to get the * TkWindow from the parent - * for a property notification. - * - * Results: - * The TkWindow associated with the event or NULL. - * + * + * Attempt to find which TkWindow is associated with an event. If it + * fails we attempt to get the TkWindow from the parent for a property + * notification. + * + * Results: + * The TkWindow associated with the event or NULL. + * * Side effects: - * TkSelPropProc may influence selection on windows not known to - * Tk. + * TkSelPropProc may influence selection on windows not known to Tk. * *---------------------------------------------------------------------- */ static TkWindow * -GetTkWindowFromXEvent(eventPtr) - XEvent *eventPtr; +GetTkWindowFromXEvent( + XEvent *eventPtr) { TkWindow *winPtr; Window parentXId, handlerWindow = eventPtr->xany.window; - if ((eventPtr->xany.type == StructureNotifyMask) + if ((eventPtr->xany.type == StructureNotifyMask) && (eventPtr->xmap.event != eventPtr->xmap.window)) { - handlerWindow = eventPtr->xmap.event; + handlerWindow = eventPtr->xmap.event; } winPtr = (TkWindow *) Tk_IdToWindow(eventPtr->xany.display, handlerWindow); - + if (winPtr == NULL) { /* - * There isn't a TkWindow structure for this window. - * However, if the event is a PropertyNotify event then call - * the selection manager (it deals beneath-the-table with - * certain properties). Also, if the window's parent is a - * Tk window that has the TK_PROP_PROPCHANGE flag set, then - * we must propagate the PropertyNotify event up to the parent. + * There isn't a TkWindow structure for this window. However, if the + * event is a PropertyNotify event then call the selection manager (it + * deals beneath-the-table with certain properties). Also, if the + * window's parent is a Tk window that has the TK_PROP_PROPCHANGE flag + * set, then we must propagate the PropertyNotify event up to the + * parent. */ - if (eventPtr->type != PropertyNotify) { + + if (eventPtr->type != PropertyNotify) { return NULL; } TkSelPropProc(eventPtr); - parentXId = ParentXId(eventPtr->xany.display, handlerWindow); - if (parentXId == None) { - return NULL; - } + parentXId = ParentXId(eventPtr->xany.display, handlerWindow); + if (parentXId == None) { + return NULL; + } winPtr = (TkWindow *) Tk_IdToWindow(eventPtr->xany.display, parentXId); if (winPtr == NULL) { - return NULL; - } + return NULL; + } if (!(winPtr->flags & TK_PROP_PROPCHANGE)) { - return NULL; - } - } + return NULL; + } + } return winPtr; } @@ -532,32 +522,32 @@ GetTkWindowFromXEvent(eventPtr) *---------------------------------------------------------------------- * * GetEventMaskFromXEvent -- - * - * The event type is looked up in our eventMasks table, and may - * be changed to a different mask * depending on the state of the - * event and window * members. - * - * Results: - * The mask for the event. - * + * + * The event type is looked up in our eventMasks table, and may be + * changed to a different mask depending on the state of the event and + * window members. + * + * Results: + * The mask for the event. + * * Side effects: - * None. + * None. * *---------------------------------------------------------------------- */ static unsigned long -GetEventMaskFromXEvent(eventPtr) - XEvent *eventPtr; +GetEventMaskFromXEvent( + XEvent *eventPtr) { unsigned long mask = eventMasks[eventPtr->xany.type]; /* - * Events selected by StructureNotify require special handling. - * They look the same as those selected by SubstructureNotify. - * The only difference is whether the "event" and "window" fields - * are the same. Compare the two fields and convert - * StructureNotify to SubstructureNotify if necessary. + * Events selected by StructureNotify require special handling. They look + * the same as those selected by SubstructureNotify. The only difference + * is whether the "event" and "window" fields are the same. Compare the + * two fields and convert StructureNotify to SubstructureNotify if + * necessary. */ if (mask == StructureNotifyMask) { @@ -572,28 +562,28 @@ GetEventMaskFromXEvent(eventPtr) *---------------------------------------------------------------------- * * RefreshKeyboardMappingIfNeeded -- - * - * If the event is a MappingNotify event, find its display and - * refresh the keyboard mapping * information for the display. - * - * Results: - * 0 if the event was not a MappingNotify event - * 1 if the event was a MappingNotify event - * + * + * If the event is a MappingNotify event, find its display and refresh + * the keyboard mapping information for the display. + * + * Results: + * 0 if the event was not a MappingNotify event + * 1 if the event was a MappingNotify event + * * Side effects: - * None. + * None. * *---------------------------------------------------------------------- */ static int -RefreshKeyboardMappingIfNeeded(eventPtr) - XEvent *eventPtr; +RefreshKeyboardMappingIfNeeded( + XEvent *eventPtr) { TkDisplay *dispPtr; if (eventPtr->type == MappingNotify) { - dispPtr = TkGetDisplay(eventPtr->xmapping.display); + dispPtr = TkGetDisplay(eventPtr->xmapping.display); if (dispPtr != NULL) { XRefreshKeyboardMapping(&eventPtr->xmapping); dispPtr->bindInfoStale = 1; @@ -607,33 +597,33 @@ RefreshKeyboardMappingIfNeeded(eventPtr) *---------------------------------------------------------------------- * * GetButtonMask -- - * + * * Return the proper Button${n}Mask for the button. - * - * Results: - * A button mask. - * + * + * Results: + * A button mask. + * * Side effects: - * None. + * None. * *---------------------------------------------------------------------- */ static int -GetButtonMask(button) - unsigned int button; +GetButtonMask( + unsigned int button) { switch (button) { - case 1: - return Button1Mask; - case 2: - return Button2Mask; - case 3: - return Button3Mask; - case 4: - return Button4Mask; - case 5: - return Button5Mask; + case 1: + return Button1Mask; + case 2: + return Button2Mask; + case 3: + return Button3Mask; + case 4: + return Button4Mask; + case 5: + return Button5Mask; } return 0; } @@ -642,66 +632,64 @@ GetButtonMask(button) *---------------------------------------------------------------------- * * UpdateButtonEventState -- - * - * Update the button event state in our TkDisplay using the - * XEvent passed. We also may modify the the XEvent passed to - * fit some aspects of our TkDisplay. - * - * Results: - * None. - * + * + * Update the button event state in our TkDisplay using the XEvent + * passed. We also may modify the the XEvent passed to fit some aspects + * of our TkDisplay. + * + * Results: + * None. + * * Side effects: - * The TkDisplay's private button state may be modified. The - * eventPtr's state may be updated * to reflect masks stored in - * our TkDisplay that * the event doesn't contain. The eventPtr - * may also * be modified to not contain a button state for the * - * window in which it was not pressed in. + * The TkDisplay's private button state may be modified. The eventPtr's + * state may be updated to reflect masks stored in our TkDisplay that the + * event doesn't contain. The eventPtr may also be modified to not + * contain a button state for the window in which it was not pressed in. * *---------------------------------------------------------------------- */ static void -UpdateButtonEventState(eventPtr) - XEvent *eventPtr; +UpdateButtonEventState( + XEvent *eventPtr) { TkDisplay *dispPtr; - int allButtonsMask = Button1Mask | Button2Mask | Button3Mask + int allButtonsMask = Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask; switch (eventPtr->type) { - case ButtonPress: - dispPtr = TkGetDisplay(eventPtr->xbutton.display); - dispPtr->mouseButtonWindow = eventPtr->xbutton.window; - eventPtr->xbutton.state |= dispPtr->mouseButtonState; - - dispPtr->mouseButtonState |= - GetButtonMask(eventPtr->xbutton.button); - break; - - case ButtonRelease: - dispPtr = TkGetDisplay(eventPtr->xbutton.display); - dispPtr->mouseButtonWindow = None; - dispPtr->mouseButtonState &= - ~GetButtonMask(eventPtr->xbutton.button); - eventPtr->xbutton.state |= dispPtr->mouseButtonState; - break; + case ButtonPress: + dispPtr = TkGetDisplay(eventPtr->xbutton.display); + dispPtr->mouseButtonWindow = eventPtr->xbutton.window; + eventPtr->xbutton.state |= dispPtr->mouseButtonState; + + dispPtr->mouseButtonState |= GetButtonMask(eventPtr->xbutton.button); + break; + + case ButtonRelease: + dispPtr = TkGetDisplay(eventPtr->xbutton.display); + dispPtr->mouseButtonWindow = None; + dispPtr->mouseButtonState &= ~GetButtonMask(eventPtr->xbutton.button); + eventPtr->xbutton.state |= dispPtr->mouseButtonState; + break; + + case MotionNotify: + dispPtr = TkGetDisplay(eventPtr->xmotion.display); + if (dispPtr->mouseButtonState & allButtonsMask) { + if (eventPtr->xbutton.window != dispPtr->mouseButtonWindow) { + /* + * This motion event should not be interpreted as a button + * press + motion event since this is not the same window the + * button was pressed down in. + */ - case MotionNotify: - dispPtr = TkGetDisplay(eventPtr->xmotion.display); - if (dispPtr->mouseButtonState & allButtonsMask) { - if (eventPtr->xbutton.window != dispPtr->mouseButtonWindow) { - /* - * This motion event should not be interpreted as a button - * press + motion event since this is not the same window - * the button was pressed down in. - */ - dispPtr->mouseButtonState &= ~allButtonsMask; - dispPtr->mouseButtonWindow = None; - } else { - eventPtr->xmotion.state |= dispPtr->mouseButtonState; - } + dispPtr->mouseButtonState &= ~allButtonsMask; + dispPtr->mouseButtonWindow = None; + } else { + eventPtr->xmotion.state |= dispPtr->mouseButtonState; } - break; + } + break; } } @@ -709,11 +697,10 @@ UpdateButtonEventState(eventPtr) *---------------------------------------------------------------------- * * InvokeClientMessageHandlers -- - * - * Iterate the list of handlers and invoke the function pointer - * for each. - * - * Results: + * + * Iterate the list of handlers and invoke the function pointer for each. + * + * Results: * None. * * Side effects: @@ -723,23 +710,23 @@ UpdateButtonEventState(eventPtr) */ static void -InvokeClientMessageHandlers(tsdPtr, tkwin, eventPtr) - ThreadSpecificData *tsdPtr; - Tk_Window tkwin; - XEvent *eventPtr; +InvokeClientMessageHandlers( + ThreadSpecificData *tsdPtr, + Tk_Window tkwin, + XEvent *eventPtr) { GenericHandler *prevPtr, *tmpPtr, *curPtr = tsdPtr->cmList; for (prevPtr = NULL; curPtr != NULL; ) { - if (curPtr->deleteFlag) { + if (curPtr->deleteFlag) { if (!tsdPtr->handlersActive) { - /* - * This handler needs to be deleted and there are - * no calls pending through any handlers, so now - * is a safe time to delete it. + /* + * This handler needs to be deleted and there are no calls + * pending through any handlers, so now is a safe time to + * delete it. */ - - tmpPtr = curPtr->nextPtr; + + tmpPtr = curPtr->nextPtr; if (prevPtr == NULL) { tsdPtr->cmList = tmpPtr; } else { @@ -754,6 +741,7 @@ InvokeClientMessageHandlers(tsdPtr, tkwin, eventPtr) } } else { int done; + tsdPtr->handlersActive++; done = (*(Tk_ClientMessageProc *)curPtr->proc)(tkwin, eventPtr); tsdPtr->handlersActive--; @@ -770,37 +758,37 @@ InvokeClientMessageHandlers(tsdPtr, tkwin, eventPtr) *---------------------------------------------------------------------- * * InvokeGenericHandlers -- - * - * Iterate the list of handlers and invoke the function pointer - * for each. If the handler invoked returns a non-zero value - * then we are done. - * - * Results: - * 0 when the event wasn't handled by a handler. non-zero when - * it was processed and handled by a handler. - * + * + * Iterate the list of handlers and invoke the function pointer for each. + * If the handler invoked returns a non-zero value then we are done. + * + * Results: + * 0 when the event wasn't handled by a handler. Non-zero when it was + * processed and handled by a handler. + * * Side effects: * Handlers may be deleted and events may be sent to handlers. * *---------------------------------------------------------------------- */ -static int -InvokeGenericHandlers(tsdPtr, eventPtr) - ThreadSpecificData *tsdPtr; - XEvent *eventPtr; +static int +InvokeGenericHandlers( + ThreadSpecificData *tsdPtr, + XEvent *eventPtr) { GenericHandler *prevPtr, *tmpPtr, *curPtr = tsdPtr->genericList; for (prevPtr = NULL; curPtr != NULL; ) { - if (curPtr->deleteFlag) { + if (curPtr->deleteFlag) { if (!tsdPtr->handlersActive) { - /* - * This handler needs to be deleted and there are no - * calls pending through the handler, so now is a safe - * time to delete it. + /* + * This handler needs to be deleted and there are no calls + * pending through the handler, so now is a safe time to + * delete it. */ - tmpPtr = curPtr->nextPtr; + + tmpPtr = curPtr->nextPtr; if (prevPtr == NULL) { tsdPtr->genericList = tmpPtr; } else { @@ -815,11 +803,12 @@ InvokeGenericHandlers(tsdPtr, eventPtr) } } else { int done; + tsdPtr->handlersActive++; done = (*curPtr->proc)(curPtr->clientData, eventPtr); tsdPtr->handlersActive--; if (done) { - return done; + return done; } } prevPtr = curPtr; @@ -833,41 +822,38 @@ InvokeGenericHandlers(tsdPtr, eventPtr) * * Tk_CreateEventHandler -- * - * Arrange for a given procedure to be invoked whenever events - * from a given class occur in a given window. + * Arrange for a given function to be invoked whenever events from a + * given class occur in a given window. * * Results: * None. * * Side effects: - * From now on, whenever an event of the type given by mask - * occurs for token and is processed by Tk_HandleEvent, proc will - * be called. See the manual entry for details of the calling - * sequence and return value for proc. + * From now on, whenever an event of the type given by mask occurs for + * token and is processed by Tk_HandleEvent, proc will be called. See the + * manual entry for details of the calling sequence and return value for + * proc. * *---------------------------------------------------------------------- */ void -Tk_CreateEventHandler(token, mask, proc, clientData) - Tk_Window token; /* Token for window in which to - * create handler. */ - unsigned long mask; /* Events for which proc should - * be called. */ - Tk_EventProc *proc; /* Procedure to call for each - * selected event */ - ClientData clientData; /* Arbitrary data to pass to proc. */ +Tk_CreateEventHandler( + Tk_Window token, /* Token for window in which to create + * handler. */ + unsigned long mask, /* Events for which proc should be called. */ + Tk_EventProc *proc, /* Function to call for each selected event */ + ClientData clientData) /* Arbitrary data to pass to proc. */ { register TkEventHandler *handlerPtr; register TkWindow *winPtr = (TkWindow *) token; /* - * Skim through the list of existing handlers to (a) compute the - * overall event mask for the window (so we can pass this new - * value to the X system) and (b) see if there's already a handler - * declared with the same callback and clientData (if so, just - * change the mask). If no existing handler matches, then create - * a new handler. + * Skim through the list of existing handlers to (a) compute the overall + * event mask for the window (so we can pass this new value to the X + * system) and (b) see if there's already a handler declared with the same + * callback and clientData (if so, just change the mask). If no existing + * handler matches, then create a new handler. */ if (winPtr->handlerList == NULL) { @@ -875,11 +861,11 @@ Tk_CreateEventHandler(token, mask, proc, clientData) * No event handlers defined at all, so must create. */ - handlerPtr = (TkEventHandler *) ckalloc( - (unsigned) sizeof(TkEventHandler)); + handlerPtr = (TkEventHandler *) ckalloc(sizeof(TkEventHandler)); winPtr->handlerList = handlerPtr; } else { int found = 0; + for (handlerPtr = winPtr->handlerList; ; handlerPtr = handlerPtr->nextPtr) { if ((handlerPtr->proc == proc) @@ -893,10 +879,9 @@ Tk_CreateEventHandler(token, mask, proc, clientData) } /* - * If we found anything, we're done because we do not need to - * use XSelectInput; Tk always selects on all events anyway in - * order to support binding on classes, 'all' and other - * bind-tags. + * If we found anything, we're done because we do not need to use + * XSelectInput; Tk always selects on all events anyway in order to + * support binding on classes, 'all' and other bind-tags. */ if (found) { @@ -922,9 +907,8 @@ Tk_CreateEventHandler(token, mask, proc, clientData) handlerPtr->nextPtr = NULL; /* - * No need to call XSelectInput: Tk always selects on all events - * for all windows (needed to support bindings on classes and - * "all"). + * No need to call XSelectInput: Tk always selects on all events for all + * windows (needed to support bindings on classes and "all"). */ } @@ -939,29 +923,29 @@ Tk_CreateEventHandler(token, mask, proc, clientData) * None. * * Side effects: - * If there existed a handler as described by the parameters, the - * handler is deleted so that proc will not be invoked again. + * If there existed a handler as described by the parameters, the handler + * is deleted so that proc will not be invoked again. * *---------------------------------------------------------------------- */ void -Tk_DeleteEventHandler(token, mask, proc, clientData) - Tk_Window token; /* Same as corresponding arguments passed */ - unsigned long mask; /* previously to Tk_CreateEventHandler. */ - Tk_EventProc *proc; - ClientData clientData; +Tk_DeleteEventHandler( + Tk_Window token, /* Same as corresponding arguments passed */ + unsigned long mask, /* previously to Tk_CreateEventHandler. */ + Tk_EventProc *proc, + ClientData clientData) { register TkEventHandler *handlerPtr; register InProgress *ipPtr; TkEventHandler *prevPtr; register TkWindow *winPtr = (TkWindow *) token; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* - * Find the event handler to be deleted, or return - * immediately if it doesn't exist. + * Find the event handler to be deleted, or return immediately if it + * doesn't exist. */ for (handlerPtr = winPtr->handlerList, prevPtr = NULL; ; @@ -976,8 +960,8 @@ Tk_DeleteEventHandler(token, mask, proc, clientData) } /* - * If Tk_HandleEvent is about to process this handler, tell it to - * process the next one instead. + * If Tk_HandleEvent is about to process this handler, tell it to process + * the next one instead. */ for (ipPtr = tsdPtr->pendingPtr; ipPtr != NULL; ipPtr = ipPtr->nextPtr) { @@ -997,10 +981,9 @@ Tk_DeleteEventHandler(token, mask, proc, clientData) } ckfree((char *) handlerPtr); - /* - * No need to call XSelectInput: Tk always selects on all events - * for all windows (needed to support bindings on classes and "all"). + * No need to call XSelectInput: Tk always selects on all events for all + * windows (needed to support bindings on classes and "all"). */ } @@ -1008,32 +991,32 @@ Tk_DeleteEventHandler(token, mask, proc, clientData) * * Tk_CreateGenericHandler -- * - * Register a procedure to be called on each X event, regardless - * of display or window. Generic handlers are useful for capturing - * events that aren't associated with windows, or events for windows - * not managed by Tk. + * Register a function to be called on each X event, regardless of + * display or window. Generic handlers are useful for capturing events + * that aren't associated with windows, or events for windows not managed + * by Tk. * * Results: * None. * * Side Effects: - * From now on, whenever an X event is given to Tk_HandleEvent, - * invoke proc, giving it clientData and the event as arguments. + * From now on, whenever an X event is given to Tk_HandleEvent, invoke + * proc, giving it clientData and the event as arguments. * *---------------------------------------------------------------------- */ void -Tk_CreateGenericHandler(proc, clientData) - Tk_GenericProc *proc; /* Procedure to call on every event. */ - ClientData clientData; /* One-word value to pass to proc. */ +Tk_CreateGenericHandler( + Tk_GenericProc *proc, /* Function to call on every event. */ + ClientData clientData) /* One-word value to pass to proc. */ { GenericHandler *handlerPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + handlerPtr = (GenericHandler *) ckalloc(sizeof(GenericHandler)); - + handlerPtr->proc = proc; handlerPtr->clientData = clientData; handlerPtr->deleteFlag = 0; @@ -1057,23 +1040,22 @@ Tk_CreateGenericHandler(proc, clientData) * None. * * Side Effects: - * If there existed a handler as described by the parameters, - * that handler is logically deleted so that proc will not be - * invoked again. The physical deletion happens in the event - * loop in Tk_HandleEvent. + * If there existed a handler as described by the parameters, that + * handler is logically deleted so that proc will not be invoked again. + * The physical deletion happens in the event loop in Tk_HandleEvent. * *---------------------------------------------------------------------- */ void -Tk_DeleteGenericHandler(proc, clientData) - Tk_GenericProc *proc; - ClientData clientData; +Tk_DeleteGenericHandler( + Tk_GenericProc *proc, + ClientData clientData) { GenericHandler * handler; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - + for (handler=tsdPtr->genericList ; handler ; handler=handler->nextPtr) { if ((handler->proc == proc) && (handler->clientData == clientData)) { handler->deleteFlag = 1; @@ -1085,44 +1067,45 @@ Tk_DeleteGenericHandler(proc, clientData) * * Tk_CreateClientMessageHandler -- * - * Register a procedure to be called on each ClientMessage event. + * Register a function to be called on each ClientMessage event. * ClientMessage handlers are useful for Drag&Drop extensions. * * Results: * None. * * Side Effects: - * From now on, whenever a ClientMessage event is received that isn't - * a WM_PROTOCOL event or SelectionEvent, invoke proc, giving it - * tkwin and the event as arguments. + * From now on, whenever a ClientMessage event is received that isn't a + * WM_PROTOCOL event or SelectionEvent, invoke proc, giving it tkwin and + * the event as arguments. * *---------------------------------------------------------------------- */ void -Tk_CreateClientMessageHandler(proc) - Tk_ClientMessageProc *proc; /* Procedure to call on event. */ +Tk_CreateClientMessageHandler( + Tk_ClientMessageProc *proc) /* Function to call on event. */ { GenericHandler *handlerPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* - * We use a GenericHandler struct, because it's basically the same, - * except with an extra clientData field we'll never use. + * We use a GenericHandler struct, because it's basically the same, except + * with an extra clientData field we'll never use. */ + handlerPtr = (GenericHandler *) ckalloc(sizeof(GenericHandler)); - handlerPtr->proc = (Tk_GenericProc *) proc; - handlerPtr->clientData = NULL; /* never used */ - handlerPtr->deleteFlag = 0; - handlerPtr->nextPtr = NULL; + handlerPtr->proc = (Tk_GenericProc *) proc; + handlerPtr->clientData = NULL; /* never used */ + handlerPtr->deleteFlag = 0; + handlerPtr->nextPtr = NULL; if (tsdPtr->cmList == NULL) { - tsdPtr->cmList = handlerPtr; + tsdPtr->cmList = handlerPtr; } else { tsdPtr->lastCmPtr->nextPtr = handlerPtr; } - tsdPtr->lastCmPtr = handlerPtr; + tsdPtr->lastCmPtr = handlerPtr; } /* @@ -1136,20 +1119,20 @@ Tk_CreateClientMessageHandler(proc) * None. * * Side Effects: - * If there existed a handler as described by the parameters, - * that handler is logically deleted so that proc will not be - * invoked again. The physical deletion happens in the event - * loop in TkClientMessageEventProc. + * If there existed a handler as described by the parameters, that + * handler is logically deleted so that proc will not be invoked again. + * The physical deletion happens in the event loop in + * TkClientMessageEventProc. * *---------------------------------------------------------------------- */ void -Tk_DeleteClientMessageHandler(proc) - Tk_ClientMessageProc *proc; +Tk_DeleteClientMessageHandler( + Tk_ClientMessageProc *proc) { GenericHandler * handler; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); for (handler=tsdPtr->cmList ; handler!=NULL ; handler=handler->nextPtr) { @@ -1164,10 +1147,9 @@ Tk_DeleteClientMessageHandler(proc) * * TkEventInit -- * - * This procedures initializes all the event module - * structures used by the current thread. It must be - * called before any other procedure in this file is - * called. + * This functions initializes all the event module structures used by the + * current thread. It must be called before any other function in this + * file is called. * * Results: * None. @@ -1179,10 +1161,10 @@ Tk_DeleteClientMessageHandler(proc) */ void -TkEventInit _ANSI_ARGS_((void)) +TkEventInit(void) { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); tsdPtr->handlersActive = 0; tsdPtr->pendingPtr = NULL; @@ -1200,12 +1182,10 @@ TkEventInit _ANSI_ARGS_((void)) * TkXErrorHandler -- * * TkXErrorHandler is an error handler, to be installed via - * Tk_CreateErrorHandler, that will set a flag if an X error - * occurred. + * Tk_CreateErrorHandler, that will set a flag if an X error occurred. * * Results: - * Always returns 0, indicating that the X error was - * handled. + * Always returns 0, indicating that the X error was handled. * * Side effects: * None. @@ -1214,9 +1194,9 @@ TkEventInit _ANSI_ARGS_((void)) */ static int -TkXErrorHandler(clientData, errEventPtr) - ClientData clientData; /* Pointer to flag we set */ - XErrorEvent *errEventPtr; /* X error info */ +TkXErrorHandler( + ClientData clientData, /* Pointer to flag we set. */ + XErrorEvent *errEventPtr) /* X error info. */ { int *error; @@ -1230,8 +1210,8 @@ TkXErrorHandler(clientData, errEventPtr) * * ParentXId -- * - * Returns the parent of the given window, or "None" - * if the window doesn't exist. + * Returns the parent of the given window, or "None" if the window + * doesn't exist. * * Results: * Returns an X window ID. @@ -1243,9 +1223,9 @@ TkXErrorHandler(clientData, errEventPtr) */ static Window -ParentXId(display, w) - Display *display; - Window w; +ParentXId( + Display *display, + Window w) { Tk_ErrorHandler handler; int gotXError; @@ -1255,17 +1235,23 @@ ParentXId(display, w) Window *childList; unsigned int nChildren; - /* Handle errors ourselves. */ + /* + * Handle errors ourselves. + */ gotXError = 0; handler = Tk_CreateErrorHandler(display, -1, -1, -1, TkXErrorHandler, (ClientData) (&gotXError)); - /* Get the parent window. */ + /* + * Get the parent window. + */ status = XQueryTree(display, w, &root, &parent, &childList, &nChildren); - /* Do some cleanup; gotta return "None" if we got an error. */ + /* + * Do some cleanup; gotta return "None" if we got an error. + */ Tk_DeleteErrorHandler(handler); XSync(display, False); @@ -1273,7 +1259,7 @@ ParentXId(display, w) XFree(childList); } if (status == 0) { - parent = None; + parent = None; } return parent; @@ -1284,8 +1270,8 @@ ParentXId(display, w) * * Tk_HandleEvent -- * - * Given an event, invoke all the handlers that have been - * registered for the event. + * Given an event, invoke all the handlers that have been registered for + * the event. * * Results: * None. @@ -1297,33 +1283,32 @@ ParentXId(display, w) */ void -Tk_HandleEvent(eventPtr) - XEvent *eventPtr; /* Event to dispatch. */ +Tk_HandleEvent( + XEvent *eventPtr) /* Event to dispatch. */ { register TkEventHandler *handlerPtr; TkWindow *winPtr; unsigned long mask; InProgress ip; Tcl_Interp *interp = (Tcl_Interp *) NULL; - - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - - UpdateButtonEventState (eventPtr); + UpdateButtonEventState(eventPtr); - /* - * If the generic handler processed this event we are done - * and can return. + /* + * If the generic handler processed this event we are done and can return. */ + if (InvokeGenericHandlers(tsdPtr, eventPtr)) { goto releaseUserData; } - - if (RefreshKeyboardMappingIfNeeded (eventPtr)) { + + if (RefreshKeyboardMappingIfNeeded(eventPtr)) { /* * We are done with a MappingNotify event. */ + goto releaseUserData; } @@ -1336,11 +1321,11 @@ Tk_HandleEvent(eventPtr) /* * Once a window has started getting deleted, don't process any more - * events for it except for the DestroyNotify event. This check is - * needed because a DestroyNotify handler could re-invoke the event - * loop, causing other pending events to be handled for the window - * (the window doesn't get totally expunged from our tables until - * after the DestroyNotify event has been completely handled). + * events for it except for the DestroyNotify event. This check is needed + * because a DestroyNotify handler could re-invoke the event loop, causing + * other pending events to be handled for the window (the window doesn't + * get totally expunged from our tables until after the DestroyNotify + * event has been completely handled). */ if ((winPtr->flags & TK_ALREADY_DEAD) @@ -1354,14 +1339,15 @@ Tk_HandleEvent(eventPtr) interp = winPtr->mainPtr->interp; /* - * Protect interpreter for this window from possible deletion - * while we are dealing with the event for this window. Thus, - * widget writers do not have to worry about protecting the - * interpreter in their own code. + * Protect interpreter for this window from possible deletion while we + * are dealing with the event for this window. Thus, widget writers do + * not have to worry about protecting the interpreter in their own + * code. */ + Tcl_Preserve((ClientData) interp); - result = ((InvokeFocusHandlers(&winPtr, mask, eventPtr)) + result = ((InvokeFocusHandlers(&winPtr, mask, eventPtr)) || (InvokeMouseHandlers(winPtr, mask, eventPtr))); if (result) { @@ -1374,9 +1360,10 @@ Tk_HandleEvent(eventPtr) goto releaseInterpreter; } #endif + /* - * For events where it hasn't already been done, update the current - * time in the display. + * For events where it hasn't already been done, update the current time + * in the display. */ if (eventPtr->type == PropertyNotify) { @@ -1384,8 +1371,8 @@ Tk_HandleEvent(eventPtr) } /* - * There's a potential interaction here with Tk_DeleteEventHandler. - * Read the documentation for pendingPtr. + * There's a potential interaction here with Tk_DeleteEventHandler. Read + * the documentation for pendingPtr. */ ip.eventPtr = eventPtr; @@ -1403,7 +1390,8 @@ Tk_HandleEvent(eventPtr) Tk_InternAtom((Tk_Window) winPtr, "WM_PROTOCOLS")) { TkWmProtocolEventProc(winPtr, eventPtr); } else { - InvokeClientMessageHandlers(tsdPtr, (Tk_Window)winPtr, eventPtr); + InvokeClientMessageHandlers(tsdPtr, (Tk_Window)winPtr, + eventPtr); } } } else { @@ -1418,15 +1406,15 @@ Tk_HandleEvent(eventPtr) } /* - * Pass the event to the "bind" command mechanism. But, don't - * do this for SubstructureNotify events. The "bind" command - * doesn't support them anyway, and it's easier to filter out - * these events here than in the lower-level procedures. + * Pass the event to the "bind" command mechanism. But, don't do this + * for SubstructureNotify events. The "bind" command doesn't support + * them anyway, and it's easier to filter out these events here than + * in the lower-level functions. */ /* - * ...well, except when we use the tkwm patches, in which case - * we DO handle CreateNotify events, so we gotta pass 'em through. + * ...well, except when we use the tkwm patches, in which case we DO + * handle CreateNotify events, so we gotta pass 'em through. */ if ((ip.winPtr != None) @@ -1441,20 +1429,20 @@ Tk_HandleEvent(eventPtr) * Release the interpreter for this window so that it can be potentially * deleted if requested. */ - -releaseInterpreter: + + releaseInterpreter: if (interp != (Tcl_Interp *) NULL) { Tcl_Release((ClientData) interp); } /* - * Release the user_data from the event (if it is a virtual event - * and the field was non-NULL in the first place.) Note that this - * is done using a Tcl_Obj interface, and we set the field back to - * NULL afterwards out of paranoia. + * Release the user_data from the event (if it is a virtual event and the + * field was non-NULL in the first place.) Note that this is done using a + * Tcl_Obj interface, and we set the field back to NULL afterwards out of + * paranoia. */ -releaseUserData: + releaseUserData: if (eventPtr->type == VirtualEvent) { XVirtualEvent *vePtr = (XVirtualEvent *) eventPtr; @@ -1470,9 +1458,8 @@ releaseUserData: * * TkEventDeadWindow -- * - * This procedure is invoked when it is determined that - * a window is dead. It cleans up event-related information - * about the window. + * This function is invoked when it is determined that a window is dead. + * It cleans up event-related information about the window. * * Results: * None. @@ -1484,27 +1471,26 @@ releaseUserData: */ void -TkEventDeadWindow(winPtr) - TkWindow *winPtr; /* Information about the window - * that is being deleted. */ +TkEventDeadWindow( + TkWindow *winPtr) /* Information about the window that is being + * deleted. */ { register TkEventHandler *handlerPtr; register InProgress *ipPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* - * While deleting all the handlers, be careful to check for - * Tk_HandleEvent being about to process one of the deleted - * handlers. If it is, tell it to quit (all of the handlers - * are being deleted). + * While deleting all the handlers, be careful to check for Tk_HandleEvent + * being about to process one of the deleted handlers. If it is, tell it + * to quit (all of the handlers are being deleted). */ while (winPtr->handlerList != NULL) { handlerPtr = winPtr->handlerList; winPtr->handlerList = handlerPtr->nextPtr; - for (ipPtr = tsdPtr->pendingPtr; ipPtr != NULL; - ipPtr = ipPtr->nextPtr) { + for (ipPtr = tsdPtr->pendingPtr; ipPtr != NULL; + ipPtr = ipPtr->nextPtr) { if (ipPtr->nextHandler == handlerPtr) { ipPtr->nextHandler = NULL; } @@ -1521,15 +1507,13 @@ TkEventDeadWindow(winPtr) * * TkCurrentTime -- * - * Try to deduce the current time. "Current time" means the time - * of the event that led to the current code being executed, which - * means the time in the most recently-nested invocation of - * Tk_HandleEvent. + * Try to deduce the current time. "Current time" means the time of the + * event that led to the current code being executed, which means the + * time in the most recently-nested invocation of Tk_HandleEvent. * * Results: - * The return value is the time from the current event, or - * CurrentTime if there is no current event or if the current - * event contains no time. + * The return value is the time from the current event, or CurrentTime if + * there is no current event or if the current event contains no time. * * Side effects: * None. @@ -1538,31 +1522,31 @@ TkEventDeadWindow(winPtr) */ Time -TkCurrentTime(dispPtr) - TkDisplay *dispPtr; /* Display for which the time is desired. */ +TkCurrentTime( + TkDisplay *dispPtr) /* Display for which the time is desired. */ { register XEvent *eventPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (tsdPtr->pendingPtr == NULL) { return dispPtr->lastEventTime; } eventPtr = tsdPtr->pendingPtr->eventPtr; switch (eventPtr->type) { - case ButtonPress: - case ButtonRelease: - return eventPtr->xbutton.time; - case KeyPress: - case KeyRelease: - return eventPtr->xkey.time; - case MotionNotify: - return eventPtr->xmotion.time; - case EnterNotify: - case LeaveNotify: - return eventPtr->xcrossing.time; - case PropertyNotify: - return eventPtr->xproperty.time; + case ButtonPress: + case ButtonRelease: + return eventPtr->xbutton.time; + case KeyPress: + case KeyRelease: + return eventPtr->xkey.time; + case MotionNotify: + return eventPtr->xmotion.time; + case EnterNotify: + case LeaveNotify: + return eventPtr->xcrossing.time; + case PropertyNotify: + return eventPtr->xproperty.time; } return dispPtr->lastEventTime; } @@ -1572,15 +1556,14 @@ TkCurrentTime(dispPtr) * * Tk_RestrictEvents -- * - * This procedure is used to globally restrict the set of events - * that will be dispatched. The restriction is done by filtering - * all incoming X events through a procedure that determines - * whether they are to be processed immediately, deferred, or - * discarded. + * This function is used to globally restrict the set of events that will + * be dispatched. The restriction is done by filtering all incoming X + * events through a function that determines whether they are to be + * processed immediately, deferred, or discarded. * * Results: - * The return value is the previous restriction procedure in effect, - * if there was one, or NULL if there wasn't. + * The return value is the previous restriction function in effect, if + * there was one, or NULL if there wasn't. * * Side effects: * From now on, proc will be called to determine whether to process, @@ -1590,16 +1573,15 @@ TkCurrentTime(dispPtr) */ Tk_RestrictProc * -Tk_RestrictEvents(proc, arg, prevArgPtr) - Tk_RestrictProc *proc; /* Procedure to call for each incoming - * event. */ - ClientData arg; /* Arbitrary argument to pass to proc. */ - ClientData *prevArgPtr; /* Place to store information about previous +Tk_RestrictEvents( + Tk_RestrictProc *proc, /* Function to call for each incoming event */ + ClientData arg, /* Arbitrary argument to pass to proc. */ + ClientData *prevArgPtr) /* Place to store information about previous * argument. */ { Tk_RestrictProc *prev; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); prev = tsdPtr->restrictProc; *prevArgPtr = tsdPtr->restrictArg; @@ -1613,7 +1595,7 @@ Tk_RestrictEvents(proc, arg, prevArgPtr) * * Tk_CollapseMotionEvents -- * - * This procedure controls whether we collapse motion events in a + * This function controls whether we collapse motion events in a * particular display or not. * * Results: @@ -1626,10 +1608,10 @@ Tk_RestrictEvents(proc, arg, prevArgPtr) */ int -Tk_CollapseMotionEvents(display, collapse) - Display *display; /* Display handling these events. */ - int collapse; /* boolean value that specifies whether - * motion events should be collapsed. */ +Tk_CollapseMotionEvents( + Display *display, /* Display handling these events. */ + int collapse) /* Boolean value that specifies whether motion + * events should be collapsed. */ { TkDisplay *dispPtr = (TkDisplay *) display; int prev = (dispPtr->flags & TK_DISPLAY_COLLAPSE_MOTION_EVENTS); @@ -1647,28 +1629,26 @@ Tk_CollapseMotionEvents(display, collapse) * * Tk_QueueWindowEvent -- * - * Given an X-style window event, this procedure adds it to the - * Tcl event queue at the given position. This procedure also - * performs mouse motion event collapsing if possible. + * Given an X-style window event, this function adds it to the Tcl event + * queue at the given position. This function also performs mouse motion + * event collapsing if possible. * * Results: * None. * * Side effects: - * Adds stuff to the event queue, which will eventually be - * processed. + * Adds stuff to the event queue, which will eventually be processed. * *---------------------------------------------------------------------- */ void -Tk_QueueWindowEvent(eventPtr, position) - XEvent *eventPtr; /* Event to add to queue. This - * procedures copies it before adding - * it to the queue. */ - Tcl_QueuePosition position; /* Where to put it on the queue: - * TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, - * or TCL_QUEUE_MARK. */ +Tk_QueueWindowEvent( + XEvent *eventPtr, /* Event to add to queue. This function copies + * it before adding it to the queue. */ + Tcl_QueuePosition position) /* Where to put it on the queue: + * TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, or + * TCL_QUEUE_MARK. */ { TkWindowEvent *wevPtr; TkDisplay *dispPtr; @@ -1687,10 +1667,11 @@ Tk_QueueWindowEvent(eventPtr, position) } /* - * Don't filter motion events if the user - * defaulting to true (1), which could be set to false (0) when the - * user wishes to receive all the motion data) + * Don't filter motion events if the user defaulting to true (1), which + * could be set to false (0) when the user wishes to receive all the + * motion data) */ + if (!(dispPtr->flags & TK_DISPLAY_COLLAPSE_MOTION_EVENTS)) { wevPtr = (TkWindowEvent *) ckalloc(sizeof(TkWindowEvent)); wevPtr->header.proc = WindowEventProc; @@ -1703,9 +1684,8 @@ Tk_QueueWindowEvent(eventPtr, position) if ((eventPtr->type == MotionNotify) && (eventPtr->xmotion.window == dispPtr->delayedMotionPtr->event.xmotion.window)) { /* - * The new event is a motion event in the same window as the - * saved motion event. Just replace the saved event with the - * new one. + * The new event is a motion event in the same window as the saved + * motion event. Just replace the saved event with the new one. */ dispPtr->delayedMotionPtr->event = *eventPtr; @@ -1714,7 +1694,7 @@ Tk_QueueWindowEvent(eventPtr, position) && (eventPtr->type != NoExpose) && (eventPtr->type != Expose)) { /* - * The new event may conflict with the saved motion event. Queue + * The new event may conflict with the saved motion event. Queue * the saved motion event now so that it will be processed before * the new event. */ @@ -1730,9 +1710,9 @@ Tk_QueueWindowEvent(eventPtr, position) wevPtr->event = *eventPtr; if ((eventPtr->type == MotionNotify) && (position == TCL_QUEUE_TAIL)) { /* - * The new event is a motion event so don't queue it immediately; - * save it around in case another motion event arrives that it can - * be collapsed with. + * The new event is a motion event so don't queue it immediately; save + * it around in case another motion event arrives that it can be + * collapsed with. */ if (dispPtr->delayedMotionPtr != NULL) { @@ -1750,8 +1730,8 @@ Tk_QueueWindowEvent(eventPtr, position) * * TkQueueEventForAllChildren -- * - * Given an XEvent, recursively queue the event for this window and - * all non-toplevel children of the given window. + * Given an XEvent, recursively queue the event for this window and all + * non-toplevel children of the given window. * * Results: * None. @@ -1763,19 +1743,19 @@ Tk_QueueWindowEvent(eventPtr, position) */ void -TkQueueEventForAllChildren(winPtr, eventPtr) - TkWindow *winPtr; /* Window to which event is sent. */ - XEvent *eventPtr; /* The event to be sent. */ +TkQueueEventForAllChildren( + TkWindow *winPtr, /* Window to which event is sent. */ + XEvent *eventPtr) /* The event to be sent. */ { TkWindow *childPtr; if (!Tk_IsMapped(winPtr)) { - return; + return; } eventPtr->xany.window = winPtr->window; Tk_QueueWindowEvent(eventPtr, TCL_QUEUE_TAIL); - + childPtr = winPtr->childList; while (childPtr != NULL) { if (!Tk_TopWinHierarchy(childPtr)) { @@ -1790,16 +1770,16 @@ TkQueueEventForAllChildren(winPtr, eventPtr) * * WindowEventProc -- * - * This procedure is called by Tcl_DoOneEvent when a window event - * reaches the front of the event queue. This procedure is responsible - * for actually handling the event. + * This function is called by Tcl_DoOneEvent when a window event reaches + * the front of the event queue. This function is responsible for + * actually handling the event. * * Results: - * Returns 1 if the event was handled, meaning it should be removed - * from the queue. Returns 0 if the event was not handled, meaning - * it should stay on the queue. The event isn't handled if the - * TCL_WINDOW_EVENTS bit isn't set in flags, if a restrict proc - * prevents the event from being handled. + * Returns 1 if the event was handled, meaning it should be removed from + * the queue. Returns 0 if the event was not handled, meaning it should + * stay on the queue. The event isn't handled if the TCL_WINDOW_EVENTS + * bit isn't set in flags, if a restrict proc prevents the event from + * being handled. * * Side effects: * Whatever the event handlers for the event do. @@ -1808,15 +1788,15 @@ TkQueueEventForAllChildren(winPtr, eventPtr) */ static int -WindowEventProc(evPtr, flags) - Tcl_Event *evPtr; /* Event to service. */ - int flags; /* Flags that indicate what events to - * handle, such as TCL_WINDOW_EVENTS. */ +WindowEventProc( + Tcl_Event *evPtr, /* Event to service. */ + int flags) /* Flags that indicate what events to handle, + * such as TCL_WINDOW_EVENTS. */ { TkWindowEvent *wevPtr = (TkWindowEvent *) evPtr; Tk_RestrictAction result; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!(flags & TCL_WINDOW_EVENTS)) { return 0; @@ -1831,6 +1811,7 @@ WindowEventProc(evPtr, flags) * TK_DELETE_EVENT: return and say we processed the event, * even though we didn't do anything at all. */ + return 1; } } @@ -1844,23 +1825,23 @@ WindowEventProc(evPtr, flags) * * DelayedMotionProc -- * - * This procedure is invoked as an idle handler when a mouse motion - * event has been delayed. It queues the delayed event so that it - * will finally be serviced. + * This function is invoked as an idle handler when a mouse motion event + * has been delayed. It queues the delayed event so that it will finally + * be serviced. * * Results: * None. * * Side effects: - * The delayed mouse motion event gets added to the Tcl event - * queue for servicing. + * The delayed mouse motion event gets added to the Tcl event queue for + * servicing. * *---------------------------------------------------------------------- */ static void -DelayedMotionProc(clientData) - ClientData clientData; /* Pointer to display containing a delayed +DelayedMotionProc( + ClientData clientData) /* Pointer to display containing a delayed * motion event to be serviced. */ { TkDisplay *dispPtr = (TkDisplay *) clientData; @@ -1889,9 +1870,9 @@ DelayedMotionProc(clientData) */ void -TkCreateExitHandler (proc, clientData) - Tcl_ExitProc *proc; /* Procedure to invoke. */ - ClientData clientData; /* Arbitrary value to pass to proc. */ +TkCreateExitHandler( + Tcl_ExitProc *proc, /* Function to invoke. */ + ClientData clientData) /* Arbitrary value to pass to proc. */ { ExitHandler *exitPtr; @@ -1899,7 +1880,7 @@ TkCreateExitHandler (proc, clientData) exitPtr->proc = proc; exitPtr->clientData = clientData; Tcl_MutexLock(&exitMutex); - if (firstExitPtr == NULL) { + if (firstExitPtr == NULL && !TclInExit()) { Tcl_CreateExitHandler(TkFinalize, NULL); } exitPtr->nextPtr = firstExitPtr; @@ -1924,9 +1905,9 @@ TkCreateExitHandler (proc, clientData) */ void -TkDeleteExitHandler (proc, clientData) - Tcl_ExitProc *proc; /* Procedure that was previously registered. */ - ClientData clientData; /* Arbitrary value to pass to proc. */ +TkDeleteExitHandler( + Tcl_ExitProc *proc, /* Function that was previously registered. */ + ClientData clientData) /* Arbitrary value to pass to proc. */ { ExitHandler *exitPtr, *prevPtr; @@ -1951,13 +1932,89 @@ TkDeleteExitHandler (proc, clientData) /* *---------------------------------------------------------------------- * + * TkCreateThreadExitHandler -- + * + * Same as Tcl_CreateThreadExitHandler, but private to Tk. + * + * Results: + * None. + * + * Side effects: + * Proc will be invoked with clientData as argument when the application + * exits. + * + *---------------------------------------------------------------------- + */ + +void +TkCreateThreadExitHandler( + Tcl_ExitProc *proc, /* Function to invoke. */ + ClientData clientData) /* Arbitrary value to pass to proc. */ +{ + ExitHandler *exitPtr; + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + + exitPtr = (ExitHandler *) ckalloc(sizeof(ExitHandler)); + exitPtr->proc = proc; + exitPtr->clientData = clientData; + if (tsdPtr->firstExitPtr == NULL && !TclInExit()) { + Tcl_CreateThreadExitHandler(TkFinalizeThread, NULL); + } + exitPtr->nextPtr = tsdPtr->firstExitPtr; + tsdPtr->firstExitPtr = exitPtr; +} + +/* + *---------------------------------------------------------------------- + * + * TkDeleteThreadExitHandler -- + * + * Same as Tcl_DeleteThreadExitHandler, but private to Tk. + * + * Results: + * None. + * + * Side effects: + * If there is an exit handler corresponding to proc and clientData then + * it is cancelled; if no such handler exists then nothing happens. + * + *---------------------------------------------------------------------- + */ + +void +TkDeleteThreadExitHandler( + Tcl_ExitProc *proc, /* Function that was previously registered. */ + ClientData clientData) /* Arbitrary value to pass to proc. */ +{ + ExitHandler *exitPtr, *prevPtr; + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + + for (prevPtr = NULL, exitPtr = tsdPtr->firstExitPtr; exitPtr != NULL; + prevPtr = exitPtr, exitPtr = exitPtr->nextPtr) { + if ((exitPtr->proc == proc) + && (exitPtr->clientData == clientData)) { + if (prevPtr == NULL) { + tsdPtr->firstExitPtr = exitPtr->nextPtr; + } else { + prevPtr->nextPtr = exitPtr->nextPtr; + } + ckfree((char *) exitPtr); + return; + } + } +} + +/* + *---------------------------------------------------------------------- + * * TkFinalize -- * * Runs our private exit handlers and removes itself from Tcl. This is - * benificial should we want to protect from dangling pointers should - * the Tk shared library be unloaded prior to Tcl which can happen on - * windows should the process be forcefully exiting from an exception - * handler. + * benificial should we want to protect from dangling pointers should the + * Tk shared library be unloaded prior to Tcl which can happen on windows + * should the process be forcefully exiting from an exception handler. * * Results: * None. @@ -1969,8 +2026,8 @@ TkDeleteExitHandler (proc, clientData) */ void -TkFinalize (clientData) - ClientData clientData; /* Arbitrary value to pass to proc. */ +TkFinalize( + ClientData clientData) /* Arbitrary value to pass to proc. */ { ExitHandler *exitPtr; @@ -1979,10 +2036,9 @@ TkFinalize (clientData) Tcl_MutexLock(&exitMutex); for (exitPtr = firstExitPtr; exitPtr != NULL; exitPtr = firstExitPtr) { /* - * Be careful to remove the handler from the list before - * invoking its callback. This protects us against - * double-freeing if the callback should call - * TkDeleteExitHandler on itself. + * Be careful to remove the handler from the list before invoking its + * callback. This protects us against double-freeing if the callback + * should call TkDeleteExitHandler on itself. */ firstExitPtr = exitPtr->nextPtr; @@ -1990,7 +2046,7 @@ TkFinalize (clientData) (*exitPtr->proc)(exitPtr->clientData); ckfree((char *) exitPtr); Tcl_MutexLock(&exitMutex); - } + } firstExitPtr = NULL; Tcl_MutexUnlock(&exitMutex); } @@ -1998,24 +2054,80 @@ TkFinalize (clientData) /* *---------------------------------------------------------------------- * + * TkFinalizeThread -- + * + * Runs our private thread exit handlers and removes itself from Tcl. + * This is benificial should we want to protect from dangling pointers + * should the Tk shared library be unloaded prior to Tcl which can happen + * on Windows should the process be forcefully exiting from an exception + * handler. + * + * Results: + * None. + * + * Side effects. + * None. + * + *---------------------------------------------------------------------- + */ + +void +TkFinalizeThread( + ClientData clientData) /* Arbitrary value to pass to proc. */ +{ + ExitHandler *exitPtr; + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + + Tcl_DeleteThreadExitHandler(TkFinalizeThread, NULL); + + if (tsdPtr != NULL) { + tsdPtr->inExit = 1; + + for (exitPtr = tsdPtr->firstExitPtr; exitPtr != NULL; + exitPtr = tsdPtr->firstExitPtr) { + /* + * Be careful to remove the handler from the list before invoking + * its callback. This protects us against double-freeing if the + * callback should call TkDeleteThreadExitHandler on itself. + */ + + tsdPtr->firstExitPtr = exitPtr->nextPtr; + (*exitPtr->proc)(exitPtr->clientData); + ckfree((char *) exitPtr); + } + } +} + +/* + *---------------------------------------------------------------------- + * * Tk_MainLoop -- * - * Call Tcl_DoOneEvent over and over again in an infinite loop as - * long as there exist any main windows. + * Call Tcl_DoOneEvent over and over again in an infinite loop as long as + * there exist any main windows. * * Results: * None. * * Side effects: - * Arbitrary; depends on handlers for events. + * Arbitrary; depends on handlers for events. * *---------------------------------------------------------------------- */ void -Tk_MainLoop() +Tk_MainLoop(void) { while (Tk_GetNumMainWindows() > 0) { Tcl_DoOneEvent(0); } } + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 2b9c7dd..e80bb61 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -1,15 +1,15 @@ - # tkInt.decls -- +# tkInt.decls -- # -# This file contains the declarations for all unsupported -# functions that are exported by the Tk library. This file -# is used to generate the tkIntDecls.h, tkIntPlatDecls.h, -# tkIntStub.c, and tkPlatStub.c files. +# This file contains the declarations for all unsupported functions that +# are exported by the Tk library. This file is used to generate the +# tkIntDecls.h, tkIntPlatDecls.h, tkIntStub.c, and tkPlatStub.c files. # # Copyright (c) 1998-1999 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: tkInt.decls,v 1.39 2005/08/09 07:39:17 das Exp $ +# +# RCS: @(#) $Id: tkInt.decls,v 1.40 2005/09/21 10:54:40 dkf Exp $ library tk @@ -17,636 +17,497 @@ library tk interface tkInt -# Declare each of the functions in the unsupported internal Tcl -# interface. These interfaces are allowed to changed between versions. -# Use at your own risk. Note that the position of functions should not -# be changed between versions to avoid gratuitous incompatibilities. +# Declare each of the functions in the unsupported internal Tcl interface. +# These interfaces are allowed to changed between versions. Use at your own +# risk. Note that the position of functions should not be changed between +# versions to avoid gratuitous incompatibilities. declare 0 generic { - TkWindow * TkAllocWindow (TkDisplay *dispPtr, int screenNum, \ + TkWindow *TkAllocWindow(TkDisplay *dispPtr, int screenNum, TkWindow *parentPtr) } - declare 1 generic { - void TkBezierPoints (double control[], int numSteps, double *coordPtr) + void TkBezierPoints(double control[], int numSteps, double *coordPtr) } - declare 2 generic { - void TkBezierScreenPoints (Tk_Canvas canvas, double control[], \ + void TkBezierScreenPoints(Tk_Canvas canvas, double control[], int numSteps, XPoint *xPointPtr) } - declare 3 generic { - void TkBindDeadWindow (TkWindow *winPtr) + void TkBindDeadWindow(TkWindow *winPtr) } - declare 4 generic { - void TkBindEventProc (TkWindow *winPtr, XEvent *eventPtr) + void TkBindEventProc(TkWindow *winPtr, XEvent *eventPtr) } - declare 5 generic { - void TkBindFree (TkMainInfo *mainPtr) + void TkBindFree(TkMainInfo *mainPtr) } - declare 6 generic { - void TkBindInit (TkMainInfo *mainPtr) + void TkBindInit(TkMainInfo *mainPtr) } - declare 7 generic { - void TkChangeEventWindow (XEvent *eventPtr, TkWindow *winPtr) + void TkChangeEventWindow(XEvent *eventPtr, TkWindow *winPtr) } - declare 8 generic { - int TkClipInit (Tcl_Interp *interp, TkDisplay *dispPtr) + int TkClipInit(Tcl_Interp *interp, TkDisplay *dispPtr) } - declare 9 generic { - void TkComputeAnchor (Tk_Anchor anchor, Tk_Window tkwin, \ - int padX, int padY, int innerWidth, int innerHeight, \ - int *xPtr, int *yPtr) + void TkComputeAnchor(Tk_Anchor anchor, Tk_Window tkwin, int padX, int padY, + int innerWidth, int innerHeight, int *xPtr, int *yPtr) } - declare 10 generic { - int TkCopyAndGlobalEval (Tcl_Interp *interp, char *script) + int TkCopyAndGlobalEval(Tcl_Interp *interp, char *script) } - declare 11 generic { - unsigned long TkCreateBindingProcedure (Tcl_Interp *interp, \ - Tk_BindingTable bindingTable, \ - ClientData object, CONST char *eventString, \ - TkBindEvalProc *evalProc, TkBindFreeProc *freeProc, \ - ClientData clientData) + unsigned long TkCreateBindingProcedure(Tcl_Interp *interp, + Tk_BindingTable bindingTable, ClientData object, + CONST char *eventString, TkBindEvalProc *evalProc, + TkBindFreeProc *freeProc, ClientData clientData) } - declare 12 generic { - TkCursor * TkCreateCursorFromData (Tk_Window tkwin, \ - CONST char *source, CONST char *mask, int width, int height, \ + TkCursor *TkCreateCursorFromData(Tk_Window tkwin, + CONST char *source, CONST char *mask, int width, int height, int xHot, int yHot, XColor fg, XColor bg) } - declare 13 generic { - int TkCreateFrame (ClientData clientData, \ - Tcl_Interp *interp, int argc, char **argv, \ - int toplevel, char *appName) + int TkCreateFrame(ClientData clientData, Tcl_Interp *interp, + int argc, char **argv, int toplevel, char *appName) } - declare 14 generic { - Tk_Window TkCreateMainWindow (Tcl_Interp *interp, \ + Tk_Window TkCreateMainWindow(Tcl_Interp *interp, CONST char *screenName, char *baseName) } - declare 15 generic { - Time TkCurrentTime (TkDisplay *dispPtr) + Time TkCurrentTime(TkDisplay *dispPtr) } - declare 16 generic { - void TkDeleteAllImages (TkMainInfo *mainPtr) + void TkDeleteAllImages(TkMainInfo *mainPtr) } - declare 17 generic { - void TkDoConfigureNotify (TkWindow *winPtr) + void TkDoConfigureNotify(TkWindow *winPtr) } - declare 18 generic { - void TkDrawInsetFocusHighlight (Tk_Window tkwin, GC gc, int width, \ + void TkDrawInsetFocusHighlight(Tk_Window tkwin, GC gc, int width, Drawable drawable, int padding) } - declare 19 generic { - void TkEventDeadWindow (TkWindow *winPtr) + void TkEventDeadWindow(TkWindow *winPtr) } - declare 20 generic { - void TkFillPolygon (Tk_Canvas canvas, \ - double *coordPtr, int numPoints, Display *display, \ - Drawable drawable, GC gc, GC outlineGC) + void TkFillPolygon(Tk_Canvas canvas, double *coordPtr, int numPoints, + Display *display, Drawable drawable, GC gc, GC outlineGC) } - declare 21 generic { - int TkFindStateNum (Tcl_Interp *interp, \ - CONST char *option, CONST TkStateMap *mapPtr, \ - CONST char *strKey) + int TkFindStateNum(Tcl_Interp *interp, CONST char *option, + CONST TkStateMap *mapPtr, CONST char *strKey) } - declare 22 generic { - char * TkFindStateString (CONST TkStateMap *mapPtr, int numKey) + char *TkFindStateString(CONST TkStateMap *mapPtr, int numKey) } - declare 23 generic { - void TkFocusDeadWindow (TkWindow *winPtr) + void TkFocusDeadWindow(TkWindow *winPtr) } - declare 24 generic { - int TkFocusFilterEvent (TkWindow *winPtr, XEvent *eventPtr) + int TkFocusFilterEvent(TkWindow *winPtr, XEvent *eventPtr) } - declare 25 generic { - TkWindow * TkFocusKeyEvent (TkWindow *winPtr, XEvent *eventPtr) + TkWindow *TkFocusKeyEvent(TkWindow *winPtr, XEvent *eventPtr) } - declare 26 generic { - void TkFontPkgInit (TkMainInfo *mainPtr) + void TkFontPkgInit(TkMainInfo *mainPtr) } - declare 27 generic { - void TkFontPkgFree (TkMainInfo *mainPtr) + void TkFontPkgFree(TkMainInfo *mainPtr) } - declare 28 generic { - void TkFreeBindingTags (TkWindow *winPtr) + void TkFreeBindingTags(TkWindow *winPtr) } # Name change only, TkFreeCursor in Tcl 8.0.x now TkpFreeCursor declare 29 generic { - void TkpFreeCursor (TkCursor *cursorPtr) + void TkpFreeCursor(TkCursor *cursorPtr) } declare 30 generic { - char * TkGetBitmapData (Tcl_Interp *interp, \ - char *string, char *fileName, int *widthPtr, \ - int *heightPtr, int *hotXPtr, int *hotYPtr) + char *TkGetBitmapData(Tcl_Interp *interp, char *string, char *fileName, + int *widthPtr, int *heightPtr, int *hotXPtr, int *hotYPtr) } - declare 31 generic { - void TkGetButtPoints (double p1[], double p2[], \ + void TkGetButtPoints(double p1[], double p2[], double width, int project, double m1[], double m2[]) } - declare 32 generic { - TkCursor * TkGetCursorByName (Tcl_Interp *interp, \ + TkCursor *TkGetCursorByName(Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid string) } - declare 33 generic { - CONST84_RETURN char * TkGetDefaultScreenName (Tcl_Interp *interp, \ + CONST84_RETURN char *TkGetDefaultScreenName(Tcl_Interp *interp, CONST char *screenName) } - declare 34 generic { - TkDisplay * TkGetDisplay (Display *display) + TkDisplay *TkGetDisplay(Display *display) } - declare 35 generic { - int TkGetDisplayOf (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], \ + int TkGetDisplayOf(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tk_Window *tkwinPtr) } - declare 36 generic { - TkWindow * TkGetFocusWin (TkWindow *winPtr) + TkWindow *TkGetFocusWin(TkWindow *winPtr) } - declare 37 generic { - int TkGetInterpNames (Tcl_Interp *interp, Tk_Window tkwin) + int TkGetInterpNames(Tcl_Interp *interp, Tk_Window tkwin) } - declare 38 generic { - int TkGetMiterPoints (double p1[], double p2[], double p3[], \ - double width, double m1[],double m2[]) + int TkGetMiterPoints(double p1[], double p2[], double p3[], + double width, double m1[], double m2[]) } - declare 39 generic { - void TkGetPointerCoords (Tk_Window tkwin, int *xPtr, int *yPtr) + void TkGetPointerCoords(Tk_Window tkwin, int *xPtr, int *yPtr) } - declare 40 generic { - void TkGetServerInfo (Tcl_Interp *interp, Tk_Window tkwin) + void TkGetServerInfo(Tcl_Interp *interp, Tk_Window tkwin) } - declare 41 generic { - void TkGrabDeadWindow (TkWindow *winPtr) + void TkGrabDeadWindow(TkWindow *winPtr) } - declare 42 generic { - int TkGrabState (TkWindow *winPtr) + int TkGrabState(TkWindow *winPtr) } - declare 43 generic { - void TkIncludePoint (Tk_Item *itemPtr, double *pointPtr) + void TkIncludePoint(Tk_Item *itemPtr, double *pointPtr) } - declare 44 generic { - void TkInOutEvents (XEvent *eventPtr, TkWindow *sourcePtr, \ - TkWindow *destPtr, int leaveType, int enterType, \ + void TkInOutEvents(XEvent *eventPtr, TkWindow *sourcePtr, + TkWindow *destPtr, int leaveType, int enterType, Tcl_QueuePosition position) } - declare 45 generic { - void TkInstallFrameMenu (Tk_Window tkwin) + void TkInstallFrameMenu(Tk_Window tkwin) } - declare 46 generic { - char * TkKeysymToString (KeySym keysym) + char *TkKeysymToString(KeySym keysym) } - declare 47 generic { - int TkLineToArea (double end1Ptr[], double end2Ptr[], double rectPtr[]) + int TkLineToArea(double end1Ptr[], double end2Ptr[], double rectPtr[]) } - declare 48 generic { - double TkLineToPoint (double end1Ptr[], \ - double end2Ptr[], double pointPtr[]) + double TkLineToPoint(double end1Ptr[], double end2Ptr[], double pointPtr[]) } - declare 49 generic { - int TkMakeBezierCurve (Tk_Canvas canvas, \ - double *pointPtr, int numPoints, int numSteps, \ - XPoint xPoints[], double dblPoints[]) + int TkMakeBezierCurve(Tk_Canvas canvas, double *pointPtr, int numPoints, + int numSteps, XPoint xPoints[], double dblPoints[]) } - declare 50 generic { - void TkMakeBezierPostscript (Tcl_Interp *interp, \ + void TkMakeBezierPostscript(Tcl_Interp *interp, Tk_Canvas canvas, double *pointPtr, int numPoints) } - declare 51 generic { - void TkOptionClassChanged (TkWindow *winPtr) + void TkOptionClassChanged(TkWindow *winPtr) } - declare 52 generic { - void TkOptionDeadWindow (TkWindow *winPtr) + void TkOptionDeadWindow(TkWindow *winPtr) } - declare 53 generic { - int TkOvalToArea (double *ovalPtr, double *rectPtr) + int TkOvalToArea(double *ovalPtr, double *rectPtr) } - declare 54 generic { - double TkOvalToPoint (double ovalPtr[], \ + double TkOvalToPoint(double ovalPtr[], double width, int filled, double pointPtr[]) } - declare 55 generic { - int TkpChangeFocus (TkWindow *winPtr, int force) + int TkpChangeFocus(TkWindow *winPtr, int force) } - declare 56 generic { - void TkpCloseDisplay (TkDisplay *dispPtr) + void TkpCloseDisplay(TkDisplay *dispPtr) } - declare 57 generic { - void TkpClaimFocus (TkWindow *topLevelPtr, int force) + void TkpClaimFocus(TkWindow *topLevelPtr, int force) } - declare 58 generic { - void TkpDisplayWarning (CONST char *msg, CONST char *title) + void TkpDisplayWarning(CONST char *msg, CONST char *title) } - declare 59 generic { - void TkpGetAppName (Tcl_Interp *interp, Tcl_DString *name) + void TkpGetAppName(Tcl_Interp *interp, Tcl_DString *name) } - declare 60 generic { - TkWindow * TkpGetOtherWindow (TkWindow *winPtr) + TkWindow *TkpGetOtherWindow(TkWindow *winPtr) } - declare 61 generic { - TkWindow * TkpGetWrapperWindow (TkWindow *winPtr) + TkWindow *TkpGetWrapperWindow(TkWindow *winPtr) } - declare 62 generic { - int TkpInit (Tcl_Interp *interp) + int TkpInit(Tcl_Interp *interp) } - declare 63 generic { - void TkpInitializeMenuBindings (Tcl_Interp *interp, \ + void TkpInitializeMenuBindings(Tcl_Interp *interp, Tk_BindingTable bindingTable) } - declare 64 generic { - void TkpMakeContainer (Tk_Window tkwin) + void TkpMakeContainer(Tk_Window tkwin) } - declare 65 generic { - void TkpMakeMenuWindow (Tk_Window tkwin, int transient) + void TkpMakeMenuWindow(Tk_Window tkwin, int transient) } - declare 66 generic { - Window TkpMakeWindow (TkWindow *winPtr, Window parent) + Window TkpMakeWindow(TkWindow *winPtr, Window parent) } - declare 67 generic { - void TkpMenuNotifyToplevelCreate (Tcl_Interp *interp1, char *menuName) + void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp1, char *menuName) } - declare 68 generic { - TkDisplay * TkpOpenDisplay (CONST char *display_name) + TkDisplay *TkpOpenDisplay(CONST char *display_name) } - declare 69 generic { - int TkPointerEvent (XEvent *eventPtr, TkWindow *winPtr) + int TkPointerEvent(XEvent *eventPtr, TkWindow *winPtr) } - declare 70 generic { - int TkPolygonToArea (double *polyPtr, int numPoints, double *rectPtr) + int TkPolygonToArea(double *polyPtr, int numPoints, double *rectPtr) } - declare 71 generic { - double TkPolygonToPoint (double *polyPtr, int numPoints, double *pointPtr) + double TkPolygonToPoint(double *polyPtr, int numPoints, double *pointPtr) } - declare 72 generic { - int TkPositionInTree (TkWindow *winPtr, TkWindow *treePtr) + int TkPositionInTree(TkWindow *winPtr, TkWindow *treePtr) } - declare 73 generic { - void TkpRedirectKeyEvent (TkWindow *winPtr, XEvent *eventPtr) + 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, char *menuName) } - declare 75 generic { - int TkpUseWindow (Tcl_Interp *interp, Tk_Window tkwin, CONST char *string) + int TkpUseWindow(Tcl_Interp *interp, Tk_Window tkwin, CONST char *string) } - declare 76 generic { - int TkpWindowWasRecentlyDeleted (Window win, TkDisplay *dispPtr) + int TkpWindowWasRecentlyDeleted(Window win, TkDisplay *dispPtr) } - declare 77 generic { - void TkQueueEventForAllChildren (TkWindow *winPtr, XEvent *eventPtr) + void TkQueueEventForAllChildren(TkWindow *winPtr, XEvent *eventPtr) } - declare 78 generic { - int TkReadBitmapFile (Display* display, Drawable d, CONST char* filename, \ - unsigned int* width_return, unsigned int* height_return, \ - Pixmap* bitmap_return, int* x_hot_return, int* y_hot_return) + int TkReadBitmapFile(Display *display, Drawable d, CONST char *filename, + unsigned int *width_return, unsigned int *height_return, + Pixmap *bitmap_return, int *x_hot_return, int *y_hot_return) } - declare 79 generic { - int TkScrollWindow (Tk_Window tkwin, GC gc, \ - int x, int y, int width, int height, int dx, \ - int dy, TkRegion damageRgn) + int TkScrollWindow(Tk_Window tkwin, GC gc, int x, int y, + int width, int height, int dx, int dy, TkRegion damageRgn) } - declare 80 generic { - void TkSelDeadWindow (TkWindow *winPtr) + void TkSelDeadWindow(TkWindow *winPtr) } - declare 81 generic { - void TkSelEventProc (Tk_Window tkwin, XEvent *eventPtr) + void TkSelEventProc(Tk_Window tkwin, XEvent *eventPtr) } - declare 82 generic { - void TkSelInit (Tk_Window tkwin) + void TkSelInit(Tk_Window tkwin) } - declare 83 generic { - void TkSelPropProc (XEvent *eventPtr) + void TkSelPropProc(XEvent *eventPtr) } # Exported publically as Tk_SetClassProcs in 8.4a2 #declare 84 generic { -# void TkSetClassProcs (Tk_Window tkwin, \ +# void TkSetClassProcs(Tk_Window tkwin, # TkClassProcs *procs, ClientData instanceData) #} declare 85 generic { - void TkSetWindowMenuBar (Tcl_Interp *interp, \ - Tk_Window tkwin, char *oldMenuName, char *menuName) + void TkSetWindowMenuBar(Tcl_Interp *interp, Tk_Window tkwin, + char *oldMenuName, char *menuName) } - declare 86 generic { - KeySym TkStringToKeysym (char *name) + KeySym TkStringToKeysym(char *name) } - declare 87 generic { - int TkThickPolyLineToArea (double *coordPtr, \ - int numPoints, double width, int capStyle, \ - int joinStyle, double *rectPtr) + int TkThickPolyLineToArea(double *coordPtr, int numPoints, + double width, int capStyle, int joinStyle, double *rectPtr) } - declare 88 generic { - void TkWmAddToColormapWindows (TkWindow *winPtr) + void TkWmAddToColormapWindows(TkWindow *winPtr) } - declare 89 generic { - void TkWmDeadWindow (TkWindow *winPtr) + void TkWmDeadWindow(TkWindow *winPtr) } - declare 90 generic { - TkWindow * TkWmFocusToplevel (TkWindow *winPtr) + TkWindow *TkWmFocusToplevel(TkWindow *winPtr) } - declare 91 generic { - void TkWmMapWindow (TkWindow *winPtr) + void TkWmMapWindow(TkWindow *winPtr) } - declare 92 generic { - void TkWmNewWindow (TkWindow *winPtr) + void TkWmNewWindow(TkWindow *winPtr) } - declare 93 generic { - void TkWmProtocolEventProc (TkWindow *winPtr, XEvent *evenvPtr) + void TkWmProtocolEventProc(TkWindow *winPtr, XEvent *evenvPtr) } - declare 94 generic { - void TkWmRemoveFromColormapWindows (TkWindow *winPtr) + void TkWmRemoveFromColormapWindows(TkWindow *winPtr) } - declare 95 generic { - void TkWmRestackToplevel (TkWindow *winPtr, int aboveBelow, \ + void TkWmRestackToplevel(TkWindow *winPtr, int aboveBelow, TkWindow *otherPtr) } - declare 96 generic { - void TkWmSetClass (TkWindow *winPtr) + void TkWmSetClass(TkWindow *winPtr) } - declare 97 generic { - void TkWmUnmapWindow (TkWindow *winPtr) + void TkWmUnmapWindow(TkWindow *winPtr) } # new for 8.1 declare 98 generic { - Tcl_Obj * TkDebugBitmap ( Tk_Window tkwin, char *name) + Tcl_Obj *TkDebugBitmap(Tk_Window tkwin, char *name) } - declare 99 generic { - Tcl_Obj * TkDebugBorder ( Tk_Window tkwin, char *name) + Tcl_Obj *TkDebugBorder(Tk_Window tkwin, char *name) } - declare 100 generic { - Tcl_Obj * TkDebugCursor ( Tk_Window tkwin, char *name) + Tcl_Obj *TkDebugCursor(Tk_Window tkwin, char *name) } - declare 101 generic { - Tcl_Obj * TkDebugColor ( Tk_Window tkwin, char *name) + Tcl_Obj *TkDebugColor(Tk_Window tkwin, char *name) } - declare 102 generic { - Tcl_Obj * TkDebugConfig (Tcl_Interp *interp, Tk_OptionTable table) + Tcl_Obj *TkDebugConfig(Tcl_Interp *interp, Tk_OptionTable table) } - declare 103 generic { - Tcl_Obj * TkDebugFont ( Tk_Window tkwin, char *name) + Tcl_Obj *TkDebugFont(Tk_Window tkwin, char *name) } - declare 104 generic { - int TkFindStateNumObj (Tcl_Interp *interp, \ - Tcl_Obj *optionPtr, CONST TkStateMap *mapPtr, \ - Tcl_Obj *keyPtr) + int TkFindStateNumObj(Tcl_Interp *interp, Tcl_Obj *optionPtr, + CONST TkStateMap *mapPtr, Tcl_Obj *keyPtr) } - declare 105 generic { - Tcl_HashTable * TkGetBitmapPredefTable (void) + Tcl_HashTable *TkGetBitmapPredefTable(void) } - declare 106 generic { - TkDisplay * TkGetDisplayList (void) + TkDisplay *TkGetDisplayList(void) } - declare 107 generic { - TkMainInfo * TkGetMainInfoList (void) + TkMainInfo *TkGetMainInfoList(void) } - declare 108 generic { - int TkGetWindowFromObj (Tcl_Interp *interp, \ - Tk_Window tkwin, Tcl_Obj *objPtr, \ - Tk_Window *windowPtr) + int TkGetWindowFromObj(Tcl_Interp *interp, Tk_Window tkwin, + Tcl_Obj *objPtr, Tk_Window *windowPtr) } - declare 109 generic { - char * TkpGetString (TkWindow *winPtr, \ - XEvent *eventPtr, Tcl_DString *dsPtr) + char *TkpGetString(TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr) } - declare 110 generic { - void TkpGetSubFonts (Tcl_Interp *interp, Tk_Font tkfont) + void TkpGetSubFonts(Tcl_Interp *interp, Tk_Font tkfont) } - declare 111 generic { - Tcl_Obj * TkpGetSystemDefault (Tk_Window tkwin, \ + Tcl_Obj *TkpGetSystemDefault(Tk_Window tkwin, CONST char *dbName, CONST char *className) } - declare 112 generic { - void TkpMenuThreadInit (void) + void TkpMenuThreadInit(void) } - -declare 113 {aqua win} { - void TkClipBox (TkRegion rgn, XRectangle* rect_return) +declare 113 {aqua win} { + void TkClipBox(TkRegion rgn, XRectangle *rect_return) } - -declare 114 {aqua win} { - TkRegion TkCreateRegion (void) +declare 114 {aqua win} { + TkRegion TkCreateRegion(void) } - declare 115 {aqua win} { - void TkDestroyRegion (TkRegion rgn) + void TkDestroyRegion(TkRegion rgn) } - declare 116 {aqua win} { - void TkIntersectRegion (TkRegion sra, TkRegion srcb, TkRegion dr_return) + void TkIntersectRegion(TkRegion sra, TkRegion srcb, TkRegion dr_return) } - declare 117 {aqua win} { - int TkRectInRegion (TkRegion rgn, int x, int y, unsigned int width, \ + int TkRectInRegion(TkRegion rgn, int x, int y, unsigned int width, unsigned int height) } - declare 118 {aqua win} { - void TkSetRegion (Display* display, GC gc, TkRegion rgn) + void TkSetRegion(Display *display, GC gc, TkRegion rgn) } - declare 119 {aqua win} { - void TkUnionRectWithRegion (XRectangle* rect, \ + void TkUnionRectWithRegion(XRectangle *rect, TkRegion src, TkRegion dr_return) } - declare 121 {aqua} { - Pixmap TkpCreateNativeBitmap (Display *display, CONST char * source) + Pixmap TkpCreateNativeBitmap(Display *display, CONST char *source) } - declare 122 {aqua} { - void TkpDefineNativeBitmaps (void) + void TkpDefineNativeBitmaps(void) } - declare 124 {aqua} { - Pixmap TkpGetNativeAppBitmap (Display *display, \ + Pixmap TkpGetNativeAppBitmap(Display *display, CONST char *name, int *width, int *height) } - declare 135 generic { - void TkpDrawHighlightBorder (Tk_Window tkwin, GC fgGC, GC bgGC, \ + void TkpDrawHighlightBorder(Tk_Window tkwin, GC fgGC, GC bgGC, int highlightWidth, Drawable drawable) } - declare 136 generic { - void TkSetFocusWin (TkWindow *winPtr, int force) + void TkSetFocusWin(TkWindow *winPtr, int force) } - declare 137 generic { - void TkpSetKeycodeAndState (Tk_Window tkwin, KeySym keySym, \ + void TkpSetKeycodeAndState(Tk_Window tkwin, KeySym keySym, XEvent *eventPtr) } - declare 138 generic { - KeySym TkpGetKeySym (TkDisplay *dispPtr, XEvent *eventPtr) + KeySym TkpGetKeySym(TkDisplay *dispPtr, XEvent *eventPtr) } - declare 139 generic { - void TkpInitKeymapInfo (TkDisplay *dispPtr) + void TkpInitKeymapInfo(TkDisplay *dispPtr) } - declare 140 generic { - TkRegion TkPhotoGetValidRegion (Tk_PhotoHandle handle) + TkRegion TkPhotoGetValidRegion(Tk_PhotoHandle handle) } - declare 141 generic { - TkWindow ** TkWmStackorderToplevel(TkWindow *parentPtr) + TkWindow **TkWmStackorderToplevel(TkWindow *parentPtr) } - declare 142 generic { void TkFocusFree(TkMainInfo *mainPtr) } - declare 143 generic { void TkClipCleanup(TkDisplay *dispPtr) } - declare 144 generic { void TkGCCleanup(TkDisplay *dispPtr) } - declare 145 {win aqua} { - void TkSubtractRegion (TkRegion sra, TkRegion srcb, TkRegion dr_return) + void TkSubtractRegion(TkRegion sra, TkRegion srcb, TkRegion dr_return) } - declare 146 generic { - void TkStylePkgInit (TkMainInfo *mainPtr) + void TkStylePkgInit(TkMainInfo *mainPtr) } declare 147 generic { - void TkStylePkgFree (TkMainInfo *mainPtr) + void TkStylePkgFree(TkMainInfo *mainPtr) } - declare 148 generic { Tk_Window TkToplevelWindowForCommand(Tcl_Interp *interp, CONST char *cmdName) } - declare 149 generic { - CONST Tk_OptionSpec * TkGetOptionSpec (CONST char *name, + CONST Tk_OptionSpec *TkGetOptionSpec(CONST char *name, Tk_OptionTable optionTable) } # TIP#168 declare 150 generic { - int TkMakeRawCurve (Tk_Canvas canvas, - double *pointPtr, int numPoints, int numSteps, - XPoint xPoints[], double dblPoints[]) + int TkMakeRawCurve(Tk_Canvas canvas, double *pointPtr, int numPoints, + int numSteps, XPoint xPoints[], double dblPoints[]) } declare 151 generic { - void TkMakeRawCurvePostscript (Tcl_Interp *interp, + void TkMakeRawCurvePostscript(Tcl_Interp *interp, Tk_Canvas canvas, double *pointPtr, int numPoints) } declare 152 generic { void TkpDrawFrame(Tk_Window tkwin, Tk_3DBorder border, - int highlightWidth, int borderWidth, int relief) + int highlightWidth, int borderWidth, int relief) +} + +declare 153 generic { + void TkCreateThreadExitHandler(Tcl_ExitProc *proc, ClientData clientData) +} +declare 154 generic { + void TkDeleteThreadExitHandler(Tcl_ExitProc *proc, ClientData clientData) } ############################################################################## @@ -660,196 +521,151 @@ interface tkIntPlat # Unix specific functions declare 0 x11 { - void TkCreateXEventSource (void) + void TkCreateXEventSource(void) } - declare 1 x11 { - void TkFreeWindowId (TkDisplay *dispPtr, Window w) + void TkFreeWindowId(TkDisplay *dispPtr, Window w) } - declare 2 x11 { - void TkInitXId (TkDisplay *dispPtr) + void TkInitXId(TkDisplay *dispPtr) } - declare 3 x11 { - int TkpCmapStressed (Tk_Window tkwin, Colormap colormap) + int TkpCmapStressed(Tk_Window tkwin, Colormap colormap) } - declare 4 x11 { - void TkpSync (Display *display) + void TkpSync(Display *display) } - declare 5 x11 { - Window TkUnixContainerId (TkWindow *winPtr) + Window TkUnixContainerId(TkWindow *winPtr) } - declare 6 x11 { - int TkUnixDoOneXEvent (Tcl_Time *timePtr) + int TkUnixDoOneXEvent(Tcl_Time *timePtr) } - declare 7 x11 { - void TkUnixSetMenubar (Tk_Window tkwin, Tk_Window menubar) + void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar) } - declare 8 x11 { - int TkpScanWindowId (Tcl_Interp *interp, CONST char *string, Window *idPtr) + int TkpScanWindowId(Tcl_Interp *interp, CONST char *string, Window *idPtr) } - declare 9 x11 { - void TkWmCleanup (TkDisplay *dispPtr) + void TkWmCleanup(TkDisplay *dispPtr) } - declare 10 x11 { - void TkSendCleanup (TkDisplay *dispPtr) + void TkSendCleanup(TkDisplay *dispPtr) } - declare 11 x11 { - void TkFreeXId (TkDisplay *dispPtr) + void TkFreeXId(TkDisplay *dispPtr) } - declare 12 x11 { - int TkpWmSetState (TkWindow *winPtr, int state) + int TkpWmSetState(TkWindow *winPtr, int state) } ############################ # Windows specific functions declare 0 win { - char * TkAlignImageData (XImage *image, int alignment, int bitOrder) + char *TkAlignImageData(XImage *image, int alignment, int bitOrder) } - declare 2 win { - void TkGenerateActivateEvents (TkWindow *winPtr, int active) + void TkGenerateActivateEvents(TkWindow *winPtr, int active) } - declare 3 win { - unsigned long TkpGetMS (void) + unsigned long TkpGetMS(void) } - declare 4 win { - void TkPointerDeadWindow (TkWindow *winPtr) + void TkPointerDeadWindow(TkWindow *winPtr) } - declare 5 win { - void TkpPrintWindowId (char *buf, Window window) + void TkpPrintWindowId(char *buf, Window window) } - declare 6 win { - int TkpScanWindowId (Tcl_Interp *interp, CONST char *string, Window *idPtr) + int TkpScanWindowId(Tcl_Interp *interp, CONST char *string, Window *idPtr) } - declare 7 win { - void TkpSetCapture (TkWindow *winPtr) + void TkpSetCapture(TkWindow *winPtr) } - declare 8 win { - void TkpSetCursor (TkpCursor cursor) + void TkpSetCursor(TkpCursor cursor) } - declare 9 win { - void TkpWmSetState (TkWindow *winPtr, int state) + void TkpWmSetState(TkWindow *winPtr, int state) } - declare 10 win { - void TkSetPixmapColormap (Pixmap pixmap, Colormap colormap) + void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap) } - declare 11 win { - void TkWinCancelMouseTimer (void) + void TkWinCancelMouseTimer(void) } - declare 12 win { - void TkWinClipboardRender (TkDisplay *dispPtr, UINT format) + void TkWinClipboardRender(TkDisplay *dispPtr, UINT format) } - declare 13 win { - LRESULT TkWinEmbeddedEventProc (HWND hwnd, UINT message, \ + LRESULT TkWinEmbeddedEventProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) } - declare 14 win { - void TkWinFillRect (HDC dc, int x, int y, int width, int height, \ - int pixel) + void TkWinFillRect(HDC dc, int x, int y, int width, int height, int pixel) } - declare 15 win { - COLORREF TkWinGetBorderPixels (Tk_Window tkwin, Tk_3DBorder border, \ + COLORREF TkWinGetBorderPixels(Tk_Window tkwin, Tk_3DBorder border, int which) } - declare 16 win { - HDC TkWinGetDrawableDC (Display *display, Drawable d, TkWinDCState* state) + HDC TkWinGetDrawableDC(Display *display, Drawable d, TkWinDCState *state) } - declare 17 win { - int TkWinGetModifierState (void) + int TkWinGetModifierState(void) } - declare 18 win { - HPALETTE TkWinGetSystemPalette (void) + HPALETTE TkWinGetSystemPalette(void) } - declare 19 win { - HWND TkWinGetWrapperWindow (Tk_Window tkwin) + HWND TkWinGetWrapperWindow(Tk_Window tkwin) } - declare 20 win { - int TkWinHandleMenuEvent (HWND *phwnd, \ - UINT *pMessage, WPARAM *pwParam, LPARAM *plParam, \ - LRESULT *plResult) + int TkWinHandleMenuEvent(HWND *phwnd, UINT *pMessage, WPARAM *pwParam, + LPARAM *plParam, LRESULT *plResult) } - declare 21 win { - int TkWinIndexOfColor (XColor *colorPtr) + int TkWinIndexOfColor(XColor *colorPtr) } - declare 22 win { - void TkWinReleaseDrawableDC (Drawable d, HDC hdc, TkWinDCState* state) + void TkWinReleaseDrawableDC(Drawable d, HDC hdc, TkWinDCState *state) } - declare 23 win { - LRESULT TkWinResendEvent (WNDPROC wndproc, HWND hwnd, XEvent *eventPtr) + LRESULT TkWinResendEvent(WNDPROC wndproc, HWND hwnd, XEvent *eventPtr) } - declare 24 win { - HPALETTE TkWinSelectPalette (HDC dc, Colormap colormap) + HPALETTE TkWinSelectPalette(HDC dc, Colormap colormap) } - declare 25 win { - void TkWinSetMenu (Tk_Window tkwin, HMENU hMenu) + void TkWinSetMenu(Tk_Window tkwin, HMENU hMenu) } - declare 26 win { - void TkWinSetWindowPos (HWND hwnd, HWND siblingHwnd, int pos) + void TkWinSetWindowPos(HWND hwnd, HWND siblingHwnd, int pos) } - declare 27 win { - void TkWinWmCleanup (HINSTANCE hInstance) + void TkWinWmCleanup(HINSTANCE hInstance) } - declare 28 win { - void TkWinXCleanup (ClientData clientData) + void TkWinXCleanup(ClientData clientData) } - declare 29 win { - void TkWinXInit (HINSTANCE hInstance) + void TkWinXInit(HINSTANCE hInstance) } # new for 8.1 declare 30 win { - void TkWinSetForegroundWindow (TkWindow *winPtr) + void TkWinSetForegroundWindow(TkWindow *winPtr) } - declare 31 win { - void TkWinDialogDebug (int debug) + void TkWinDialogDebug(int debug) } - declare 32 win { - Tcl_Obj * TkWinGetMenuSystemDefault (Tk_Window tkwin, \ + Tcl_Obj *TkWinGetMenuSystemDefault(Tk_Window tkwin, CONST char *dbName, CONST char *className) } - declare 33 win { int TkWinGetPlatformId(void) } @@ -857,234 +673,192 @@ declare 33 win { # new for 8.4.1 declare 34 win { - void TkWinSetHINSTANCE (HINSTANCE hInstance) + void TkWinSetHINSTANCE(HINSTANCE hInstance) } - declare 35 win { - int TkWinGetPlatformTheme (void) + int TkWinGetPlatformTheme(void) } ######################## # Mac OS X specific functions declare 0 aqua { - void TkGenerateActivateEvents (TkWindow *winPtr, int active) + void TkGenerateActivateEvents(TkWindow *winPtr, int active) } # removed duplicates from tkInt table #declare 1 aqua { -# Pixmap TkpCreateNativeBitmap (Display *display, CONST char * source) +# Pixmap TkpCreateNativeBitmap(Display *display, CONST char *source) #} # #declare 2 aqua { -# void TkpDefineNativeBitmaps (void) +# void TkpDefineNativeBitmaps(void) #} declare 3 aqua { - void TkPointerDeadWindow (TkWindow *winPtr) + void TkPointerDeadWindow(TkWindow *winPtr) } - declare 4 aqua { - void TkpSetCapture (TkWindow *winPtr) + void TkpSetCapture(TkWindow *winPtr) } - declare 5 aqua { - void TkpSetCursor (TkpCursor cursor) + void TkpSetCursor(TkpCursor cursor) } - declare 6 aqua { - void TkpWmSetState (TkWindow *winPtr, int state) + void TkpWmSetState(TkWindow *winPtr, int state) } - declare 7 aqua { - void TkAboutDlg (void) + void TkAboutDlg(void) } - declare 8 aqua { - unsigned int TkMacOSXButtonKeyState (void) + unsigned int TkMacOSXButtonKeyState(void) } - declare 9 aqua { - void TkMacOSXClearMenubarActive (void) + void TkMacOSXClearMenubarActive(void) } - declare 10 aqua { - int TkMacOSXDispatchMenuEvent (int menuID, int index) + int TkMacOSXDispatchMenuEvent(int menuID, int index) } - declare 11 aqua { - void TkMacOSXInstallCursor (int resizeOverride) + void TkMacOSXInstallCursor(int resizeOverride) } - declare 12 aqua { - void TkMacOSXHandleTearoffMenu (void) + void TkMacOSXHandleTearoffMenu(void) } -# removed duplicate from tkPlat table (tk.decls) +# removed duplicate from tkPlat table(tk.decls) #declare 13 aqua { -# void TkMacOSXInvalClipRgns (TkWindow *winPtr) +# void TkMacOSXInvalClipRgns(TkWindow *winPtr) #} declare 14 aqua { - int TkMacOSXDoHLEvent (EventRecord *theEvent) + int TkMacOSXDoHLEvent(EventRecord *theEvent) } -# removed duplicate from tkPlat table (tk.decls) +# removed duplicate from tkPlat table(tk.decls) #declare 15 aqua { -# GWorldPtr TkMacOSXGetDrawablePort (Drawable drawable) +# GWorldPtr TkMacOSXGetDrawablePort(Drawable drawable) #} declare 16 aqua { - Window TkMacOSXGetXWindow (WindowRef macWinPtr) + Window TkMacOSXGetXWindow(WindowRef macWinPtr) } - declare 17 aqua { - int TkMacOSXGrowToplevel (WindowRef whichWindow, Point start) + int TkMacOSXGrowToplevel(WindowRef whichWindow, Point start) } - declare 18 aqua { - void TkMacOSXHandleMenuSelect (long mResult, int optionKeyPressed) + void TkMacOSXHandleMenuSelect(long mResult, int optionKeyPressed) } -# removed duplicates from tkPlat table (tk.decls) +# removed duplicates from tkPlat table(tk.decls) #declare 19 aqua { -# void TkMacOSXInitAppleEvents (Tcl_Interp *interp) +# void TkMacOSXInitAppleEvents(Tcl_Interp *interp) #} # #declare 20 aqua { -# void TkMacOSXInitMenus (Tcl_Interp *interp) +# void TkMacOSXInitMenus(Tcl_Interp *interp) #} declare 21 aqua { - void TkMacOSXInvalidateWindow (MacDrawable *macWin, int flag) + void TkMacOSXInvalidateWindow(MacDrawable *macWin, int flag) } - declare 22 aqua { - int TkMacOSXIsCharacterMissing (Tk_Font tkfont, unsigned int searchChar) + int TkMacOSXIsCharacterMissing(Tk_Font tkfont, unsigned int searchChar) } - declare 23 aqua { - void TkMacOSXMakeRealWindowExist (TkWindow *winPtr) + void TkMacOSXMakeRealWindowExist(TkWindow *winPtr) } - declare 24 aqua { BitMapPtr TkMacOSXMakeStippleMap(Drawable d1, Drawable d2) } - declare 25 aqua { - void TkMacOSXMenuClick (void) + void TkMacOSXMenuClick(void) } - declare 26 aqua { - void TkMacOSXRegisterOffScreenWindow (Window window, GWorldPtr portPtr) + void TkMacOSXRegisterOffScreenWindow(Window window, GWorldPtr portPtr) } - declare 27 aqua { - int TkMacOSXResizable (TkWindow *winPtr) + int TkMacOSXResizable(TkWindow *winPtr) } - declare 28 aqua { - void TkMacOSXSetHelpMenuItemCount (void) + void TkMacOSXSetHelpMenuItemCount(void) } - declare 29 aqua { - void TkMacOSXSetScrollbarGrow (TkWindow *winPtr, int flag) + void TkMacOSXSetScrollbarGrow(TkWindow *winPtr, int flag) } - declare 30 aqua { - void TkMacOSXSetUpClippingRgn (Drawable drawable) + void TkMacOSXSetUpClippingRgn(Drawable drawable) } - declare 31 aqua { - void TkMacOSXSetUpGraphicsPort (GC gc, GWorldPtr destPort) + void TkMacOSXSetUpGraphicsPort(GC gc, GWorldPtr destPort) } - declare 32 aqua { - void TkMacOSXUpdateClipRgn (TkWindow *winPtr) + void TkMacOSXUpdateClipRgn(TkWindow *winPtr) } - declare 33 aqua { - void TkMacOSXUnregisterMacWindow (WindowRef portPtr) + void TkMacOSXUnregisterMacWindow(WindowRef portPtr) } - declare 34 aqua { - int TkMacOSXUseMenuID (short macID) + int TkMacOSXUseMenuID(short macID) } - declare 35 aqua { - RgnHandle TkMacOSXVisableClipRgn (TkWindow *winPtr) + RgnHandle TkMacOSXVisableClipRgn(TkWindow *winPtr) } - declare 36 aqua { - void TkMacOSXWinBounds (TkWindow *winPtr, Rect *geometry) + void TkMacOSXWinBounds(TkWindow *winPtr, Rect *geometry) } - declare 37 aqua { - void TkMacOSXWindowOffset (WindowRef wRef, int *xOffset, int *yOffset) + void TkMacOSXWindowOffset(WindowRef wRef, int *xOffset, int *yOffset) } - declare 38 aqua { - int TkSetMacColor (unsigned long pixel, RGBColor *macColor) + int TkSetMacColor(unsigned long pixel, RGBColor *macColor) } - declare 39 aqua { - void TkSetWMName (TkWindow *winPtr, Tk_Uid titleUid) + void TkSetWMName(TkWindow *winPtr, Tk_Uid titleUid) } - declare 40 aqua { - void TkSuspendClipboard (void) + void TkSuspendClipboard(void) } - declare 41 aqua { - int TkMacOSXZoomToplevel (WindowPtr whichWindow, short zoomPart) + int TkMacOSXZoomToplevel(WindowPtr whichWindow, short zoomPart) } - declare 42 aqua { - Tk_Window Tk_TopCoordsToWindow (Tk_Window tkwin, \ - int rootX, int rootY, int *newX, int *newY) + Tk_Window Tk_TopCoordsToWindow(Tk_Window tkwin, int rootX, int rootY, + int *newX, int *newY) } - declare 43 aqua { - MacDrawable * TkMacOSXContainerId (TkWindow *winPtr) + MacDrawable *TkMacOSXContainerId(TkWindow *winPtr) } - declare 44 aqua { - MacDrawable * TkMacOSXGetHostToplevel (TkWindow *winPtr) + MacDrawable *TkMacOSXGetHostToplevel(TkWindow *winPtr) } - declare 45 aqua { - void TkMacOSXPreprocessMenu (void) + void TkMacOSXPreprocessMenu(void) } - declare 46 aqua { - int TkpIsWindowFloating (WindowRef window) + int TkpIsWindowFloating(WindowRef window) } - declare 47 aqua { - Tk_Window TkMacOSXGetCapture (void) + Tk_Window TkMacOSXGetCapture(void) } - declare 49 aqua { - Window TkGetTransientMaster (TkWindow *winPtr) + Window TkGetTransientMaster(TkWindow *winPtr) } - declare 50 aqua { - int TkGenerateButtonEvent (int x, int y, \ - Window window, unsigned int state) + int TkGenerateButtonEvent(int x, int y, Window window, unsigned int state) } - declare 51 aqua { - void TkGenWMDestroyEvent (Tk_Window tkwin) + void TkGenWMDestroyEvent(Tk_Window tkwin) } # removed duplicate from tkPlat table (tk.decls) #declare 52 aqua { -# void TkGenWMConfigureEvent (Tk_Window tkwin, int x, int y, \ +# void TkGenWMConfigureEvent(Tk_Window tkwin, int x, int y, # int width, int height, int flags) #} declare 53 aqua { - unsigned long TkpGetMS (void) + unsigned long TkpGetMS(void) } ############################################################################## @@ -1097,893 +871,693 @@ interface tkIntXlib # X functions for Windows declare 0 win { - void XSetDashes (Display* display, GC gc, int dash_offset, - _Xconst char* dash_list, int n) + void XSetDashes(Display *display, GC gc, int dash_offset, + _Xconst char *dash_list, int n) } - declare 1 win { - XModifierKeymap* XGetModifierMapping (Display* d) + XModifierKeymap *XGetModifierMapping(Display *d) } - declare 2 win { - XImage * XCreateImage (Display* d, Visual* v, unsigned int ui1, int i1, \ - int i2, char* cp, unsigned int ui2, unsigned int ui3, int i3, \ + XImage *XCreateImage(Display *d, Visual *v, unsigned int ui1, int i1, + int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4) - } - declare 3 win { - XImage *XGetImage (Display* d, Drawable dr, int i1, int i2, \ + XImage *XGetImage(Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3) } - declare 4 win { - char *XGetAtomName (Display* d,Atom a) - + char *XGetAtomName(Display *d, Atom a) } - declare 5 win { - char *XKeysymToString (KeySym k) + char *XKeysymToString(KeySym k) } - declare 6 win { - Colormap XCreateColormap (Display* d, Window w, Visual* v, int i) - + Colormap XCreateColormap(Display *d, Window w, Visual *v, int i) } - declare 7 win { - Cursor XCreatePixmapCursor (Display* d, Pixmap p1, Pixmap p2, \ - XColor* x1, XColor* x2, \ - unsigned int ui1, unsigned int ui2) + Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2, + XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2) } - declare 8 win { - Cursor XCreateGlyphCursor (Display* d, Font f1, Font f2, \ - unsigned int ui1, unsigned int ui2, XColor* x1, XColor* x2) + Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, + unsigned int ui1, unsigned int ui2, XColor *x1, XColor *x2) } - declare 9 win { - GContext XGContextFromGC (GC g) + GContext XGContextFromGC(GC g) } - declare 10 win { - XHostAddress *XListHosts (Display* d, int* i, Bool* b) + XHostAddress *XListHosts(Display *d, int *i, Bool *b) } # second parameter was of type KeyCode declare 11 win { - KeySym XKeycodeToKeysym (Display* d, unsigned int k, int i) + KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i) } declare 12 win { - KeySym XStringToKeysym (_Xconst char* c) + KeySym XStringToKeysym(_Xconst char *c) } - declare 13 win { - Window XRootWindow (Display* d, int i) + Window XRootWindow(Display *d, int i) } - declare 14 win { - XErrorHandler XSetErrorHandler (XErrorHandler x) + XErrorHandler XSetErrorHandler(XErrorHandler x) } - declare 15 win { - Status XIconifyWindow (Display* d, Window w, int i) + Status XIconifyWindow(Display *d, Window w, int i) } - declare 16 win { - Status XWithdrawWindow (Display* d, Window w, int i) + Status XWithdrawWindow(Display *d, Window w, int i) } - declare 17 win { - Status XGetWMColormapWindows (Display* d, Window w, Window** wpp, int* ip) + Status XGetWMColormapWindows(Display *d, Window w, Window **wpp, int *ip) } - declare 18 win { - Status XAllocColor (Display* d, Colormap c, XColor* xp) + Status XAllocColor(Display *d, Colormap c, XColor *xp) } - declare 19 win { - void XBell (Display* d, int i) + void XBell(Display *d, int i) } - declare 20 win { - void XChangeProperty (Display* d, Window w, Atom a1, Atom a2, int i1, \ - int i2, _Xconst unsigned char* c, int i3) + void XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, + int i2, _Xconst unsigned char *c, int i3) } - declare 21 win { - void XChangeWindowAttributes (Display* d, Window w, unsigned long ul, \ - XSetWindowAttributes* x) + void XChangeWindowAttributes(Display *d, Window w, unsigned long ul, + XSetWindowAttributes *x) } - declare 22 win { - void XClearWindow (Display* d, Window w) + void XClearWindow(Display *d, Window w) } - declare 23 win { - void XConfigureWindow (Display* d, Window w, unsigned int i, \ - XWindowChanges* x) + void XConfigureWindow(Display *d, Window w, unsigned int i, + XWindowChanges *x) } - declare 24 win { - void XCopyArea (Display* d, Drawable dr1, Drawable dr2, GC g, int i1, \ - int i2, unsigned int ui1, \ - unsigned int ui2, int i3, int i4) + void XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, + int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } - declare 25 win { - void XCopyPlane (Display* d, Drawable dr1, Drawable dr2, GC g, int i1, \ - int i2, unsigned int ui1, \ + void XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, + int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul) } - declare 26 win { - Pixmap XCreateBitmapFromData(Display* display, Drawable d, \ - _Xconst char* data, unsigned int width,unsigned int height) + Pixmap XCreateBitmapFromData(Display *display, Drawable d, + _Xconst char *data, unsigned int width, unsigned int height) } - declare 27 win { - void XDefineCursor (Display* d, Window w, Cursor c) + void XDefineCursor(Display *d, Window w, Cursor c) } - declare 28 win { - void XDeleteProperty (Display* d, Window w, Atom a) + void XDeleteProperty(Display *d, Window w, Atom a) } - declare 29 win { - void XDestroyWindow (Display* d, Window w) + void XDestroyWindow(Display *d, Window w) } - declare 30 win { - void XDrawArc (Display* d, Drawable dr, GC g, int i1, int i2, \ + void XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } - declare 31 win { - void XDrawLines (Display* d, Drawable dr, GC g, XPoint* x, int i1, int i2) + void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) } - declare 32 win { - void XDrawRectangle (Display* d, Drawable dr, GC g, int i1, int i2,\ + void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2) } - declare 33 win { - void XFillArc (Display* d, Drawable dr, GC g, int i1, int i2, \ + void XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } - declare 34 win { - void XFillPolygon (Display* d, Drawable dr, GC g, XPoint* x, \ + void XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3) } - declare 35 win { - void XFillRectangles (Display* d, Drawable dr, GC g, XRectangle* x, int i) + void XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) } - declare 36 win { - void XForceScreenSaver (Display* d, int i) + void XForceScreenSaver(Display *d, int i) } - declare 37 win { - void XFreeColormap (Display* d, Colormap c) + void XFreeColormap(Display *d, Colormap c) } - declare 38 win { - void XFreeColors (Display* d, Colormap c, \ - unsigned long* ulp, int i, unsigned long ul) + void XFreeColors(Display *d, Colormap c, + unsigned long *ulp, int i, unsigned long ul) } - declare 39 win { - void XFreeCursor (Display* d, Cursor c) + void XFreeCursor(Display *d, Cursor c) } - declare 40 win { - void XFreeModifiermap (XModifierKeymap* x) + void XFreeModifiermap(XModifierKeymap *x) } - declare 41 win { - Status XGetGeometry (Display* d, Drawable dr, Window* w, int* i1, \ - int* i2, unsigned int* ui1, unsigned int* ui2, unsigned int* ui3, \ - unsigned int* ui4) + Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, + int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, + unsigned int *ui4) } - declare 42 win { - void XGetInputFocus (Display* d, Window* w, int* i) + void XGetInputFocus(Display *d, Window *w, int *i) } - declare 43 win { - int XGetWindowProperty (Display* d, Window w, Atom a1, long l1, long l2, \ - Bool b, Atom a2, Atom* ap, int* ip, unsigned long* ulp1, \ - unsigned long* ulp2, unsigned char** cpp) + int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2, + Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, + unsigned long *ulp2, unsigned char **cpp) } - declare 44 win { - Status XGetWindowAttributes (Display* d, Window w, XWindowAttributes* x) + Status XGetWindowAttributes(Display *d, Window w, XWindowAttributes *x) } - declare 45 win { - int XGrabKeyboard (Display* d, Window w, Bool b, int i1, int i2, Time t) + int XGrabKeyboard(Display *d, Window w, Bool b, int i1, int i2, Time t) } - declare 46 win { - int XGrabPointer (Display* d, Window w1, Bool b, unsigned int ui, \ + int XGrabPointer(Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t) } - declare 47 win { - KeyCode XKeysymToKeycode (Display* d, KeySym k) + KeyCode XKeysymToKeycode(Display *d, KeySym k) } - declare 48 win { - Status XLookupColor (Display* d, Colormap c1, _Xconst char* c2, \ - XColor* x1, XColor* x2) + Status XLookupColor(Display *d, Colormap c1, _Xconst char *c2, + XColor *x1, XColor *x2) } - declare 49 win { - void XMapWindow (Display* d, Window w) + void XMapWindow(Display *d, Window w) } - declare 50 win { - void XMoveResizeWindow (Display* d, Window w, int i1, int i2, \ + void XMoveResizeWindow(Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2) } - declare 51 win { - void XMoveWindow (Display* d, Window w, int i1, int i2) + void XMoveWindow(Display *d, Window w, int i1, int i2) } - declare 52 win { - void XNextEvent (Display* d, XEvent* x) + void XNextEvent(Display *d, XEvent *x) } - declare 53 win { - void XPutBackEvent (Display* d, XEvent* x) + void XPutBackEvent(Display *d, XEvent *x) } - declare 54 win { - void XQueryColors (Display* d, Colormap c, XColor* x, int i) + void XQueryColors(Display *d, Colormap c, XColor *x, int i) } - declare 55 win { - Bool XQueryPointer (Display* d, Window w1, Window* w2, Window* w3, \ - int* i1, int* i2, int* i3, int* i4, unsigned int* ui) + Bool XQueryPointer(Display *d, Window w1, Window *w2, Window *w3, + int *i1, int *i2, int *i3, int *i4, unsigned int *ui) } - declare 56 win { - Status XQueryTree (Display* d, Window w1, Window* w2, Window* w3, \ - Window** w4, unsigned int* ui) + Status XQueryTree(Display *d, Window w1, Window *w2, Window *w3, + Window **w4, unsigned int *ui) } - declare 57 win { - void XRaiseWindow (Display* d, Window w) + void XRaiseWindow(Display *d, Window w) } - declare 58 win { - void XRefreshKeyboardMapping (XMappingEvent* x) + void XRefreshKeyboardMapping(XMappingEvent *x) } - declare 59 win { - void XResizeWindow (Display* d, Window w, unsigned int ui1, \ + void XResizeWindow(Display *d, Window w, unsigned int ui1, unsigned int ui2) } - declare 60 win { - void XSelectInput (Display* d, Window w, long l) + void XSelectInput(Display *d, Window w, long l) } - declare 61 win { - Status XSendEvent (Display* d, Window w, Bool b, long l, XEvent* x) + Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x) } - declare 62 win { - void XSetCommand (Display* d, Window w, CONST char** c, int i) + void XSetCommand(Display *d, Window w, CONST char **c, int i) } - declare 63 win { - void XSetIconName (Display* d, Window w, _Xconst char* c) + void XSetIconName(Display *d, Window w, _Xconst char *c) } - declare 64 win { - void XSetInputFocus (Display* d, Window w, int i, Time t) + void XSetInputFocus(Display *d, Window w, int i, Time t) } - declare 65 win { - void XSetSelectionOwner (Display* d, Atom a, Window w, Time t) + void XSetSelectionOwner(Display *d, Atom a, Window w, Time t) } - declare 66 win { - void XSetWindowBackground (Display* d, Window w, unsigned long ul) + void XSetWindowBackground(Display *d, Window w, unsigned long ul) } - declare 67 win { - void XSetWindowBackgroundPixmap (Display* d, Window w, Pixmap p) + void XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p) } - declare 68 win { - void XSetWindowBorder (Display* d, Window w, unsigned long ul) + void XSetWindowBorder(Display *d, Window w, unsigned long ul) } - declare 69 win { - void XSetWindowBorderPixmap (Display* d, Window w, Pixmap p) + void XSetWindowBorderPixmap(Display *d, Window w, Pixmap p) } - declare 70 win { - void XSetWindowBorderWidth (Display* d, Window w, unsigned int ui) + void XSetWindowBorderWidth(Display *d, Window w, unsigned int ui) } - declare 71 win { - void XSetWindowColormap (Display* d, Window w, Colormap c) + void XSetWindowColormap(Display *d, Window w, Colormap c) } - declare 72 win { - Bool XTranslateCoordinates (Display* d, Window w1, Window w2, int i1,\ - int i2, int* i3, int* i4, Window* w3) + Bool XTranslateCoordinates(Display *d, Window w1, Window w2, int i1, + int i2, int *i3, int *i4, Window *w3) } - declare 73 win { - void XUngrabKeyboard (Display* d, Time t) + void XUngrabKeyboard(Display *d, Time t) } - declare 74 win { - void XUngrabPointer (Display* d, Time t) + void XUngrabPointer(Display *d, Time t) } - declare 75 win { - void XUnmapWindow (Display* d, Window w) + void XUnmapWindow(Display *d, Window w) } - declare 76 win { - void XWindowEvent (Display* d, Window w, long l, XEvent* x) + void XWindowEvent(Display *d, Window w, long l, XEvent *x) } - declare 77 win { - void XDestroyIC (XIC x) + void XDestroyIC(XIC x) } - declare 78 win { - Bool XFilterEvent (XEvent* x, Window w) + Bool XFilterEvent(XEvent *x, Window w) } - declare 79 win { - int XmbLookupString (XIC xi, XKeyPressedEvent* xk, \ - char* c, int i, KeySym* k, Status* s) + int XmbLookupString(XIC xi, XKeyPressedEvent *xk, char *c, int i, + KeySym *k, Status *s) } - declare 80 win { - void TkPutImage (unsigned long *colors, \ - int ncolors, Display* display, Drawable d, \ - GC gc, XImage* image, int src_x, int src_y, \ - int dest_x, int dest_y, unsigned int width, \ - unsigned int height) + void TkPutImage(unsigned long *colors, int ncolors, Display *display, + Drawable d, GC gc, XImage *image, int src_x, int src_y, + int dest_x, int dest_y, unsigned int width, unsigned int height) } # This slot is reserved for use by the clipping rectangle patch: # declare 81 win { -# XSetClipRectangles(Display *display, GC gc, int clip_x_origin, \ +# XSetClipRectangles(Display *display, GC gc, int clip_x_origin, # int clip_y_origin, XRectangle rectangles[], int n, int ordering) # } declare 82 win { - Status XParseColor (Display *display, Colormap map, \ - _Xconst char* spec, XColor *colorPtr) + Status XParseColor(Display *display, Colormap map, + _Xconst char *spec, XColor *colorPtr) } - declare 83 win { - GC XCreateGC(Display* display, Drawable d, \ - unsigned long valuemask, XGCValues* values) + GC XCreateGC(Display *display, Drawable d, + unsigned long valuemask, XGCValues *values) } - declare 84 win { - void XFreeGC(Display* display, GC gc) + void XFreeGC(Display *display, GC gc) } - declare 85 win { - Atom XInternAtom(Display* display,_Xconst char* atom_name, \ + Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists) } - declare 86 win { - void XSetBackground(Display* display, GC gc, \ - unsigned long foreground) + void XSetBackground(Display *display, GC gc, unsigned long foreground) } - declare 87 win { - void XSetForeground(Display* display, GC gc, \ - unsigned long foreground) + void XSetForeground(Display *display, GC gc, unsigned long foreground) } - declare 88 win { - void XSetClipMask(Display* display, GC gc, Pixmap pixmap) + void XSetClipMask(Display *display, GC gc, Pixmap pixmap) } - declare 89 win { - void XSetClipOrigin(Display* display, GC gc, \ + void XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin) } - declare 90 win { - void XSetTSOrigin(Display* display, GC gc, \ + void XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin) } - declare 91 win { - void XChangeGC(Display * d, GC gc, unsigned long mask, XGCValues *values) + void XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) } - declare 92 win { void XSetFont(Display *display, GC gc, Font font) } - declare 93 win { void XSetArcMode(Display *display, GC gc, int arc_mode) } - declare 94 win { void XSetStipple(Display *display, GC gc, Pixmap stipple) } - declare 95 win { void XSetFillRule(Display *display, GC gc, int fill_rule) } - declare 96 win { void XSetFillStyle(Display *display, GC gc, int fill_style) } - declare 97 win { void XSetFunction(Display *display, GC gc, int function) } - declare 98 win { - void XSetLineAttributes(Display *display, GC gc, \ - unsigned int line_width, int line_style, \ - int cap_style, int join_style) + void XSetLineAttributes(Display *display, GC gc, unsigned int line_width, + int line_style, int cap_style, int join_style) } - declare 99 win { int _XInitImageFuncPtrs(XImage *image) } - declare 100 win { XIC XCreateIC(void) } - declare 101 win { - XVisualInfo *XGetVisualInfo(Display* display, long vinfo_mask, \ - XVisualInfo* vinfo_template, int* nitems_return) + XVisualInfo *XGetVisualInfo(Display *display, long vinfo_mask, + XVisualInfo *vinfo_template, int *nitems_return) } - declare 102 win { - void XSetWMClientMachine(Display* display, Window w, XTextProperty* text_prop) + void XSetWMClientMachine(Display *display, Window w, + XTextProperty *text_prop) } - declare 103 win { - Status XStringListToTextProperty(char** list, int count, \ - XTextProperty* text_prop_return) + Status XStringListToTextProperty(char **list, int count, + XTextProperty *text_prop_return) } declare 104 win { - void XDrawLine (Display* d, Drawable dr, GC g, int x1, int y1, \ + void XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2) } declare 106 win { - void XFillRectangle (Display* display, Drawable d, GC gc, \ + void XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height) } declare 105 win { - void XWarpPointer (Display* d, Window s, Window dw, int sx, int sy, \ + void XWarpPointer(Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy) } # X functions for Aqua declare 0 {aqua} { - void XSetDashes (Display* display, GC gc, int dash_offset, - _Xconst char* dash_list, int n) + void XSetDashes(Display *display, GC gc, int dash_offset, + _Xconst char *dash_list, int n) } - declare 1 {aqua} { - XModifierKeymap* XGetModifierMapping (Display* d) + XModifierKeymap *XGetModifierMapping(Display *d) } - declare 2 {aqua} { - XImage * XCreateImage (Display* d, Visual* v, unsigned int ui1, int i1, \ - int i2, char* cp, unsigned int ui2, unsigned int ui3, int i3, \ + XImage *XCreateImage(Display *d, Visual *v, unsigned int ui1, int i1, + int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4) - } - declare 3 {aqua} { - XImage *XGetImage (Display* d, Drawable dr, int i1, int i2, \ + XImage *XGetImage(Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3) } - declare 4 {aqua} { - char *XGetAtomName (Display* d,Atom a) - + char *XGetAtomName(Display *d, Atom a) } - declare 5 {aqua} { - char *XKeysymToString (KeySym k) + char *XKeysymToString(KeySym k) } - declare 6 {aqua} { - Colormap XCreateColormap (Display* d, Window w, Visual* v, int i) - + Colormap XCreateColormap(Display *d, Window w, Visual *v, int i) } - declare 7 {aqua} { - GContext XGContextFromGC (GC g) + GContext XGContextFromGC(GC g) } - declare 8 {aqua} { - KeySym XKeycodeToKeysym (Display* d, KeyCode k, int i) + KeySym XKeycodeToKeysym(Display *d, KeyCode k, int i) } - declare 9 {aqua} { - KeySym XStringToKeysym (_Xconst char* c) + KeySym XStringToKeysym(_Xconst char *c) } - declare 10 {aqua} { - Window XRootWindow (Display* d, int i) + Window XRootWindow(Display *d, int i) } - declare 11 {aqua} { - XErrorHandler XSetErrorHandler (XErrorHandler x) + XErrorHandler XSetErrorHandler(XErrorHandler x) } - declare 12 {aqua} { - Status XAllocColor (Display* d, Colormap c, XColor* xp) + Status XAllocColor(Display *d, Colormap c, XColor *xp) } - declare 13 {aqua} { - void XBell (Display* d, int i) + void XBell(Display *d, int i) } - declare 14 {aqua} { - void XChangeProperty (Display* d, Window w, Atom a1, Atom a2, int i1, \ - int i2, _Xconst unsigned char* c, int i3) + void XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, + int i2, _Xconst unsigned char *c, int i3) } - declare 15 {aqua} { - void XChangeWindowAttributes (Display* d, Window w, unsigned long ul, \ - XSetWindowAttributes* x) + void XChangeWindowAttributes(Display *d, Window w, unsigned long ul, + XSetWindowAttributes *x) } - declare 16 {aqua} { - void XConfigureWindow (Display* d, Window w, unsigned int i, \ - XWindowChanges* x) + void XConfigureWindow(Display *d, Window w, unsigned int i, + XWindowChanges *x) } - declare 17 {aqua} { - void XCopyArea (Display* d, Drawable dr1, Drawable dr2, GC g, int i1, \ - int i2, unsigned int ui1, \ - unsigned int ui2, int i3, int i4) + void XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, + int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } - declare 18 {aqua} { - void XCopyPlane (Display* d, Drawable dr1, Drawable dr2, GC g, int i1, \ - int i2, unsigned int ui1, \ + void XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, + int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul) } - declare 19 {aqua} { - Pixmap XCreateBitmapFromData(Display* display, Drawable d, \ - _Xconst char* data, unsigned int width,unsigned int height) + Pixmap XCreateBitmapFromData(Display *display, Drawable d, + _Xconst char *data, unsigned int width, unsigned int height) } - declare 20 {aqua} { - void XDefineCursor (Display* d, Window w, Cursor c) + void XDefineCursor(Display *d, Window w, Cursor c) } - declare 21 {aqua} { - void XDestroyWindow (Display* d, Window w) + void XDestroyWindow(Display *d, Window w) } - declare 22 {aqua} { - void XDrawArc (Display* d, Drawable dr, GC g, int i1, int i2, \ + void XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } - declare 23 {aqua} { - void XDrawLines (Display* d, Drawable dr, GC g, XPoint* x, int i1, int i2) + void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) } - declare 24 {aqua} { - void XDrawRectangle (Display* d, Drawable dr, GC g, int i1, int i2,\ + void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2) } - declare 25 {aqua} { - void XFillArc (Display* d, Drawable dr, GC g, int i1, int i2, \ + void XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } - declare 26 {aqua} { - void XFillPolygon (Display* d, Drawable dr, GC g, XPoint* x, \ + void XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3) } - declare 27 {aqua} { - void XFillRectangles (Display* d, Drawable dr, GC g, XRectangle* x, int i) + void XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) } - declare 28 {aqua} { - void XFreeColormap (Display* d, Colormap c) + void XFreeColormap(Display *d, Colormap c) } - declare 29 {aqua} { - void XFreeColors (Display* d, Colormap c, \ - unsigned long* ulp, int i, unsigned long ul) + void XFreeColors(Display *d, Colormap c, + unsigned long *ulp, int i, unsigned long ul) } - declare 30 {aqua} { - void XFreeModifiermap (XModifierKeymap* x) + void XFreeModifiermap(XModifierKeymap *x) } - declare 31 {aqua} { - Status XGetGeometry (Display* d, Drawable dr, Window* w, int* i1, \ - int* i2, unsigned int* ui1, unsigned int* ui2, unsigned int* ui3, \ - unsigned int* ui4) + Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, + int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, + unsigned int *ui4) } - declare 32 {aqua} { - int XGetWindowProperty (Display* d, Window w, Atom a1, long l1, long l2, \ - Bool b, Atom a2, Atom* ap, int* ip, unsigned long* ulp1, \ - unsigned long* ulp2, unsigned char** cpp) + int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2, + Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, + unsigned long *ulp2, unsigned char **cpp) } - declare 33 {aqua} { - int XGrabKeyboard (Display* d, Window w, Bool b, int i1, int i2, Time t) + int XGrabKeyboard(Display *d, Window w, Bool b, int i1, int i2, Time t) } - declare 34 {aqua} { - int XGrabPointer (Display* d, Window w1, Bool b, unsigned int ui, \ + int XGrabPointer(Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t) } - declare 35 {aqua} { - KeyCode XKeysymToKeycode (Display* d, KeySym k) + KeyCode XKeysymToKeycode(Display *d, KeySym k) } - declare 36 {aqua} { - void XMapWindow (Display* d, Window w) + void XMapWindow(Display *d, Window w) } - declare 37 {aqua} { - void XMoveResizeWindow (Display* d, Window w, int i1, int i2, \ + void XMoveResizeWindow(Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2) } - declare 38 {aqua} { - void XMoveWindow (Display* d, Window w, int i1, int i2) + void XMoveWindow(Display *d, Window w, int i1, int i2) } - declare 39 {aqua} { - Bool XQueryPointer (Display* d, Window w1, Window* w2, Window* w3, \ - int* i1, int* i2, int* i3, int* i4, unsigned int* ui) + Bool XQueryPointer(Display *d, Window w1, Window *w2, Window *w3, + int *i1, int *i2, int *i3, int *i4, unsigned int *ui) } - declare 40 {aqua} { - void XRaiseWindow (Display* d, Window w) + void XRaiseWindow(Display *d, Window w) } - declare 41 {aqua} { - void XRefreshKeyboardMapping (XMappingEvent* x) + void XRefreshKeyboardMapping(XMappingEvent *x) } - declare 42 {aqua} { - void XResizeWindow (Display* d, Window w, unsigned int ui1, \ + void XResizeWindow(Display *d, Window w, unsigned int ui1, unsigned int ui2) } - declare 43 {aqua} { - void XSelectInput (Display* d, Window w, long l) + void XSelectInput(Display *d, Window w, long l) } - declare 44 {aqua} { - Status XSendEvent (Display* d, Window w, Bool b, long l, XEvent* x) + Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x) } - declare 45 {aqua} { - void XSetIconName (Display* d, Window w, _Xconst char* c) + void XSetIconName(Display *d, Window w, _Xconst char *c) } - declare 46 {aqua} { - void XSetInputFocus (Display* d, Window w, int i, Time t) + void XSetInputFocus(Display *d, Window w, int i, Time t) } - declare 47 {aqua} { - void XSetSelectionOwner (Display* d, Atom a, Window w, Time t) + void XSetSelectionOwner(Display *d, Atom a, Window w, Time t) } - declare 48 {aqua} { - void XSetWindowBackground (Display* d, Window w, unsigned long ul) + void XSetWindowBackground(Display *d, Window w, unsigned long ul) } - declare 49 {aqua} { - void XSetWindowBackgroundPixmap (Display* d, Window w, Pixmap p) + void XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p) } - declare 50 {aqua} { - void XSetWindowBorder (Display* d, Window w, unsigned long ul) + void XSetWindowBorder(Display *d, Window w, unsigned long ul) } - declare 51 {aqua} { - void XSetWindowBorderPixmap (Display* d, Window w, Pixmap p) + void XSetWindowBorderPixmap(Display *d, Window w, Pixmap p) } - declare 52 {aqua} { - void XSetWindowBorderWidth (Display* d, Window w, unsigned int ui) + void XSetWindowBorderWidth(Display *d, Window w, unsigned int ui) } - declare 53 {aqua} { - void XSetWindowColormap (Display* d, Window w, Colormap c) + void XSetWindowColormap(Display *d, Window w, Colormap c) } - declare 54 {aqua} { - void XUngrabKeyboard (Display* d, Time t) + void XUngrabKeyboard(Display *d, Time t) } - declare 55 {aqua} { - void XUngrabPointer (Display* d, Time t) + void XUngrabPointer(Display *d, Time t) } - declare 56 {aqua} { - void XUnmapWindow (Display* d, Window w) + void XUnmapWindow(Display *d, Window w) } - declare 57 {aqua} { - void TkPutImage (unsigned long *colors, \ - int ncolors, Display* display, Drawable d, \ - GC gc, XImage* image, int src_x, int src_y, \ - int dest_x, int dest_y, unsigned int width, \ - unsigned int height) -} + void TkPutImage(unsigned long *colors, int ncolors, Display *display, + Drawable d, GC gc, XImage *image, int src_x, int src_y, + int dest_x, int dest_y, unsigned int width, unsigned int height) +} declare 58 {aqua} { - Status XParseColor (Display *display, Colormap map, \ - _Xconst char* spec, XColor *colorPtr) + Status XParseColor(Display *display, Colormap map, + _Xconst char *spec, XColor *colorPtr) } - declare 59 {aqua} { - GC XCreateGC(Display* display, Drawable d, \ - unsigned long valuemask, XGCValues* values) + GC XCreateGC(Display *display, Drawable d, + unsigned long valuemask, XGCValues *values) } - declare 60 {aqua} { - void XFreeGC(Display* display, GC gc) + void XFreeGC(Display *display, GC gc) } - declare 61 {aqua} { - Atom XInternAtom(Display* display,_Xconst char* atom_name, \ + Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists) } - declare 62 {aqua} { - void XSetBackground(Display* display, GC gc, \ - unsigned long foreground) + void XSetBackground(Display *display, GC gc, unsigned long foreground) } - declare 63 {aqua} { - void XSetForeground(Display* display, GC gc, \ - unsigned long foreground) + void XSetForeground(Display *display, GC gc, unsigned long foreground) } - declare 64 {aqua} { - void XSetClipMask(Display* display, GC gc, Pixmap pixmap) + void XSetClipMask(Display *display, GC gc, Pixmap pixmap) } - declare 65 {aqua} { - void XSetClipOrigin(Display* display, GC gc, \ + void XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin) } - declare 66 {aqua} { - void XSetTSOrigin(Display* display, GC gc, \ + void XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin) } - declare 67 {aqua} { - void XChangeGC(Display * d, GC gc, unsigned long mask, XGCValues *values) + void XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) } - declare 68 {aqua} { void XSetFont(Display *display, GC gc, Font font) } - declare 69 {aqua} { void XSetArcMode(Display *display, GC gc, int arc_mode) } - declare 70 {aqua} { void XSetStipple(Display *display, GC gc, Pixmap stipple) } - declare 71 {aqua} { void XSetFillRule(Display *display, GC gc, int fill_rule) } - declare 72 {aqua} { void XSetFillStyle(Display *display, GC gc, int fill_style) } - declare 73 {aqua} { void XSetFunction(Display *display, GC gc, int function) } - declare 74 {aqua} { - void XSetLineAttributes(Display *display, GC gc, \ - unsigned int line_width, int line_style, \ + void XSetLineAttributes(Display *display, GC gc, + unsigned int line_width, int line_style, int cap_style, int join_style) } - declare 75 {aqua} { int _XInitImageFuncPtrs(XImage *image) } - declare 76 {aqua} { XIC XCreateIC(void) } - declare 77 {aqua} { - XVisualInfo *XGetVisualInfo(Display* display, long vinfo_mask, \ - XVisualInfo* vinfo_template, int* nitems_return) + XVisualInfo *XGetVisualInfo(Display *display, long vinfo_mask, + XVisualInfo *vinfo_template, int *nitems_return) } - declare 78 {aqua} { - void XSetWMClientMachine(Display* display, Window w, \ - XTextProperty* text_prop) + void XSetWMClientMachine(Display *display, Window w, + XTextProperty *text_prop) } - declare 79 {aqua} { - Status XStringListToTextProperty(char** list, int count, \ - XTextProperty* text_prop_return) + Status XStringListToTextProperty(char **list, int count, + XTextProperty *text_prop_return) } declare 80 {aqua} { - void XDrawSegments(Display *display, Drawable d, GC gc, \ - XSegment *segments, int nsegments) + void XDrawSegments(Display *display, Drawable d, GC gc, + XSegment *segments, int nsegments) } declare 81 {aqua} { - void XForceScreenSaver(Display* display, int mode) + void XForceScreenSaver(Display *display, int mode) } declare 82 {aqua} { - void XDrawLine (Display* d, Drawable dr, GC g, int x1, int y1, \ + void XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2) } declare 83 {aqua} { - void XFillRectangle (Display* display, Drawable d, GC gc, \ + void XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height) } declare 84 {aqua} { - void XClearWindow (Display* d, Window w) + void XClearWindow(Display *d, Window w) } - declare 85 {aqua} { - void XDrawPoint (Display* display, Drawable d, GC gc, int x, int y) + void XDrawPoint(Display *display, Drawable d, GC gc, int x, int y) } - declare 86 {aqua} { - void XDrawPoints (Display* display, Drawable d, GC gc, XPoint *points, \ + void XDrawPoints(Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode) } - declare 87 {aqua} { - void XWarpPointer (Display* display, Window src_w, Window dest_w, \ - int src_x, int src_y, unsigned int src_width, \ + void XWarpPointer(Display *display, Window src_w, Window dest_w, + int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y) } - declare 88 {aqua} { - void XQueryColor (Display *display, Colormap colormap, XColor *def_in_out) + void XQueryColor(Display *display, Colormap colormap, XColor *def_in_out) } - declare 89 {aqua} { - void XQueryColors (Display *display, Colormap colormap, \ + void XQueryColors(Display *display, Colormap colormap, XColor *defs_in_out, int ncolors) } - declare 90 {aqua} { - Status XQueryTree (Display* d, Window w1, Window* w2, Window* w3, \ - Window** w4, unsigned int* ui) + Status XQueryTree(Display *d, Window w1, Window *w2, Window *w3, + Window **w4, unsigned int *ui) } diff --git a/generic/tkInt.h b/generic/tkInt.h index 7653d2c..9c350af 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -1,17 +1,17 @@ /* * tkInt.h -- * - * Declarations for things used internally by the Tk - * procedures but not exported outside the module. + * Declarations for things used internally by the Tk functions but not + * exported outside the module. * * Copyright (c) 1990-1994 The Regents of the University of California. * 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. + * 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.66 2005/03/23 22:17:00 wolfsuit Exp $ + * RCS: $Id: tkInt.h,v 1.67 2005/09/21 10:54:40 dkf Exp $ */ #ifndef _TKINT @@ -39,18 +39,17 @@ typedef struct TkStressedCmap TkStressedCmap; typedef struct TkBindInfo_ *TkBindInfo; /* - * Procedure types. + * Function types. */ -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 int (TkBindEvalProc)(ClientData clientData, Tcl_Interp *interp, + XEvent *eventPtr, Tk_Window tkwin, KeySym keySym); +typedef void (TkBindFreeProc)(ClientData clientData); /* - * One of the following structures is maintained for each cursor in - * use in the system. This structure is used by tkCursor.c and the - * various system specific cursor files. + * One of the following structures is maintained for each cursor in use in the + * system. This structure is used by tkCursor.c and the various system + * specific cursor files. */ typedef struct TkCursor { @@ -60,64 +59,63 @@ typedef struct TkCursor { int resourceRefCount; /* Number of active uses of this cursor (each * active use corresponds to a call to * Tk_AllocPreserveFromObj or Tk_Preserve). - * If this count is 0, then this structure - * is no longer valid and it isn't present - * in a hash table: it is being kept around - * only because there are objects referring - * to it. The structure is freed when - * resourceRefCount and objRefCount are - * both 0. */ - int objRefCount; /* Number of Tcl objects that reference - * this structure.. */ - Tcl_HashTable *otherTable; /* Second table (other than idTable) used - * to index this entry. */ + * If this count is 0, then this structure is + * no longer valid and it isn't present in a + * hash table: it is being kept around only + * because there are objects referring to it. + * The structure is freed when + * resourceRefCount and objRefCount are both + * 0. */ + int objRefCount; /* Number of Tcl objects that reference this + * structure.. */ + Tcl_HashTable *otherTable; /* Second table (other than idTable) used to + * index this entry. */ Tcl_HashEntry *hashPtr; /* Entry in otherTable for this structure * (needed when deleting). */ - Tcl_HashEntry *idHashPtr; /* Entry in idTable for this structure - * (needed when deleting). */ + Tcl_HashEntry *idHashPtr; /* Entry in idTable for this structure (needed + * when deleting). */ struct TkCursor *nextPtr; /* Points to the next TkCursor structure with - * the same name. Cursors with the same - * name but different displays are chained - * together off a single hash table entry. */ + * the same name. Cursors with the same name + * but different displays are chained together + * off a single hash table entry. */ } TkCursor; /* - * This defines whether we should try to use XIM over-the-spot style - * input. Allow users to override it. It is a much more elegant use - * of XIM, but uses a bit more memory. + * This defines whether we should try to use XIM over-the-spot style input. + * Allow users to override it. It is a much more elegant use of XIM, but uses + * a bit more memory. */ #ifndef TK_XIM_SPOT -# define TK_XIM_SPOT 1 +#define TK_XIM_SPOT 1 #endif /* * The following structure is kept one-per-TkDisplay to maintain information - * about the caret (cursor location) on this display. This is used to - * dictate global focus location (Windows Accessibility guidelines) and to - * position the IME or XIM over-the-spot window. + * about the caret (cursor location) on this display. This is used to dictate + * global focus location (Windows Accessibility guidelines) and to position + * the IME or XIM over-the-spot window. */ typedef struct TkCaret { - struct TkWindow *winPtr; /* the window on which we requested caret - * placement */ - int x; /* relative x coord of the caret */ - int y; /* relative y coord of the caret */ - int height; /* specified height of the window */ + struct TkWindow *winPtr; /* The window on which we requested caret + * placement. */ + int x; /* Relative x coord of the caret. */ + int y; /* Relative y coord of the caret. */ + int height; /* Specified height of the window. */ } TkCaret; /* - * One of the following structures is maintained for each display - * containing a window managed by Tk. In part, the structure is - * used to store thread-specific data, since each thread will have - * its own TkDisplay structure. + * One of the following structures is maintained for each display containing a + * window managed by Tk. In part, the structure is used to store thread- + * specific data, since each thread will have its own TkDisplay structure. */ typedef struct TkDisplay { Display *display; /* Xlib's info about display. */ struct TkDisplay *nextPtr; /* Next in list of all displays. */ - char *name; /* Name of display (with any screen - * identifier removed). Malloc-ed. */ + char *name; /* Name of display (with any screen identifier + * removed). Malloc-ed. */ Time lastEventTime; /* Time of last event received for this * display. */ @@ -125,16 +123,16 @@ typedef struct TkDisplay { * Information used primarily by tk3d.c: */ - int borderInit; /* 0 means borderTable needs initializing. */ - Tcl_HashTable borderTable; /* Maps from color name to TkBorder + int borderInit; /* 0 means borderTable needs initializing. */ + Tcl_HashTable borderTable; /* Maps from color name to TkBorder * structure. */ /* * Information used by tkAtom.c only: */ - int atomInit; /* 0 means stuff below hasn't been - * initialized yet. */ + int atomInit; /* 0 means stuff below hasn't been initialized + * yet. */ Tcl_HashTable nameTable; /* Maps from names to Atom's. */ Tcl_HashTable atomTable; /* Maps from Atom's back to names. */ @@ -142,139 +140,137 @@ typedef struct TkDisplay { * Information used primarily by tkBind.c: */ - int bindInfoStale; /* Non-zero means the variables in this - * part of the structure are potentially - * incorrect and should be recomputed. */ + int bindInfoStale; /* Non-zero means the variables in this part + * of the structure are potentially incorrect + * and should be recomputed. */ unsigned int modeModMask; /* Has one bit set to indicate the modifier - * corresponding to "mode shift". If no - * such modifier, than this is zero. */ + * corresponding to "mode shift". If no such + * modifier, than this is zero. */ unsigned int metaModMask; /* Has one bit set to indicate the modifier - * corresponding to the "Meta" key. If no - * such modifier, then this is zero. */ + * corresponding to the "Meta" key. If no such + * modifier, then this is zero. */ unsigned int altModMask; /* Has one bit set to indicate the modifier - * corresponding to the "Meta" key. If no - * such modifier, then this is zero. */ + * corresponding to the "Meta" key. If no such + * modifier, then this is zero. */ enum {LU_IGNORE, LU_CAPS, LU_SHIFT} lockUsage; - /* Indicates how to interpret lock modifier. */ + /* Indicates how to interpret lock + * modifier. */ int numModKeyCodes; /* Number of entries in modKeyCodes array * below. */ - KeyCode *modKeyCodes; /* Pointer to an array giving keycodes for - * all of the keys that have modifiers - * associated with them. Malloc'ed, but - * may be NULL. */ + KeyCode *modKeyCodes; /* Pointer to an array giving keycodes for all + * of the keys that have modifiers associated + * with them. Malloc'ed, but may be NULL. */ /* * Information used by tkBitmap.c only: */ - - int bitmapInit; /* 0 means tables above need initializing. */ - int bitmapAutoNumber; /* Used to number bitmaps. */ - Tcl_HashTable bitmapNameTable; - /* Maps from name of bitmap to the first + + int bitmapInit; /* 0 means tables above need initializing. */ + int bitmapAutoNumber; /* Used to number bitmaps. */ + Tcl_HashTable bitmapNameTable; + /* Maps from name of bitmap to the first * TkBitmap record for that name. */ Tcl_HashTable bitmapIdTable;/* Maps from bitmap id to the TkBitmap * structure for the bitmap. */ - Tcl_HashTable bitmapDataTable; - /* Used by Tk_GetBitmapFromData to map from - * a collection of in-core data about a - * bitmap to a reference giving an auto- - * matically-generated name for the bitmap. */ + Tcl_HashTable bitmapDataTable; + /* Used by Tk_GetBitmapFromData to map from a + * collection of in-core data about a bitmap + * to a reference giving an automatically- + * generated name for the bitmap. */ /* * Information used by tkCanvas.c only: */ - int numIdSearches; + int numIdSearches; int numSlowSearches; /* * Used by tkColor.c only: */ - int colorInit; /* 0 means color module needs initializing. */ - TkStressedCmap *stressPtr; /* First in list of colormaps that have - * filled up, so we have to pick an - * approximate color. */ + int colorInit; /* 0 means color module needs initializing. */ + TkStressedCmap *stressPtr; /* First in list of colormaps that have filled + * up, so we have to pick an approximate + * color. */ Tcl_HashTable colorNameTable; - /* Maps from color name to TkColor structure + /* Maps from color name to TkColor structure * for that color. */ Tcl_HashTable colorValueTable; - /* Maps from integer RGB values to TkColor + /* Maps from integer RGB values to TkColor * structures. */ /* * Used by tkCursor.c only: */ - int cursorInit; /* 0 means cursor module need initializing. */ + int cursorInit; /* 0 means cursor module need initializing. */ Tcl_HashTable cursorNameTable; - /* Maps from a string name to a cursor to the + /* Maps from a string name to a cursor to the * TkCursor record for the cursor. */ Tcl_HashTable cursorDataTable; - /* Maps from a collection of in-core data + /* Maps from a collection of in-core data * about a cursor to a TkCursor structure. */ Tcl_HashTable cursorIdTable; - /* Maps from a cursor id to the TkCursor + /* Maps from a cursor id to the TkCursor * structure for the cursor. */ - char cursorString[20]; /* Used to store a cursor id string. */ - Font cursorFont; /* Font to use for standard cursors. - * None means font not loaded yet. */ + char cursorString[20]; /* Used to store a cursor id string. */ + Font cursorFont; /* Font to use for standard cursors. None + * means font not loaded yet. */ /* * Information used by tkError.c only: */ struct TkErrorHandler *errorPtr; - /* First in list of error handlers - * for this display. NULL means - * no handlers exist at present. */ - int deleteCount; /* Counts # of handlers deleted since - * last time inactive handlers were - * garbage-collected. When this number - * gets big, handlers get cleaned up. */ + /* First in list of error handlers for this + * display. NULL means no handlers exist at + * present. */ + int deleteCount; /* Counts # of handlers deleted since last + * time inactive handlers were garbage- + * collected. When this number gets big, + * handlers get cleaned up. */ /* * Used by tkEvent.c only: */ struct TkWindowEvent *delayedMotionPtr; - /* Points to a malloc-ed motion event - * whose processing has been delayed in - * the hopes that another motion event - * will come along right away and we can - * merge the two of them together. NULL - * means that there is no delayed motion - * event. */ + /* Points to a malloc-ed motion event whose + * processing has been delayed in the hopes + * that another motion event will come along + * right away and we can merge the two of them + * together. NULL means that there is no + * delayed motion event. */ /* * Information used by tkFocus.c only: */ - int focusDebug; /* 1 means collect focus debugging + int focusDebug; /* 1 means collect focus debugging * statistics. */ struct TkWindow *implicitWinPtr; /* If the focus arrived at a toplevel window - * implicitly via an Enter event (rather - * than via a FocusIn event), this points - * to the toplevel window. Otherwise it is - * NULL. */ + * implicitly via an Enter event (rather than + * via a FocusIn event), this points to the + * toplevel window. Otherwise it is NULL. */ struct TkWindow *focusPtr; /* Points to the window on this display that - * should be receiving keyboard events. When + * should be receiving keyboard events. When * multiple applications on the display have - * the focus, this will refer to the - * innermost window in the innermost - * application. This information isn't used - * under Unix or Windows, but it's needed on - * the Macintosh. */ + * the focus, this will refer to the innermost + * window in the innermost application. This + * information isn't used under Unix or + * Windows, but it's needed on the + * Macintosh. */ /* * Information used by tkGC.c only: */ - + Tcl_HashTable gcValueTable; /* Maps from a GC's values to a TkGC structure * describing a GC with those values. */ - Tcl_HashTable gcIdTable; /* Maps from a GC to a TkGC. */ - int gcInit; /* 0 means the tables below need + Tcl_HashTable gcIdTable; /* Maps from a GC to a TkGC. */ + int gcInit; /* 0 means the tables below need * initializing. */ /* @@ -282,24 +278,23 @@ typedef struct TkDisplay { */ Tcl_HashTable maintainHashTable; - /* Hash table that maps from a master's - * Tk_Window token to a list of slaves - * managed by that master. */ - int geomInit; + /* Hash table that maps from a master's + * Tk_Window token to a list of slaves managed + * by that master. */ + int geomInit; /* * Information used by tkGet.c only: */ - - Tcl_HashTable uidTable; /* Stores all Tk_Uid used in a thread. */ - int uidInit; /* 0 means uidTable needs initializing. */ + + Tcl_HashTable uidTable; /* Stores all Tk_Uid used in a thread. */ + int uidInit; /* 0 means uidTable needs initializing. */ /* * Information used by tkGrab.c only: */ - struct TkWindow *grabWinPtr; - /* Window in which the pointer is currently + struct TkWindow *grabWinPtr;/* Window in which the pointer is currently * grabbed, or NULL if none. */ struct TkWindow *eventualGrabWinPtr; /* Value that grabWinPtr will have once the @@ -311,68 +306,65 @@ typedef struct TkDisplay { * if no such press in effect. */ struct TkWindow *serverWinPtr; /* If no application contains the pointer then - * this is NULL. Otherwise it contains the - * last window for which we've gotten an - * Enter or Leave event from the server (i.e. - * the last window known to have contained - * the pointer). Doesn't reflect events - * that were synthesized in tkGrab.c. */ + * this is NULL. Otherwise it contains the + * last window for which we've gotten an Enter + * or Leave event from the server (i.e. the + * last window known to have contained the + * pointer). Doesn't reflect events that were + * synthesized in tkGrab.c. */ TkGrabEvent *firstGrabEventPtr; /* First in list of enter/leave events - * synthesized by grab code. These events - * must be processed in order before any other - * events are processed. NULL means no such + * synthesized by grab code. These events must + * be processed in order before any other + * events are processed. NULL means no such * events. */ TkGrabEvent *lastGrabEventPtr; /* Last in list of synthesized events, or NULL * if list is empty. */ - int grabFlags; /* Miscellaneous flag values. See definitions + int grabFlags; /* Miscellaneous flag values. See definitions * in tkGrab.c. */ /* * Information used by tkGrid.c only: */ - int gridInit; /* 0 means table below needs initializing. */ - Tcl_HashTable gridHashTable;/* Maps from Tk_Window tokens to - * corresponding Grid structures. */ + int gridInit; /* 0 means table below needs initializing. */ + Tcl_HashTable gridHashTable;/* Maps from Tk_Window tokens to corresponding + * Grid structures. */ /* * Information used by tkImage.c only: */ - int imageId; /* Value used to number image ids. */ + int imageId; /* Value used to number image ids. */ /* * Information used by tkMacWinMenu.c only: */ - int postCommandGeneration; + int postCommandGeneration; /* * Information used by tkOption.c only. */ - - /* * Information used by tkPack.c only. */ - int packInit; /* 0 means table below needs initializing. */ + int packInit; /* 0 means table below needs initializing. */ Tcl_HashTable packerHashTable; - /* Maps from Tk_Window tokens to - * corresponding Packer structures. */ - + /* Maps from Tk_Window tokens to corresponding + * Packer structures. */ /* * Information used by tkPlace.c only. */ - int placeInit; /* 0 means tables below need initializing. */ - Tcl_HashTable masterTable; /* Maps from Tk_Window toke to the Master + int placeInit; /* 0 means tables below need initializing. */ + Tcl_HashTable masterTable; /* Maps from Tk_Window toke to the Master * structure for the window, if it exists. */ - Tcl_HashTable slaveTable; /* Maps from Tk_Window toke to the Slave + Tcl_HashTable slaveTable; /* Maps from Tk_Window toke to the Slave * structure for the window, if it exists. */ /* @@ -381,11 +373,11 @@ typedef struct TkDisplay { struct TkSelectionInfo *selectionInfoPtr; /* First in list of selection information - * records. Each entry contains information + * records. Each entry contains information * about the current owner of a particular * selection on this display. */ - Atom multipleAtom; /* Atom for MULTIPLE. None means - * selection stuff isn't initialized. */ + Atom multipleAtom; /* Atom for MULTIPLE. None means selection + * stuff isn't initialized. */ Atom incrAtom; /* Atom for INCR. */ Atom targetsAtom; /* Atom for TARGETS. */ Atom timestampAtom; /* Atom for TIMESTAMP. */ @@ -406,7 +398,7 @@ typedef struct TkDisplay { /* Last application that owned clipboard. */ struct TkClipboardTarget *clipTargetPtr; /* First in list of clipboard type information - * records. Each entry contains information + * records. Each entry contains information * about the buffers for a given selection * target. */ @@ -414,13 +406,13 @@ typedef struct TkDisplay { * Information used by tkSend.c only: */ - Tk_Window commTkwin; /* Window used for communication - * between interpreters during "send" - * commands. NULL means send info hasn't - * been initialized yet. */ + Tk_Window commTkwin; /* Window used for communication between + * interpreters during "send" commands. NULL + * means send info hasn't been initialized + * yet. */ Atom commProperty; /* X's name for comm property. */ - Atom registryProperty; /* X's name for property containing - * registry of interpreter names. */ + Atom registryProperty; /* X's name for property containing registry + * of interpreter names. */ Atom appNameProperty; /* X's name for property used to hold the * application name on each comm window. */ @@ -432,7 +424,7 @@ typedef struct TkDisplay { /* First in list of chunks of free resource * identifiers, or NULL if there are no free * resources. */ - XID (*defaultAllocProc) _ANSI_ARGS_((Display *display)); + XID (*defaultAllocProc) (Display *display); /* Default resource allocator for display. */ struct TkIdStack *windowStackPtr; /* First in list of chunks of window @@ -447,17 +439,16 @@ typedef struct TkDisplay { * Information used by tkUnixWm.c and tkWinWm.c only: */ - struct TkWmInfo *firstWmPtr; /* Points to first top-level window. */ - struct TkWmInfo *foregroundWmPtr; - /* Points to the foreground window. */ + struct TkWmInfo *firstWmPtr;/* Points to first top-level window. */ + struct TkWmInfo *foregroundWmPtr; + /* Points to the foreground window. */ /* * Information maintained by tkWindow.c for use later on by tkXId.c: */ - - int destroyCount; /* Number of Tk_DestroyWindow operations - * in progress. */ + int destroyCount; /* Number of Tk_DestroyWindow operations in + * progress. */ unsigned long lastDestroyRequest; /* Id of most recent XDestroyWindow request; * can re-use ids in windowStackPtr when @@ -485,16 +476,15 @@ typedef struct TkDisplay { int refCount; /* Reference count of how many Tk applications * are using this display. Used to clean up - * the display when we no longer have any - * Tk applications using it. - */ + * the display when we no longer have any Tk + * applications using it. */ /* * The following field were all added for Tk8.3 */ - int mouseButtonState; /* current mouse button state for this + int mouseButtonState; /* Current mouse button state for this * display */ - Window mouseButtonWindow; /* Window the button state was set in, - * added in Tk 8.4. */ + Window mouseButtonWindow; /* Window the button state was set in, added + * in Tk 8.4. */ Window warpWindow; int warpX; int warpY; @@ -502,13 +492,14 @@ typedef struct TkDisplay { /* * The following field(s) were all added for Tk8.4 */ - unsigned int flags; /* Various flag values: these are all - * defined in below. */ - TkCaret caret; /* information about the caret for this - * display. This is not a pointer. */ - int iconDataSize; /* size of default iconphoto image data */ - unsigned char *iconDataPtr; /* default iconphoto image data, if set */ + unsigned int flags; /* Various flag values: these are all defined + * in below. */ + TkCaret caret; /* Information about the caret for this + * display. This is not a pointer. */ + + int iconDataSize; /* Size of default iconphoto image data */ + unsigned char *iconDataPtr; /* Default iconphoto image data, if set */ } TkDisplay; /* @@ -532,83 +523,71 @@ typedef struct TkDisplay { #define TK_DISPLAY_IN_WARP (1 << 4) /* - * One of the following structures exists for each error handler - * created by a call to Tk_CreateErrorHandler. The structure - * is managed by tkError.c. + * One of the following structures exists for each error handler created by a + * call to Tk_CreateErrorHandler. The structure is managed by tkError.c. */ typedef struct TkErrorHandler { TkDisplay *dispPtr; /* Display to which handler applies. */ - unsigned long firstRequest; /* Only errors with serial numbers - * >= to this are considered. */ - unsigned long lastRequest; /* Only errors with serial numbers - * <= to this are considered. This - * field is filled in when XUnhandle - * is called. -1 means XUnhandle - * hasn't been called yet. */ - int error; /* Consider only errors with this - * error_code (-1 means consider - * all errors). */ - int request; /* Consider only errors with this - * major request code (-1 means - * consider all major codes). */ - int minorCode; /* Consider only errors with this - * minor request code (-1 means - * consider all minor codes). */ - Tk_ErrorProc *errorProc; /* Procedure to invoke when a matching - * error occurs. NULL means just ignore - * errors. */ - ClientData clientData; /* Arbitrary value to pass to - * errorProc. */ + unsigned long firstRequest; /* Only errors with serial numbers >= to this + * are considered. */ + unsigned long lastRequest; /* Only errors with serial numbers <= to this + * are considered. This field is filled in + * when XUnhandle is called. -1 means + * XUnhandle hasn't been called yet. */ + int error; /* Consider only errors with this error_code + * (-1 means consider all errors). */ + int request; /* Consider only errors with this major + * request code (-1 means consider all major + * codes). */ + int minorCode; /* Consider only errors with this minor + * request code (-1 means consider all minor + * codes). */ + Tk_ErrorProc *errorProc; /* Function to invoke when a matching error + * occurs. NULL means just ignore errors. */ + ClientData clientData; /* Arbitrary value to pass to errorProc. */ struct TkErrorHandler *nextPtr; - /* Pointer to next older handler for - * this display, or NULL for end of - * list. */ + /* Pointer to next older handler for this + * display, or NULL for end of list. */ } TkErrorHandler; - /* - * One of the following structures exists for each event handler - * created by calling Tk_CreateEventHandler. This information - * is used by tkEvent.c only. + * One of the following structures exists for each event handler created by + * calling Tk_CreateEventHandler. This information is used by tkEvent.c only. */ typedef struct TkEventHandler { - unsigned long mask; /* Events for which to invoke - * proc. */ - Tk_EventProc *proc; /* Procedure to invoke when an event - * in mask occurs. */ + unsigned long mask; /* Events for which to invoke proc. */ + Tk_EventProc *proc; /* Function to invoke when an event in mask + * occurs. */ ClientData clientData; /* Argument to pass to proc. */ struct TkEventHandler *nextPtr; - /* Next in list of handlers - * associated with window (NULL means - * end of list). */ + /* Next in list of handlers associated with + * window (NULL means end of list). */ } TkEventHandler; /* - * Tk keeps one of the following data structures for each main - * window (created by a call to TkCreateMainWindow). It stores - * information that is shared by all of the windows associated - * with a particular main window. + * Tk keeps one of the following data structures for each main window (created + * by a call to TkCreateMainWindow). It stores information that is shared by + * all of the windows associated with a particular main window. */ typedef struct TkMainInfo { int refCount; /* Number of windows whose "mainPtr" fields - * point here. When this becomes zero, can - * free up the structure (the reference - * count is zero because windows can get - * deleted in almost any order; the main - * window isn't necessarily the last one - * deleted). */ + * point here. When this becomes zero, can + * free up the structure (the reference count + * is zero because windows can get deleted in + * almost any order; the main window isn't + * necessarily the last one deleted). */ struct TkWindow *winPtr; /* Pointer to main window. */ Tcl_Interp *interp; /* Interpreter associated with application. */ Tcl_HashTable nameTable; /* Hash table mapping path names to TkWindow * structs for all windows related to this - * main window. Managed by tkWindow.c. */ + * main window. Managed by tkWindow.c. */ long deletionEpoch; /* Incremented by window deletions */ Tk_BindingTable bindingTable; - /* Used in conjunction with "bind" command - * to bind events to Tcl commands. */ + /* Used in conjunction with "bind" command to + * bind events to Tcl commands. */ TkBindInfo bindInfo; /* Information used by tkBind.c on a per * application basis. */ struct TkFontInfo *fontInfoPtr; @@ -622,192 +601,178 @@ typedef struct TkMainInfo { struct TkToplevelFocusInfo *tlFocusPtr; /* First in list of records containing focus * information for each top-level in the - * application. Used only by tkFocus.c. */ + * application. Used only by tkFocus.c. */ struct TkDisplayFocusInfo *displayFocusPtr; /* First in list of records containing focus * information for each display that this - * application has ever used. Used only - * by tkFocus.c. */ + * application has ever used. Used only by + * tkFocus.c. */ struct ElArray *optionRootPtr; - /* Top level of option hierarchy for this - * main window. NULL means uninitialized. - * Managed by tkOption.c. */ + /* Top level of option hierarchy for this main + * window. NULL means uninitialized. Managed + * by tkOption.c. */ Tcl_HashTable imageTable; /* Maps from image names to Tk_ImageMaster - * structures. Managed by tkImage.c. */ - int strictMotif; /* This is linked to the tk_strictMotif - * global variable. */ + * structures. Managed by tkImage.c. */ + int strictMotif; /* This is linked to the tk_strictMotif global + * variable. */ struct TkMainInfo *nextPtr; /* Next in list of all main windows managed by * this process. */ } TkMainInfo; /* - * Tk keeps the following data structure for each of it's builtin - * bitmaps. This structure is only used by tkBitmap.c and other - * platform specific bitmap files. + * Tk keeps the following data structure for each of it's builtin bitmaps. + * This structure is only used by tkBitmap.c and other platform specific + * bitmap files. */ typedef struct { CONST char *source; /* Bits for bitmap. */ int width, height; /* Dimensions of bitmap. */ - int native; /* 0 means generic (X style) bitmap, - * 1 means native style bitmap. */ + int native; /* 0 means generic (X style) bitmap, 1 means + * native style bitmap. */ } TkPredefBitmap; /* - * Tk keeps one of the following structures for each window. - * Some of the information (like size and location) is a shadow - * of information managed by the X server, and some is special - * information used here, such as event and geometry management - * information. This information is (mostly) managed by tkWindow.c. - * WARNING: the declaration below must be kept consistent with the - * Tk_FakeWin structure in tk.h. If you change one, be sure to - * change the other!! + * Tk keeps one of the following structures for each window. Some of the + * information (like size and location) is a shadow of information managed by + * the X server, and some is special information used here, such as event and + * geometry management information. This information is (mostly) managed by + * tkWindow.c. WARNING: the declaration below must be kept consistent with the + * Tk_FakeWin structure in tk.h. If you change one, be sure to change the + * other! */ typedef struct TkWindow { - /* * Structural information: */ Display *display; /* Display containing window. */ - TkDisplay *dispPtr; /* Tk's information about display - * for window. */ - int screenNum; /* Index of screen for window, among all - * those for dispPtr. */ - Visual *visual; /* Visual to use for window. If not default, + TkDisplay *dispPtr; /* Tk's information about display for + * window. */ + int screenNum; /* Index of screen for window, among all those + * for dispPtr. */ + Visual *visual; /* Visual to use for window. If not default, * MUST be set before X window is created. */ int depth; /* Number of bits/pixel. */ - Window window; /* X's id for window. NULL means window - * hasn't actually been created yet, or it's - * been deleted. */ - struct TkWindow *childList; /* First in list of child windows, - * or NULL if no children. List is in - * stacking order, lowest window first.*/ + Window window; /* X's id for window. NULL means window hasn't + * actually been created yet, or it's been + * deleted. */ + struct TkWindow *childList; /* First in list of child windows, or NULL if + * no children. List is in stacking order, + * lowest window first.*/ struct TkWindow *lastChildPtr; - /* Last in list of child windows (highest - * in stacking order), or NULL if no - * children. */ - struct TkWindow *parentPtr; /* Pointer to parent window (logical - * parent, not necessarily X parent). NULL - * means either this is the main window, or - * the window's parent has already been + /* Last in list of child windows (highest in + * stacking order), or NULL if no children. */ + struct TkWindow *parentPtr; /* Pointer to parent window (logical parent, + * not necessarily X parent). NULL means + * either this is the main window, or the + * window's parent has already been * deleted. */ - struct TkWindow *nextPtr; /* Next higher sibling (in stacking order) - * in list of children with same parent. NULL + struct TkWindow *nextPtr; /* Next higher sibling (in stacking order) in + * list of children with same parent. NULL * means end of list. */ TkMainInfo *mainPtr; /* Information shared by all windows - * associated with a particular main - * window. NULL means this window is - * a rogue that isn't associated with - * any application (at present, this - * only happens for the dummy windows - * used for "send" communication). */ + * associated with a particular main window. + * NULL means this window is a rogue that is + * not associated with any application (at + * present, this only happens for the dummy + * windows used for "send" communication). */ /* * Name and type information for the window: */ - char *pathName; /* Path name of window (concatenation - * of all names between this window and - * its top-level ancestor). This is a - * pointer into an entry in - * mainPtr->nameTable. NULL means that - * the window hasn't been completely - * created yet. */ + char *pathName; /* Path name of window (concatenation of all + * names between this window and its top-level + * ancestor). This is a pointer into an entry + * in mainPtr->nameTable. NULL means that the + * window hasn't been completely created + * yet. */ Tk_Uid nameUid; /* Name of the window within its parent * (unique within the parent). */ - Tk_Uid classUid; /* Class of the window. NULL means window + Tk_Uid classUid; /* Class of the window. NULL means window * hasn't been given a class yet. */ /* - * Geometry and other attributes of window. This information - * may not be updated on the server immediately; stuff that - * hasn't been reflected in the server yet is called "dirty". - * At present, information can be dirty only if the window - * hasn't yet been created. + * Geometry and other attributes of window. This information may not be + * updated on the server immediately; stuff that hasn't been reflected in + * the server yet is called "dirty". At present, information can be dirty + * only if the window hasn't yet been created. */ - XWindowChanges changes; /* Geometry and other info about - * window. */ - unsigned int dirtyChanges; /* Bits indicate fields of "changes" - * that are dirty. */ + XWindowChanges changes; /* Geometry and other info about window. */ + unsigned int dirtyChanges; /* Bits indicate fields of "changes" that are + * dirty. */ XSetWindowAttributes atts; /* Current attributes of window. */ - unsigned long dirtyAtts; /* Bits indicate fields of "atts" - * that are dirty. */ + unsigned long dirtyAtts; /* Bits indicate fields of "atts" that are + * dirty. */ - unsigned int flags; /* Various flag values: these are all - * defined in tk.h (confusing, but they're - * needed there for some query macros). */ + unsigned int flags; /* Various flag values: these are all defined + * in tk.h (confusing, but they're needed + * there for some query macros). */ /* * Information kept by the event manager (tkEvent.c): */ - TkEventHandler *handlerList;/* First in list of event handlers - * declared for this window, or - * NULL if none. */ + TkEventHandler *handlerList;/* First in list of event handlers declared + * for this window, or NULL if none. */ #ifdef TK_USE_INPUT_METHODS XIC inputContext; /* XIM input context. */ #endif /* TK_USE_INPUT_METHODS */ /* - * Information used for event bindings (see "bind" and "bindtags" - * commands in tkCmds.c): + * Information used for event bindings (see "bind" and "bindtags" commands + * in tkCmds.c): */ ClientData *tagPtr; /* Points to array of tags used for bindings - * on this window. Each tag is a Tk_Uid. - * Malloc'ed. NULL means no tags. */ + * on this window. Each tag is a Tk_Uid. + * Malloc'ed. NULL means no tags. */ int numTags; /* Number of tags at *tagPtr. */ /* - * Information used by tkOption.c to manage options for the - * window. + * Information used by tkOption.c to manage options for the window. */ - int optionLevel; /* -1 means no option information is - * currently cached for this window. - * Otherwise this gives the level in - * the option stack at which info is - * cached. */ + int optionLevel; /* -1 means no option information is currently + * cached for this window. Otherwise this + * gives the level in the option stack at + * which info is cached. */ /* * Information used by tkSelect.c to manage the selection. */ struct TkSelHandler *selHandlerList; - /* First in list of handlers for - * returning the selection in various - * forms. */ + /* First in list of handlers for returning the + * selection in various forms. */ /* * Information used by tkGeometry.c for geometry management. */ - Tk_GeomMgr *geomMgrPtr; /* Information about geometry manager for - * this window. */ - ClientData geomData; /* Argument for geometry manager procedures. */ + Tk_GeomMgr *geomMgrPtr; /* Information about geometry manager for this + * window. */ + ClientData geomData; /* Argument for geometry manager functions. */ int reqWidth, reqHeight; /* Arguments from last call to * Tk_GeometryRequest, or 0's if - * Tk_GeometryRequest hasn't been - * called. */ - int internalBorderLeft; /* Width of internal border of window - * (0 means no internal border). Geometry - * managers should not normally place children - * on top of the border. - * Fields for the other three sides are found - * below. */ + * Tk_GeometryRequest hasn't been called. */ + int internalBorderLeft; /* Width of internal border of window (0 means + * no internal border). Geometry managers + * should not normally place children on top + * of the border. Fields for the other three + * sides are found below. */ /* * Information maintained by tkWm.c for window manager communication. */ - struct TkWmInfo *wmInfoPtr; /* For top-level windows (and also - * for special Unix menubar and wrapper - * windows), points to structure with - * wm-related info (see tkWm.c). For - * other windows, this is NULL. */ + struct TkWmInfo *wmInfoPtr; /* For top-level windows (and also for special + * Unix menubar and wrapper windows), points + * to structure with wm-related info (see + * tkWm.c). For other windows, this is NULL. */ /* * Information used by widget classes. @@ -827,18 +792,18 @@ typedef struct TkWindow { */ /* The remaining fields of internal border. */ - int internalBorderRight; + int internalBorderRight; int internalBorderTop; int internalBorderBottom; - + int minReqWidth; /* Minimum requested width. */ int minReqHeight; /* Minimum requested height. */ } TkWindow; /* - * The following structure is used as a two way map between integers - * and strings, usually to map between an internal C representation - * and the strings used in Tcl. + * The following structure is used as a two way map between integers and + * strings, usually to map between an internal C representation and the + * strings used in Tcl. */ typedef struct TkStateMap { @@ -847,8 +812,8 @@ typedef struct TkStateMap { } TkStateMap; /* - * This structure is used by the Mac and Window porting layers as - * the internal representation of a clip_mask in a GC. + * This structure is used by the Mac and Window porting layers as the internal + * representation of a clip_mask in a GC. */ typedef struct TkpClipMask { @@ -878,25 +843,24 @@ extern TkDisplay *tkDisplayList; #define TK_GRAB_EXCLUDED 3 /* - * The macro below is used to modify a "char" value (e.g. by casting - * it to an unsigned character) so that it can be used safely with - * macros such as isspace. + * The macro below is used to modify a "char" value (e.g. by casting it to an + * unsigned character) so that it can be used safely with macros such as + * isspace. */ #define UCHAR(c) ((unsigned char) (c)) /* - * The following symbol is used in the mode field of FocusIn events - * generated by an embedded application to request the input focus from - * its container. + * The following symbol is used in the mode field of FocusIn events generated + * by an embedded application to request the input focus from its container. */ #define EMBEDDED_APP_WANTS_FOCUS (NotifyNormal + 20) /* - * The following special modifier mask bits are defined, to indicate - * logical modifiers such as Meta and Alt that may float among the - * actual modifier bits. + * The following special modifier mask bits are defined, to indicate logical + * modifiers such as Meta and Alt that may float among the actual modifier + * bits. */ #define META_MASK (AnyModifier<<1) @@ -904,8 +868,8 @@ extern TkDisplay *tkDisplayList; #define EXTENDED_MASK (AnyModifier<<3) /* - * Object types not declared in tkObj.c need to be mentioned here so - * they can be properly registered with Tcl: + * Object types not declared in tkObj.c need to be mentioned here so they can + * be properly registered with Tcl: */ extern Tcl_ObjType tkBorderObjType; @@ -918,15 +882,14 @@ extern Tcl_ObjType tkStateKeyObjType; extern Tcl_ObjType tkTextIndexType; /* - * Miscellaneous variables shared among Tk modules but not exported - * to the outside world: + * Miscellaneous variables shared among Tk modules but not exported to the + * outside world: */ extern Tk_SmoothMethod tkBezierSmoothMethod; extern Tk_ImageType tkBitmapImageType; extern Tk_PhotoImageFormat tkImgFmtGIF; -extern void (*tkHandleEventProc) _ANSI_ARGS_(( - XEvent* eventPtr)); +extern void (*tkHandleEventProc) (XEvent* eventPtr); extern Tk_PhotoImageFormat tkImgFmtPPM; extern TkMainInfo *tkMainWindowList; extern Tk_ImageType tkPhotoImageType; @@ -936,265 +899,247 @@ extern int tkSendSerial; #include "tkIntDecls.h" #ifdef BUILD_tk -# undef TCL_STORAGE_CLASS -# define TCL_STORAGE_CLASS DLLEXPORT +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLEXPORT #endif /* - * Internal procedures shared among Tk modules but not exported - * to the outside world: + * Internal functions shared among Tk modules but not exported to the outside + * world: */ -EXTERN int Tk_BellObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_BindObjCmd _ANSI_ARGS_((ClientData clientData, +EXTERN int Tk_BellObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_BindtagsObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_BindObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_ButtonObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_BindtagsObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_CanvasObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_ButtonObjCmd(ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_CanvasObjCmd(ClientData clientData, Tcl_Interp *interp, int argc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_CheckbuttonObjCmd _ANSI_ARGS_(( - ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_CheckbuttonObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_ClipboardObjCmd _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tk_ChooseColorObjCmd _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tk_ChooseDirectoryObjCmd _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tk_ChooseFontObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_DestroyObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_EntryObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_EventObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_ClipboardObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_FileeventCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, char **argv)); -EXTERN int Tk_FrameObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_ChooseColorObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_FocusObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_FontObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_GetOpenFileObjCmd _ANSI_ARGS_(( - ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_GetSaveFileObjCmd _ANSI_ARGS_(( - ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_GrabObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_ChooseDirectoryObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_GridObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_ChooseFontObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_ImageObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_LabelObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_DestroyObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_LabelframeObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_EntryObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_ListboxObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_EventObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_LowerObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_FrameObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_MenubuttonObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_MessageBoxObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_MessageObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_FocusObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_PanedWindowObjCmd _ANSI_ARGS_(( - ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_FontObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_OptionObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_GetOpenFileObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_PackObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_GetSaveFileObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_PlaceObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_GrabObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_RadiobuttonObjCmd _ANSI_ARGS_(( - ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_GridObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_RaiseObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_ImageObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_ScaleObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_ScrollbarCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, CONST char **argv)); -EXTERN int Tk_SelectionObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_LabelObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_SendCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, CONST char **argv)); -EXTERN int Tk_SendObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_SpinboxObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_TextObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_LabelframeObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_TkObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_ListboxObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_TkwaitObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_LowerObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_ToplevelObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_MenubuttonObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_UpdateObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_WinfoObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_MessageBoxObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int Tk_WmObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_MessageObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); - -EXTERN void TkConsolePrint _ANSI_ARGS_((Tcl_Interp *interp, - int devId, CONST char *buffer, long size)); - -EXTERN void TkEventInit _ANSI_ARGS_((void)); - -EXTERN void TkRegisterObjTypes _ANSI_ARGS_((void)); - -EXTERN int TkCreateMenuCmd _ANSI_ARGS_((Tcl_Interp *interp)); -EXTERN int TkDeadAppCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, CONST char **argv)); - -EXTERN int TkpTestembedCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, CONST char **argv)); -EXTERN int TkCanvasGetCoordObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_PanedWindowObjCmd(ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_OptionObjCmd(ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_PackObjCmd(ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_PlaceObjCmd(ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_RadiobuttonObjCmd(ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_RaiseObjCmd(ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_ScaleObjCmd(ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_ScrollbarCmd(ClientData clientData, + Tcl_Interp *interp, int argc, CONST char **argv); +EXTERN int Tk_SelectionObjCmd(ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_SendCmd(ClientData clientData, + Tcl_Interp *interp, int argc, CONST char **argv); +EXTERN int Tk_SendObjCmd(ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_SpinboxObjCmd(ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_TextObjCmd(ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_TkObjCmd(ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_TkwaitObjCmd(ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_ToplevelObjCmd(ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_UpdateObjCmd(ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_WinfoObjCmd(ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[]); +EXTERN int Tk_WmObjCmd(ClientData clientData, Tcl_Interp *interp, + int objc, Tcl_Obj *CONST objv[]); + +EXTERN void TkConsolePrint(Tcl_Interp *interp, + int devId, CONST char *buffer, long size); +EXTERN void TkEventInit(void); +EXTERN void TkRegisterObjTypes(void); +EXTERN int TkCreateMenuCmd(Tcl_Interp *interp); +EXTERN int TkDeadAppCmd(ClientData clientData, + Tcl_Interp *interp, int argc, CONST char **argv); +EXTERN int TkpTestembedCmd(ClientData clientData, + Tcl_Interp *interp, int argc, CONST char **argv); +EXTERN int TkCanvasGetCoordObj(Tcl_Interp *interp, Tk_Canvas canvas, Tcl_Obj *obj, - double *doublePtr)); -EXTERN int TkCanvasDashParseProc _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, CONST char *value, char *widgRec, - int offset)); -EXTERN char * TkCanvasDashPrintProc _ANSI_ARGS_(( - ClientData clientData, Tk_Window tkwin, - char *widgRec, int offset, - Tcl_FreeProc **freeProcPtr)); -EXTERN int TkGetDoublePixels _ANSI_ARGS_((Tcl_Interp *interp, - Tk_Window tkwin, CONST char *string, - double *doublePtr)); -EXTERN int TkOffsetParseProc _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, CONST char *value, char *widgRec, - int offset)); -EXTERN char * TkOffsetPrintProc _ANSI_ARGS_(( - ClientData clientData, Tk_Window tkwin, - char *widgRec, int offset, - Tcl_FreeProc **freeProcPtr)); -EXTERN int TkOrientParseProc _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, CONST char *value, - char *widgRec, int offset)); -EXTERN char * TkOrientPrintProc _ANSI_ARGS_(( - ClientData clientData, Tk_Window tkwin, - char *widgRec, int offset, - Tcl_FreeProc **freeProcPtr)); -EXTERN int TkPixelParseProc _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, CONST char *value, char *widgRec, - int offset)); -EXTERN char * TkPixelPrintProc _ANSI_ARGS_(( - ClientData clientData, Tk_Window tkwin, - char *widgRec, int offset, - Tcl_FreeProc **freeProcPtr)); -EXTERN int TkPostscriptImage _ANSI_ARGS_((Tcl_Interp *interp, - Tk_Window tkwin, Tk_PostscriptInfo psInfo, - XImage *ximage, int x, int y, int width, - int height)); -EXTERN int TkSmoothParseProc _ANSI_ARGS_((ClientData clientData, + double *doublePtr); +EXTERN int TkCanvasDashParseProc(ClientData clientData, + Tcl_Interp *interp, Tk_Window tkwin, + CONST char *value, char *widgRec, int offset); +EXTERN char * TkCanvasDashPrintProc(ClientData clientData, + Tk_Window tkwin, char *widgRec, int offset, + Tcl_FreeProc **freeProcPtr); +EXTERN int TkGetDoublePixels(Tcl_Interp *interp, Tk_Window tkwin, + CONST char *string, double *doublePtr); +EXTERN int TkOffsetParseProc(ClientData clientData, + Tcl_Interp *interp, Tk_Window tkwin, + CONST char *value, char *widgRec, int offset); +EXTERN char * TkOffsetPrintProc(ClientData clientData, + Tk_Window tkwin, char *widgRec, int offset, + Tcl_FreeProc **freeProcPtr); +EXTERN int TkOrientParseProc(ClientData clientData, + Tcl_Interp *interp, Tk_Window tkwin, + CONST char *value, char *widgRec, int offset); +EXTERN char * TkOrientPrintProc(ClientData clientData, + Tk_Window tkwin, char *widgRec, int offset, + Tcl_FreeProc **freeProcPtr); +EXTERN int TkPixelParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, - CONST char *value, char *recordPtr, int offset)); -EXTERN char * TkSmoothPrintProc _ANSI_ARGS_((ClientData clientData, + CONST char *value, char *widgRec, int offset); +EXTERN char * TkPixelPrintProc(ClientData clientData, + Tk_Window tkwin, char *widgRec, int offset, + Tcl_FreeProc **freeProcPtr); +EXTERN int TkPostscriptImage(Tcl_Interp *interp, Tk_Window tkwin, + Tk_PostscriptInfo psInfo, XImage *ximage, + int x, int y, int width, int height); +EXTERN int TkSmoothParseProc(ClientData clientData, + Tcl_Interp *interp, Tk_Window tkwin, + CONST char *value, char *recordPtr, int offset); +EXTERN char * TkSmoothPrintProc(ClientData clientData, Tk_Window tkwin, char *recordPtr, int offset, - Tcl_FreeProc **freeProcPtr)); -EXTERN int TkStateParseProc _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, CONST char *value, - char *widgRec, int offset)); -EXTERN char * TkStatePrintProc _ANSI_ARGS_(( - ClientData clientData, Tk_Window tkwin, - char *widgRec, int offset, - Tcl_FreeProc **freeProcPtr)); -EXTERN int TkTileParseProc _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, CONST char *value, char *widgRec, - int offset)); -EXTERN char * TkTilePrintProc _ANSI_ARGS_(( - ClientData clientData, Tk_Window tkwin, + Tcl_FreeProc **freeProcPtr); +EXTERN int TkStateParseProc(ClientData clientData, + Tcl_Interp *interp, Tk_Window tkwin, + CONST char *value, char *widgRec, int offset); +EXTERN char * TkStatePrintProc(ClientData clientData, + Tk_Window tkwin, char *widgRec, int offset, + Tcl_FreeProc **freeProcPtr); +EXTERN int TkTileParseProc(ClientData clientData, + Tcl_Interp *interp, Tk_Window tkwin, + CONST char *value, char *widgRec, int offset); +EXTERN char * TkTilePrintProc(ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, - Tcl_FreeProc **freeProcPtr)); -EXTERN XEvent * TkpGetBindingXEvent _ANSI_ARGS_(( - Tcl_Interp *interp)); -EXTERN void TkCreateExitHandler _ANSI_ARGS_((Tcl_ExitProc *proc, - ClientData clientData)); -EXTERN void TkDeleteExitHandler _ANSI_ARGS_((Tcl_ExitProc *proc, - ClientData clientData)); + Tcl_FreeProc **freeProcPtr); +EXTERN XEvent * TkpGetBindingXEvent(Tcl_Interp *interp); +EXTERN void TkCreateExitHandler(Tcl_ExitProc *proc, + ClientData clientData); +EXTERN void TkDeleteExitHandler(Tcl_ExitProc *proc, + ClientData clientData); EXTERN Tcl_ExitProc TkFinalize; -EXTERN void TkpBuildRegionFromAlphaData _ANSI_ARGS_(( - TkRegion region, unsigned int x, unsigned int y, - unsigned int width, unsigned int height, - unsigned char *dataPtr, unsigned int pixelStride, - unsigned int lineStride)); -EXTERN void TkPrintPadAmount _ANSI_ARGS_((Tcl_Interp *interp, - char *buffer, int pad1, int pad2)); -EXTERN int TkParsePadAmount _ANSI_ARGS_((Tcl_Interp *interp, +EXTERN Tcl_ExitProc TkFinalizeThread; +EXTERN void TkpBuildRegionFromAlphaData(TkRegion region, + unsigned x, unsigned y, unsigned width, + unsigned height, unsigned char *dataPtr, + unsigned pixelStride, unsigned lineStride); +EXTERN void TkPrintPadAmount(Tcl_Interp *interp, + char *buffer, int pad1, int pad2); +EXTERN int TkParsePadAmount(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, - int *pad1Ptr, int *pad2Ptr)); + int *pad1Ptr, int *pad2Ptr); -/* +/* * Unsupported commands. */ -EXTERN int TkUnsupported1ObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj * CONST - objv[])); -# undef TCL_STORAGE_CLASS -# define TCL_STORAGE_CLASS DLLIMPORT +EXTERN int TkUnsupported1ObjCmd(ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj * CONST objv[]); + +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLIMPORT -#endif /* _TKINT */ +#endif /* _TKINT */ + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ diff --git a/generic/tkWindow.c b/generic/tkWindow.c index c652e34..390325e 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.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: tkWindow.c,v 1.68 2005/08/16 16:36:15 dkf Exp $ + * RCS: @(#) $Id: tkWindow.c,v 1.69 2005/09/21 10:54:40 dkf Exp $ */ #include "tkPort.h" @@ -2677,6 +2677,10 @@ DeleteWindowsExitProc(clientData) Tcl_Interp *interp; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData; + if (tsdPtr == NULL) { + return; + } + /* * Finish destroying any windows that are in a half-dead state. We must * protect the interpreter while destroying the window, because of @@ -3133,17 +3137,18 @@ Initialize(interp) */ code = TkpInit(interp); - if(code != TCL_OK) { + if (code != TCL_OK) { goto done; } /* - * Create exit handler to delete all windows when the application exits. - * This handler needs to be invoked before other platform specific - * cleanups take place to avoid panics in finalization. + * Create exit handlers to delete all windows when the application or + * thread exits. These handler need to be invoked before other platform + * specific cleanups take place to avoid panics in finalization. */ - TkCreateExitHandler(DeleteWindowsExitProc, (ClientData) tsdPtr); + TkCreateExitHandler(DeleteWindowsExitProc, (ClientData) NULL); + TkCreateThreadExitHandler(DeleteWindowsExitProc, (ClientData) tsdPtr); done: if (argv != NULL) { |