diff options
Diffstat (limited to 'win/tkWinEmbed.c')
-rw-r--r-- | win/tkWinEmbed.c | 76 |
1 files changed, 41 insertions, 35 deletions
diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c index 36c6047..34cd8ca 100644 --- a/win/tkWinEmbed.c +++ b/win/tkWinEmbed.c @@ -6,7 +6,7 @@ * one application can use as its main window an internal window from * another application). * - * Copyright (c) 1996-1997 Sun Microsystems, Inc. + * Copyright © 1996-1997 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -41,7 +41,7 @@ typedef struct { } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; -static void ContainerEventProc(ClientData clientData, +static void ContainerEventProc(void *clientData, XEvent *eventPtr); static void EmbedGeometryRequest(Container *containerPtr, int width, int height); @@ -69,7 +69,7 @@ void TkWinCleanupContainerList(void) { Container *nextPtr; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); for (; tsdPtr->firstContainerPtr != NULL; @@ -96,14 +96,18 @@ TkWinCleanupContainerList(void) *---------------------------------------------------------------------- */ - /* ARGSUSED */ int TkpTestembedCmd( - ClientData clientData, + void *dummy, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { + (void)dummy; + (void)interp; + (void)objc; + (void)objv; + return TCL_OK; } @@ -160,7 +164,7 @@ void Tk_MapEmbeddedWindow( { if(!(winPtr->flags & TK_ALREADY_DEAD)) { HWND hwnd = (HWND)winPtr->privatePtr; - int state = SendMessageW(hwnd, TK_STATE, -1, -1) - 1; + int state = SendMessageW(hwnd, TK_STATE, -1, (WPARAM)-1) - 1; if (state < 0 || state > 3) { state = NormalState; @@ -173,13 +177,13 @@ void Tk_MapEmbeddedWindow( TkpWmSetState(winPtr, state); TkWmMapWindow(winPtr); } - Tcl_Release((ClientData)winPtr); + Tcl_Release(winPtr); } /* *---------------------------------------------------------------------- * - * TkpUseWindow -- + * Tk_UseWindow -- * * This procedure causes a Tk window to use a given Windows handle for a * window as its underlying window, rather than a new Windows window @@ -225,7 +229,7 @@ void Tk_MapEmbeddedWindow( */ int -TkpUseWindow( +Tk_UseWindow( Tcl_Interp *interp, /* If not NULL, used for error reporting if * string is bogus. */ Tk_Window tkwin, /* Tk window that does not yet have an @@ -244,7 +248,7 @@ TkpUseWindow( /* if (winPtr->window != None) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "can't modify container after widget is created", -1)); + "can't modify container after widget is created", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "EMBED", "POST_CREATE", NULL); return TCL_ERROR; } @@ -287,13 +291,13 @@ TkpUseWindow( if (id == PTR2INT(hwnd)) { if (!SendMessageW(hwnd, TK_INFO, TK_CONTAINER_ISAVAILABLE, 0)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "The container is already in use", -1)); + "The container is already in use", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "EMBED", "IN_USE", NULL); return TCL_ERROR; } } else if (id == -PTR2INT(hwnd)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "the window to use is not a Tk container", -1)); + "the window to use is not a Tk container", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "EMBED", "CONTAINER", NULL); return TCL_ERROR; } else { @@ -309,7 +313,7 @@ TkpUseWindow( if (IDCANCEL == MessageBoxW(hwnd, msg, L"Tk Warning", MB_OKCANCEL | MB_ICONWARNING)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "Operation has been canceled", -1)); + "Operation has been canceled", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "EMBED", "CANCEL", NULL); return TCL_ERROR; } @@ -331,8 +335,8 @@ TkpUseWindow( * window. */ - Tcl_Preserve((ClientData) winPtr); - Tcl_DoWhenIdle((Tcl_IdleProc*) Tk_MapEmbeddedWindow, (ClientData) winPtr); + Tcl_Preserve(winPtr); + Tcl_DoWhenIdle((Tcl_IdleProc*) Tk_MapEmbeddedWindow, winPtr); return TCL_OK; } @@ -340,7 +344,7 @@ TkpUseWindow( /* *---------------------------------------------------------------------- * - * TkpMakeContainer -- + * Tk_MakeContainer -- * * This procedure is called to indicate that a particular window will be * a container for an embedded application. This changes certain aspects @@ -357,7 +361,7 @@ TkpUseWindow( */ void -TkpMakeContainer( +Tk_MakeContainer( Tk_Window tkwin) { TkWindow *winPtr = (TkWindow *) tkwin; @@ -371,7 +375,7 @@ TkpMakeContainer( */ Tk_MakeWindowExist(tkwin); - containerPtr = ckalloc(sizeof(Container)); + containerPtr = (Container *)ckalloc(sizeof(Container)); containerPtr->parentPtr = winPtr; containerPtr->parentHWnd = Tk_GetHWND(Tk_WindowId(tkwin)); containerPtr->embeddedHWnd = NULL; @@ -392,7 +396,7 @@ TkpMakeContainer( */ Tk_CreateEventHandler(tkwin, StructureNotifyMask, - ContainerEventProc, (ClientData) containerPtr); + ContainerEventProc, containerPtr); } /* @@ -849,7 +853,7 @@ EmbedGeometryRequest( static void ContainerEventProc( - ClientData clientData, /* Token for container window. */ + void *clientData, /* Token for container window. */ XEvent *eventPtr) /* ResizeRequest event. */ { Container *containerPtr = (Container *)clientData; @@ -858,12 +862,12 @@ ContainerEventProc( if (eventPtr->type == ConfigureNotify) { /* - * Send a ConfigureNotify to the embedded application. - */ + * Send a ConfigureNotify to the embedded application. + */ - if (containerPtr->embeddedPtr != NULL) { - TkDoConfigureNotify(containerPtr->embeddedPtr); - } + if (containerPtr->embeddedPtr != NULL) { + TkDoConfigureNotify(containerPtr->embeddedPtr); + } /* * Resize the embedded window, if there is any. @@ -885,13 +889,13 @@ ContainerEventProc( /* *---------------------------------------------------------------------- * - * TkpGetOtherWindow -- + * Tk_GetOtherWindow -- * * If both the container and embedded window are in the same process, * this procedure will return either one, given the other. * * Results: - * If winPtr is a container, the return value is the token for the + * If tkwin is a container, the return value is the token for the * embedded window, and vice versa. If the "other" window isn't in this * process, NULL is returned. * @@ -901,9 +905,9 @@ ContainerEventProc( *---------------------------------------------------------------------- */ -TkWindow * -TkpGetOtherWindow( - TkWindow *winPtr) /* Tk's structure for a container or embedded +Tk_Window +Tk_GetOtherWindow( + Tk_Window tkwin) /* Tk's structure for a container or embedded * window. */ { Container *containerPtr; @@ -912,10 +916,10 @@ TkpGetOtherWindow( for (containerPtr = tsdPtr->firstContainerPtr; containerPtr != NULL; containerPtr = containerPtr->nextPtr) { - if (containerPtr->embeddedPtr == winPtr) { - return containerPtr->parentPtr; - } else if (containerPtr->parentPtr == winPtr) { - return containerPtr->embeddedPtr; + if ((Tk_Window)containerPtr->embeddedPtr == tkwin) { + return (Tk_Window)containerPtr->parentPtr; + } else if ((Tk_Window)containerPtr->parentPtr == tkwin) { + return (Tk_Window)containerPtr->embeddedPtr; } } return NULL; @@ -1050,6 +1054,8 @@ TkpRedirectKeyEvent( XEvent *eventPtr) /* X event to redirect (should be KeyPress or * KeyRelease). */ { + (void)winPtr; + (void)eventPtr; /* not implemented */ } |