From f2a7f0b2fc26d79bebbcc94d45583f1e26bba46c Mon Sep 17 00:00:00 2001 From: hobbs Date: Tue, 10 Aug 1999 16:58:37 +0000 Subject: 1999-08-10 Jeff Hobbs * generic/tkInt.decls: added TkSetFocusWin * generic/tkFocus.c: changed static SetFocus to TkSetFocusWin --- generic/tkFocus.c | 17 ++++++++--------- generic/tkInt.decls | 6 +++++- generic/tkIntDecls.h | 10 +++++++++- generic/tkStubInit.c | 3 ++- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/generic/tkFocus.c b/generic/tkFocus.c index 31ca652..44756ef 100644 --- a/generic/tkFocus.c +++ b/generic/tkFocus.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkFocus.c,v 1.4 1999/04/16 01:51:14 stanton Exp $ + * RCS: @(#) $Id: tkFocus.c,v 1.5 1999/08/10 16:58:37 hobbs Exp $ */ #include "tkInt.h" @@ -95,7 +95,6 @@ static void FocusMapProc _ANSI_ARGS_((ClientData clientData, XEvent *eventPtr)); static void GenerateFocusEvents _ANSI_ARGS_((TkWindow *sourcePtr, TkWindow *destPtr)); -static void SetFocus _ANSI_ARGS_((TkWindow *winPtr, int force)); /* *-------------------------------------------------------------- @@ -164,7 +163,7 @@ Tk_FocusObjCmd(clientData, interp, objc, objv) return TCL_ERROR; } if (!(newPtr->flags & TK_ALREADY_DEAD)) { - SetFocus(newPtr, 0); + TkSetFocusWin(newPtr, 0); } return TCL_OK; } @@ -205,7 +204,7 @@ Tk_FocusObjCmd(clientData, interp, objc, objv) if (newPtr == NULL) { return TCL_ERROR; } - SetFocus(newPtr, 1); + TkSetFocusWin(newPtr, 1); break; } case 2: { /* -lastfor */ @@ -309,7 +308,7 @@ TkFocusFilterEvent(winPtr, eventPtr) if ((eventPtr->xfocus.mode == EMBEDDED_APP_WANTS_FOCUS) && (eventPtr->type == FocusIn)) { - SetFocus(winPtr, eventPtr->xfocus.detail); + TkSetFocusWin(winPtr, eventPtr->xfocus.detail); return 0; } @@ -530,7 +529,7 @@ TkFocusFilterEvent(winPtr, eventPtr) /* *---------------------------------------------------------------------- * - * SetFocus -- + * TkSetFocusWin -- * * This procedure is invoked to change the focus window for a * given display in a given application. @@ -545,8 +544,8 @@ TkFocusFilterEvent(winPtr, eventPtr) *---------------------------------------------------------------------- */ -static void -SetFocus(winPtr, force) +void +TkSetFocusWin(winPtr, force) TkWindow *winPtr; /* Window that is to be the new focus for * its display and application. */ int force; /* If non-zero, set the X focus to this @@ -959,7 +958,7 @@ FocusMapProc(clientData, eventPtr) Tk_DeleteEventHandler((Tk_Window) winPtr, VisibilityChangeMask, FocusMapProc, clientData); displayFocusPtr->focusOnMapPtr = NULL; - SetFocus(winPtr, displayFocusPtr->forceFocus); + TkSetFocusWin(winPtr, displayFocusPtr->forceFocus); } } diff --git a/generic/tkInt.decls b/generic/tkInt.decls index ed501e5..da74ef5 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -9,7 +9,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: tkInt.decls,v 1.10 1999/08/10 05:06:14 jingham Exp $ +# RCS: @(#) $Id: tkInt.decls,v 1.11 1999/08/10 16:58:37 hobbs Exp $ library tk @@ -615,6 +615,10 @@ declare 135 generic { int highlightWidth, Drawable drawable) } +declare 136 generic { + void TkSetFocusWin (TkWindow *winPtr, int force) +} + ############################################################################## # Define the platform specific internal Tcl interface. These functions are diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index 8aa82f7..8666b6a 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkIntDecls.h,v 1.7 1999/08/10 05:06:26 jingham Exp $ + * RCS: @(#) $Id: tkIntDecls.h,v 1.8 1999/08/10 16:58:37 hobbs Exp $ */ #ifndef _TKINTDECLS @@ -503,6 +503,9 @@ EXTERN void TkGenWMConfigureEvent _ANSI_ARGS_((Tk_Window tkwin, EXTERN void TkpDrawHighlightBorder _ANSI_ARGS_((Tk_Window tkwin, GC fgGC, GC bgGC, int highlightWidth, Drawable drawable)); +/* 136 */ +EXTERN void TkSetFocusWin _ANSI_ARGS_((TkWindow * winPtr, + int force)); typedef struct TkIntStubs { int magic; @@ -804,6 +807,7 @@ typedef struct TkIntStubs { void (*tkGenWMConfigureEvent) _ANSI_ARGS_((Tk_Window tkwin, int x, int y, int width, int height, int flags)); /* 134 */ #endif /* MAC_TCL */ void (*tkpDrawHighlightBorder) _ANSI_ARGS_((Tk_Window tkwin, GC fgGC, GC bgGC, int highlightWidth, Drawable drawable)); /* 135 */ + void (*tkSetFocusWin) _ANSI_ARGS_((TkWindow * winPtr, int force)); /* 136 */ } TkIntStubs; #ifdef __cplusplus @@ -1440,6 +1444,10 @@ extern TkIntStubs *tkIntStubsPtr; #define TkpDrawHighlightBorder \ (tkIntStubsPtr->tkpDrawHighlightBorder) /* 135 */ #endif +#ifndef TkSetFocusWin +#define TkSetFocusWin \ + (tkIntStubsPtr->tkSetFocusWin) /* 136 */ +#endif #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index c020383..278e1bf 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkStubInit.c,v 1.11 1999/08/10 05:07:06 jingham Exp $ + * RCS: @(#) $Id: tkStubInit.c,v 1.12 1999/08/10 16:58:38 hobbs Exp $ */ #include "tkInt.h" @@ -338,6 +338,7 @@ TkIntStubs tkIntStubs = { TkGenWMConfigureEvent, /* 134 */ #endif /* MAC_TCL */ TkpDrawHighlightBorder, /* 135 */ + TkSetFocusWin, /* 136 */ }; TkIntPlatStubs tkIntPlatStubs = { -- cgit v0.12