diff options
-rw-r--r-- | generic/tk.decls | 1 | ||||
-rw-r--r-- | generic/tkStubInit.c | 10 | ||||
-rw-r--r-- | macosx/tkMacOSXDialog.c | 11 | ||||
-rw-r--r-- | macosx/tkMacOSXDraw.c | 12 | ||||
-rw-r--r-- | macosx/tkMacOSXInt.h | 3 | ||||
-rw-r--r-- | macosx/tkMacOSXMouseEvent.c | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXSubwindows.c | 16 |
7 files changed, 27 insertions, 30 deletions
diff --git a/generic/tk.decls b/generic/tk.decls index d99aae9..e1e2b5d 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -1142,7 +1142,6 @@ declare 10 aqua { declare 11 aqua { Tk_Window Tk_MacOSXGetTkWindow(void *w) } -# Replaces TkMacOSXGetDrawablePort declare 12 aqua { void *Tk_MacOSXGetCGContextForDrawable(Drawable drawable) } diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 59c7d0e..a82903f 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -24,6 +24,7 @@ #if defined(MAC_OSX_TK) /* we could have used _TKMACINT */ #include "tkMacOSXInt.h" +#include "tkMacOSXPrivate.h" #endif /* TODO: These ought to come in some other way */ @@ -57,7 +58,14 @@ MODULE_SCOPE const TkStubs tkStubs; #define TkpTestsendCmd_ TkpTestsendCmd #define TkGenWMConfigureEvent_ TkGenWMConfigureEvent #define TkGenerateActivateEvents_ TkGenerateActivateEvents -#define Tk_MacOSXGetNSWindowForDrawable TkMacOSXDrawable + +#if defined(MAC_OSX_TK) +# define Tk_MacOSXGetNSWindowForDrawable TkMacOSXDrawable +# define Tk_MacOSXGetCGContextForDrawable GetCGContextForDrawable +static void *GetCGContextForDrawable(Drawable d) { + return TkMacOSXGetCGContextForDrawable(d); +} +#endif #ifdef _WIN32 diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index b7475e2..c2b1b15 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -647,7 +647,6 @@ Tk_GetOpenFileObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = clientData; - TkWindow *winPtr = clientData; char *str; int i, result = TCL_ERROR, haveParentOption = 0; int index, len, multiple = 0; @@ -819,7 +818,7 @@ Tk_GetOpenFileObjCmd( [openpanel setDirectoryURL:fileURL]; } if (haveParentOption) { - parent = TkMacOSXGetNSWindowForDrawable(winPtr->window); + parent = TkMacOSXGetNSWindowForDrawable(((TkWindow *)tkwin)->window); parentIsKey = parent && [parent isKeyWindow]; } else { parent = nil; @@ -919,7 +918,6 @@ Tk_GetSaveFileObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window)clientData; - TkWindow *winPtr = clientData; char *str; int i, result = TCL_ERROR, haveParentOption = 0; int confirmOverwrite = 1; @@ -1106,7 +1104,7 @@ Tk_GetSaveFileObjCmd( [savepanel setNameFieldStringValue:@""]; } if (haveParentOption) { - parent = TkMacOSXGetNSWindowForDrawable(winPtr->window); + parent = TkMacOSXGetNSWindowForDrawable(((TkWindow *)tkwin)->window); parentIsKey = parent && [parent isKeyWindow]; } else { parent = nil; @@ -1162,7 +1160,6 @@ Tk_ChooseDirectoryObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window)clientData; - TkWindow *winPtr = clientData; char *str; int i, result = TCL_ERROR, haveParentOption = 0; int index, len, mustexist = 0; @@ -1249,10 +1246,10 @@ Tk_ChooseDirectoryObjCmd( if (!directory) { directory = @"/"; } - parent = TkMacOSXGetNSWindowForDrawable(winPtr->window); + parent = TkMacOSXGetNSWindowForDrawable(((TkWindow *)tkwin)->window); [panel setDirectoryURL:[NSURL fileURLWithPath:directory isDirectory:YES]]; if (haveParentOption) { - parent = TkMacOSXGetNSWindowForDrawable(winPtr->window); + parent = TkMacOSXGetNSWindowForDrawable(((TkWindow *)tkwin)->window); parentIsKey = parent && [parent isKeyWindow]; } else { parent = nil; diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 3e219fc..06d1810 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -226,10 +226,9 @@ CreateNSImageFromPixmap( /* *---------------------------------------------------------------------- * - * TkMacOSXGetCGContextForDrawable / Tk_MacOSXGetCGContextForDrawable -- + * TkMacOSXGetCGContextForDrawable -- * - * Get CGContext for given Drawable, creating one if necessary. The - * Tk_ version is exported as a stub returning a void *. + * Get CGContext for given Drawable, creating one if necessary. * * Results: * CGContext. @@ -286,13 +285,6 @@ TkMacOSXGetCGContextForDrawable( return (macDraw ? macDraw->context : NULL); } - -void * -Tk_MacOSXGetCGContextForDrawable( - Drawable drawable) -{ - return TkMacOSXGetCGContextForDrawable(drawable); -} /* *---------------------------------------------------------------------- diff --git a/macosx/tkMacOSXInt.h b/macosx/tkMacOSXInt.h index 475a6d2..278fcac 100644 --- a/macosx/tkMacOSXInt.h +++ b/macosx/tkMacOSXInt.h @@ -187,8 +187,7 @@ MODULE_SCOPE void TkpFreeGCCache(GC gc); #define TK_DRAW_IN_CONTEXT 1 /* - * Prototypes of internal procs that are called from generic or test - * code but are not in the stubs table. + * Prototypes of internal procs not in the stubs table. */ MODULE_SCOPE void TkMacOSXDefaultStartupScript(void); diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index 613c6f9..805b028 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -148,8 +148,8 @@ enum { */ if (!tkwin) { - tkwin = Tk_MacOSXGetTkWindow(eventWindow); - winPtr = (TkWindow *)tkwin; + winPtr = TkMacOSXGetTkWindow(eventWindow); + tkwin = (Tk_Window)winPtr; } if (!tkwin) { diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 832782e..002eae6 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -1135,15 +1135,17 @@ TkMacOSXGetDrawablePort( /* *---------------------------------------------------------------------- * - * Tk_MacOSXGetNSViewForDrawable -- + * TkMacOSXGetNSViewForDrawable/TkMacOSXGetRootControl -- + * + * The function name TkMacOSXGetRootControl is being preserved only + * because it exists in a stubs table. Nobody knows what it means to + * get a "RootControl". The macro TkMacOSXGetNSViewForDrawable calls + * this function and should always be used rather than directly using + * the obscure official name of this function. * * It returns the NSView for a given X drawable in the case that the * drawable is a window. If the drawable is a pixmap it returns nil. * - * The macro TkMacOSXGetNSViewForDrawable calls - * this function and should always be used rather than directly using - * the official name of this function. - * * Results: * A NSView* or nil. * @@ -1154,7 +1156,7 @@ TkMacOSXGetDrawablePort( */ void * -Tk_MacOSXGetNSViewForDrawable( +TkMacOSXGetRootControl( Drawable drawable) { void *result = NULL; @@ -1170,7 +1172,7 @@ Tk_MacOSXGetNSViewForDrawable( TkWindow *contWinPtr = TkpGetOtherWindow(macWin->toplevel->winPtr); if (contWinPtr) { - result = TkMacOSXGetNSViewForDrawable(contWinPtr->window); + result = TkMacOSXGetRootControl((Drawable)contWinPtr->privatePtr); } } return result; |