summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXWindowEvent.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-04-13 14:51:17 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-04-13 14:51:17 (GMT)
commit57c91ad391ab148036a5c6e4f0fdee7381352a85 (patch)
treee9f3f498ec12ff4c5603356d84573c8242a537e0 /macosx/tkMacOSXWindowEvent.c
parent59b73712486121720aa582183db730964dc8c8a9 (diff)
downloadtk-57c91ad391ab148036a5c6e4f0fdee7381352a85.zip
tk-57c91ad391ab148036a5c6e4f0fdee7381352a85.tar.gz
tk-57c91ad391ab148036a5c6e4f0fdee7381352a85.tar.bz2
Reduce the #ifdef count a lot by adding debug-print macros
Diffstat (limited to 'macosx/tkMacOSXWindowEvent.c')
-rw-r--r--macosx/tkMacOSXWindowEvent.c62
1 files changed, 30 insertions, 32 deletions
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c
index 1796cf3..a20ac8c 100644
--- a/macosx/tkMacOSXWindowEvent.c
+++ b/macosx/tkMacOSXWindowEvent.c
@@ -54,7 +54,7 @@
* software in accordance with the terms specified in this
* license.
*
- * RCS: @(#) $Id: tkMacOSXWindowEvent.c,v 1.18 2006/11/02 15:18:13 das Exp $
+ * RCS: @(#) $Id: tkMacOSXWindowEvent.c,v 1.19 2007/04/13 14:51:18 dkf Exp $
*/
#include "tkMacOSXInt.h"
@@ -203,39 +203,37 @@ TkMacOSXProcessWindowEvent(
sizeof(whichWindow), NULL,
&whichWindow);
if (status != noErr) {
-#ifdef TK_MAC_DEBUG
- fprintf ( stderr, "TkMacOSXHandleWindowEvent:Failed to retrieve window" );
-#endif
+ ERR_MSG("TkMacOSXHandleWindowEvent: Failed to retrieve window");
return 0;
}
-
+
window = TkMacOSXGetXWindow(whichWindow);
switch (eventPtr->eKind) {
- case kEventWindowActivated:
- eventFound |= GenerateActivateEvents(window, 1);
- eventFound |= TkMacOSXGenerateFocusEvent(window, 1);
- break;
- case kEventWindowDeactivated:
- eventFound |= GenerateActivateEvents(window, 0);
- eventFound |= TkMacOSXGenerateFocusEvent(window, 0);
- break;
- case kEventWindowUpdate:
- if (GenerateUpdateEvent(window)) {
- eventFound = true;
- }
- break;
- case kEventWindowExpanded: {
- TkDisplay *dispPtr;
- TkWindow *winPtr;
- dispPtr = TkGetDisplayList();
- winPtr = (TkWindow *)Tk_IdToWindow(dispPtr->display, window);
- if (winPtr) {
- TkpWmSetState(winPtr, TkMacOSXIsWindowZoomed(winPtr) ?
- ZoomState : NormalState);
- }
- break;
- }
+ case kEventWindowActivated:
+ eventFound |= GenerateActivateEvents(window, 1);
+ eventFound |= TkMacOSXGenerateFocusEvent(window, 1);
+ break;
+ case kEventWindowDeactivated:
+ eventFound |= GenerateActivateEvents(window, 0);
+ eventFound |= TkMacOSXGenerateFocusEvent(window, 0);
+ break;
+ case kEventWindowUpdate:
+ if (GenerateUpdateEvent(window)) {
+ eventFound = true;
+ }
+ break;
+ case kEventWindowExpanded: {
+ TkDisplay *dispPtr = TkGetDisplayList();
+ TkWindow *winPtr = (TkWindow *)
+ Tk_IdToWindow(dispPtr->display, window);
+
+ if (winPtr) {
+ TkpWmSetState(winPtr, TkMacOSXIsWindowZoomed(winPtr) ?
+ ZoomState : NormalState);
+ }
+ break;
+ }
}
return 0;
}
@@ -245,10 +243,10 @@ TkMacOSXProcessWindowEvent(
*
* GenerateUpdateEvent --
*
- * Given a Macintosh window update event this function generates
- * all the Expose XEvents needed by Tk.
+ * Given a Macintosh window update event this function generates all the
+ * Expose XEvents needed by Tk.
*
- * Results:
+ * Results:
* True if event(s) are generated - false otherwise.
*
* Side effects: