summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordas <das>2005-08-09 07:39:17 (GMT)
committerdas <das>2005-08-09 07:39:17 (GMT)
commit98ee99c4ea859910fb13d480bfb6d70fe49fc7ab (patch)
tree11ef5d94364dc21d07c4385f19dd7d1f05b2e847 /generic
parenta33da75b8587cfad8d92ba670a716663fc557192 (diff)
downloadtk-98ee99c4ea859910fb13d480bfb6d70fe49fc7ab.zip
tk-98ee99c4ea859910fb13d480bfb6d70fe49fc7ab.tar.gz
tk-98ee99c4ea859910fb13d480bfb6d70fe49fc7ab.tar.bz2
* macosx/tkMacOSXCarbonEvents.c (AppEventHandlerProc): handle carbon
events sent directly to application event target via the general TkMacOSXProcessEvent() in the same way as events posted to the event loop. Moved existing app event handlers to tkMacOSXWindowEvent.c. (TkMacOSXInitCarbonEvents): register our application event handler for kEventWindowExpanded events to deal with uncollapsing from the dock. * macosx/tkMacOSXEvent.h: made TkMacOSXProcessEvent() non-static, added * macosx/tkMacOSXEvent.c: new interp field to TkMacOSXEvent struct for use by app event handler. * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): retrieve current window, partCode, modifiers and local cursor position from carbon mouse event if possible. Use new static GenerateButtonEvent() taking a MouseEventData struct instead of TkGenerateButtonEvent() to avoid recomputing already known values. Move process activation on MouseDown into BringWindowForward() to allow clicking on window titlebar widgets without activating process. Move code dealing with clicks in window titelbar into separate function HandleWindowTitlebarMouseDown() to avoid code duplication. Avoid repeated calls to TkMacOSXGetXWindow() by storing result in MouseEventData struct. (TkMacOSXButtonKeyState, XQueryPointer): try to get button and modifier state from currently processed carbon event (to avoid unnecessary IPC with the window server), otherwise use modern carbon API to get this info instead of Button() and GetKeys(); only retrieve info caller asks for (via non-NULL ptr passed to XQueryPointer). (ButtonModifiers2State): new static function converting carbon button and modifier state into tk state, allows detection of more than 3 mouse buttons (tk supports up to 5) and of NumLock and Fn modifier keys (NumLock is mapped to Mod3 and Fn to Mod4). * macosx/tkMacOSXWindowEvent.c (TkMacOSXProcessApplicationEvent): handle kEventWindowExpanded event to deal with window uncollapsing from the dock by generating tk Map event, handle kEventAppHidden and kEventAppShown events (moved here from tkMacOSXCarbonEvents.c). * macosx/tkMacOSXSubwindows.c (XUnmapWindow): only hide window when it is not iconified to avoid window flashing on collapse. * macosx/tkMacOSXWm.c: replaced Tk_DoWhenIdle() by Tcl_DoWhenIdle(). (TkMacOSXZoomToplevel): remove call to TrackBox(), now done in HandleWindowTitlebarMouseDown() in tkMacOSXMouseEvent.c. (TkpWmSetState): avoid window flashing on collapse by unmapping after calling CollapseWindow(); only uncollapse window if it is collapsed. * generic/tkInt.decls: changed TkMacOSXZoomToplevel() signature. * generic/tkIntPlatDecls.h: * macosx/tkMacOSXKeyEvent.c (TkMacOSXProcessKeyboardEvent): only call GetMenuItemCommandID() on KeyDown or KeyRepeat events. * macosx/tkMacOSXMenu.c (ReconfigureMacintoshMenu): remove call to obsolete AppendResMenu() API. * macosx/tkMacOSXKeyEvent.c: replaced all direct uses of expensive * macosx/tkMacOSXMenu.c: GetMouse() and TkMacOSXButtonKeyState() * macosx/tkMacOSXMenus.c: APIs by calls to XQueryPointer() * macosx/tkMacOSXMouseEvent.c: * macosx/tkMacOSXScale.c: * macosx/tkMacOSXScrlbr.c: * macosx/tkMacOSXWm.c: * macosx/tkMacOSXDialog.c: replaced use of FrontNonFloatingWindow() * macosx/tkMacOSXKeyEvent.c: by ActiveNonFloatingWindow() as * macosx/tkMacOSXMenu.c: recommended by Carbon docs. * macosx/tkMacOSXMenus.c: * macosx/tkMacOSXSubwindows.c: * macosx/tkMacOSXWm.c: * macosx/tkMacOSXDialog.c: fixed warnings * macosx/tkMacOSXTest.c: * macosx/tkMacOSXCarbonEvents.c: added CVS Id line to file header. * macosx/tkMacOSXDebug.c: * macosx/tkMacOSXDebug.h: * macosx/tkMacOSXEntry.c: * macosx/tkMacOSXEvent.h: * macosx/tkMacOSXKeyEvent.c: * macosx/tkMacOSXMouseEvent.c: * macosx/tkMacOSXWindowEvent.c: * macosx/tkMacOSXWm.h: * macosx/tkMacOSXInt.h: declare macosx internal procs as MODULE_SCOPE. * macosx/tkMacOSXCarbonEvents.c: * macosx/tkMacOSXDraw.c: * macosx/tkMacOSXFont.c: * macosx/tkMacOSXHLEvents.c: * macosx/tkMacOSXInit.c: * macosx/tkMacOSXWindowEvent.c * library/bgerror.tcl: sync with core-8-4-branch changes of 2005-07-28. * macosx/tkMacOSXDraw.c: * macosx/tkMacOSXWm.c: * macosx/tkMacOSXMouseEvent.c: * generic/tkFrame.c: sync with core-8-4-branch changes of 2005-07-27. * generic/tkIntDecls.h: * generic/tkStubInit.c: * generic/tkFrame.c: * win/tkWinDraw.c: * unix/tkUnixDraw.c: * macosx/tkMacOSXDraw.c: * macosx/tkMacOSXInt.h: * macosx/tkMacOSXWm.c: * macosx/tkMacOSXSubwindows.c: * macosx/tkMacOSXButton.c: sync with core-8-4-branch. * macosx/tkMacOSXEntry.c: * macosx/tkMacOSXScale.c: * library/demos/menu.tcl: removed errant '}'.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkFrame.c10
-rw-r--r--generic/tkInt.decls9
-rw-r--r--generic/tkIntDecls.h14
-rw-r--r--generic/tkIntPlatDecls.h7
-rw-r--r--generic/tkStubInit.c3
5 files changed, 29 insertions, 14 deletions
diff --git a/generic/tkFrame.c b/generic/tkFrame.c
index d567815..f116f6c 100644
--- a/generic/tkFrame.c
+++ b/generic/tkFrame.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkFrame.c,v 1.20 2005/01/10 04:15:02 chengyemao Exp $
+ * RCS: @(#) $Id: tkFrame.c,v 1.21 2005/08/09 07:39:17 das Exp $
*/
#include "default.h"
@@ -1439,14 +1439,12 @@ DisplayFrame(clientData)
if (framePtr->type != TYPE_LABELFRAME) {
/*
- * There is no label so there is just a simple rectangle to draw.
+ * Pass to platform specific draw function. In general, it just
+ * draws a simple rectangle, but it may "theme" the background.
*/
noLabel:
- Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin),
- framePtr->border, hlWidth, hlWidth,
- Tk_Width(tkwin) - 2 * hlWidth,
- Tk_Height(tkwin) - 2 * hlWidth,
+ TkpDrawFrame(tkwin, framePtr->border, hlWidth,
framePtr->borderWidth, framePtr->relief);
} else {
Labelframe *labelframePtr = (Labelframe *) framePtr;
diff --git a/generic/tkInt.decls b/generic/tkInt.decls
index eb37556..2b9c7dd 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.38 2004/10/27 00:56:33 davygrvy Exp $
+# RCS: @(#) $Id: tkInt.decls,v 1.39 2005/08/09 07:39:17 das Exp $
library tk
@@ -644,6 +644,11 @@ declare 151 generic {
Tk_Canvas canvas, double *pointPtr, int numPoints)
}
+declare 152 generic {
+ void TkpDrawFrame(Tk_Window tkwin, Tk_3DBorder border,
+ int highlightWidth, int borderWidth, int relief)
+}
+
##############################################################################
# Define the platform specific internal Tcl interface. These functions are
@@ -1031,7 +1036,7 @@ declare 40 aqua {
}
declare 41 aqua {
- int TkMacOSXZoomToplevel (WindowPtr whichWindow, Point where, short zoomPart)
+ int TkMacOSXZoomToplevel (WindowPtr whichWindow, short zoomPart)
}
declare 42 aqua {
diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h
index bc9de70..ad29720 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.25 2004/08/19 14:43:42 dkf Exp $
+ * RCS: @(#) $Id: tkIntDecls.h,v 1.26 2005/08/09 07:39:18 das Exp $
*/
#ifndef _TKINTDECLS
@@ -959,6 +959,13 @@ EXTERN void TkMakeRawCurvePostscript _ANSI_ARGS_((
Tcl_Interp * interp, Tk_Canvas canvas,
double * pointPtr, int numPoints));
#endif
+#ifndef TkpDrawFrame_TCL_DECLARED
+#define TkpDrawFrame_TCL_DECLARED
+/* 152 */
+EXTERN void TkpDrawFrame _ANSI_ARGS_((Tk_Window tkwin,
+ Tk_3DBorder border, int highlightWidth,
+ int borderWidth, int relief));
+#endif
typedef struct TkIntStubs {
int magic;
@@ -1204,6 +1211,7 @@ typedef struct TkIntStubs {
CONST Tk_OptionSpec * (*tkGetOptionSpec) _ANSI_ARGS_((CONST char * name, Tk_OptionTable optionTable)); /* 149 */
int (*tkMakeRawCurve) _ANSI_ARGS_((Tk_Canvas canvas, double * pointPtr, int numPoints, int numSteps, XPoint xPoints[], double dblPoints[])); /* 150 */
void (*tkMakeRawCurvePostscript) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, double * pointPtr, int numPoints)); /* 151 */
+ void (*tkpDrawFrame) _ANSI_ARGS_((Tk_Window tkwin, Tk_3DBorder border, int highlightWidth, int borderWidth, int relief)); /* 152 */
} TkIntStubs;
#ifdef __cplusplus
@@ -1859,6 +1867,10 @@ extern TkIntStubs *tkIntStubsPtr;
#define TkMakeRawCurvePostscript \
(tkIntStubsPtr->tkMakeRawCurvePostscript) /* 151 */
#endif
+#ifndef TkpDrawFrame
+#define TkpDrawFrame \
+ (tkIntStubsPtr->tkpDrawFrame) /* 152 */
+#endif
#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */
diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h
index 1c6cbd9..a21f92b 100644
--- a/generic/tkIntPlatDecls.h
+++ b/generic/tkIntPlatDecls.h
@@ -9,7 +9,7 @@
* Copyright (c) 1998-1999 by Scriptics Corporation.
* All rights reserved.
*
- * RCS: @(#) $Id: tkIntPlatDecls.h,v 1.22 2005/05/29 06:47:04 das Exp $
+ * RCS: @(#) $Id: tkIntPlatDecls.h,v 1.23 2005/08/09 07:39:18 das Exp $
*/
#ifndef _TKINTPLATDECLS
@@ -438,8 +438,7 @@ EXTERN void TkSuspendClipboard _ANSI_ARGS_((void));
#define TkMacOSXZoomToplevel_TCL_DECLARED
/* 41 */
EXTERN int TkMacOSXZoomToplevel _ANSI_ARGS_((
- WindowPtr whichWindow, Point where,
- short zoomPart));
+ WindowPtr whichWindow, short zoomPart));
#endif
#ifndef Tk_TopCoordsToWindow_TCL_DECLARED
#define Tk_TopCoordsToWindow_TCL_DECLARED
@@ -654,7 +653,7 @@ typedef struct TkIntPlatStubs {
int (*tkSetMacColor) _ANSI_ARGS_((unsigned long pixel, RGBColor * macColor)); /* 38 */
void (*tkSetWMName) _ANSI_ARGS_((TkWindow * winPtr, Tk_Uid titleUid)); /* 39 */
void (*tkSuspendClipboard) _ANSI_ARGS_((void)); /* 40 */
- int (*tkMacOSXZoomToplevel) _ANSI_ARGS_((WindowPtr whichWindow, Point where, short zoomPart)); /* 41 */
+ int (*tkMacOSXZoomToplevel) _ANSI_ARGS_((WindowPtr whichWindow, short zoomPart)); /* 41 */
Tk_Window (*tk_TopCoordsToWindow) _ANSI_ARGS_((Tk_Window tkwin, int rootX, int rootY, int * newX, int * newY)); /* 42 */
MacDrawable * (*tkMacOSXContainerId) _ANSI_ARGS_((TkWindow * winPtr)); /* 43 */
MacDrawable * (*tkMacOSXGetHostToplevel) _ANSI_ARGS_((TkWindow * winPtr)); /* 44 */
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index bc415e5..508b415 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.50 2005/05/29 06:47:05 das Exp $
+ * RCS: @(#) $Id: tkStubInit.c,v 1.51 2005/08/09 07:39:19 das Exp $
*/
#include "tkInt.h"
@@ -294,6 +294,7 @@ TkIntStubs tkIntStubs = {
TkGetOptionSpec, /* 149 */
TkMakeRawCurve, /* 150 */
TkMakeRawCurvePostscript, /* 151 */
+ TkpDrawFrame, /* 152 */
};
TkIntPlatStubs tkIntPlatStubs = {