summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordas <das>2005-08-09 07:39:48 (GMT)
committerdas <das>2005-08-09 07:39:48 (GMT)
commitb8c4ee9a5df85da2ac51dfea85177ffa458c2a50 (patch)
treeb77a27b7d580d802ccbfcb5442bba1206c3ff248 /generic
parentce8d7d22d0f5eb10e00df422dffb587c95481678 (diff)
downloadtk-b8c4ee9a5df85da2ac51dfea85177ffa458c2a50.zip
tk-b8c4ee9a5df85da2ac51dfea85177ffa458c2a50.tar.gz
tk-b8c4ee9a5df85da2ac51dfea85177ffa458c2a50.tar.bz2
* macosx/tkMacOSXCarbonEvents.c (new): moved carbon events code into
* macosx/tkMacOSXHLEvents.c: new file like on HEAD, * macosx/tkMacOSXInit.c (TkpInit): initialize carbon event handlers * macosx/tkMacOSXInt.h: in TkpInit(), add new source * unix/Makefile.in: file to Makefile.in. * 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/tkMacOSXEmbed.c: replaced all uses of panic() with Tcl_Panic() * macosx/tkMacOSXFont.c: (sync with HEAD). * macosx/tkMacOSXMenus.c: * macosx/tkMacOSXSubwindows.c: * macosx/tkMacOSXWm.c: * macosx/tkMacOSXXStubs.c: * macosx/tkMacOSXInt.h: sync with HEAD changes of 2005-03-14. * macosx/tkMacOSXSubwindows.c: * macosx/tclets.r (removed): sync with HEAD. * macosx/tkMacOSXScale.c: * macosx/tkMacOSXPort.h: * library/demos/menu.tcl: removed errant '}'.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkInt.decls4
-rw-r--r--generic/tkIntPlatDecls.h7
2 files changed, 5 insertions, 6 deletions
diff --git a/generic/tkInt.decls b/generic/tkInt.decls
index 2410c92..1d756f3 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.33.2.4 2005/07/28 04:57:38 hobbs Exp $
+# RCS: @(#) $Id: tkInt.decls,v 1.33.2.5 2005/08/09 07:39:51 das Exp $
library tk
@@ -1322,7 +1322,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/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h
index d31fb74..33bfc98 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.15.2.2 2004/10/27 00:35:53 davygrvy Exp $
+ * RCS: @(#) $Id: tkIntPlatDecls.h,v 1.15.2.3 2005/08/09 07:39:51 das Exp $
*/
#ifndef _TKINTPLATDECLS
@@ -362,8 +362,7 @@ EXTERN void TkSetWMName _ANSI_ARGS_((TkWindow * winPtr,
EXTERN void TkSuspendClipboard _ANSI_ARGS_((void));
/* 41 */
EXTERN int TkMacOSXZoomToplevel _ANSI_ARGS_((
- WindowPtr whichWindow, Point where,
- short zoomPart));
+ WindowPtr whichWindow, short zoomPart));
/* 42 */
EXTERN Tk_Window Tk_TopCoordsToWindow _ANSI_ARGS_((Tk_Window tkwin,
int rootX, int rootY, int * newX, int * newY));
@@ -577,7 +576,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 */