add space between function arguments for readability

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@24441 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2007-01-31 14:04:20 +00:00
parent cb05788788
commit d530f8e5ba
11 changed files with 291 additions and 296 deletions

View file

@ -51,12 +51,12 @@
return output; return output;
} }
[output appendFormat:@"%d From the EventQue\n-> ",c]; [output appendFormat:@"%d From the EventQue\n-> ", c];
for (i=0;i<c;i++) for (i=0;i<c;i++)
{ {
[output appendFormat:@"%d EventType %d\n-> " [output appendFormat:@"%d EventType %d\n-> "
,i,[(NSEvent *)[event_queue objectAtIndex:i] type]]; , i, [(NSEvent *)[event_queue objectAtIndex:i] type]];
} }
[output appendString:@"\n"]; [output appendString:@"\n"];
return output; return output;

View file

@ -1,6 +1,6 @@
/* WIN32Server - Implements window handling for MSWindows /* WIN32Server - Implements window handling for MSWindows
Copyright (C) 2002,2005 Free Software Foundation, Inc. Copyright (C) 2002, 2005 Free Software Foundation, Inc.
Written by: Fred Kiefer <FredKiefer@gmx.de> Written by: Fred Kiefer <FredKiefer@gmx.de>
Date: March 2002 Date: March 2002
@ -99,7 +99,8 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg,
} }
else else
{ {
// Don't translate messages, as this would give extra character messages. // Don't translate messages, as this would give
// extra character messages.
DispatchMessage(&msg); DispatchMessage(&msg);
} }
} }
@ -147,7 +148,7 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg,
inMode: mode inMode: mode
dequeue: flag]; dequeue: flag];
printf("Got EventType %d\n",[theEvent type]); printf("Got EventType %d\n", [theEvent type]);
return theEvent; return theEvent;
#else #else
@ -170,7 +171,7 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg,
// server // server
/* Initialize AppKit backend */ /* Initialize AppKit backend */
+ (void)initializeBackend + (void) initializeBackend
{ {
#ifdef __debugServer__ #ifdef __debugServer__
@ -264,28 +265,11 @@ printf("\n\n##############################################################\n");
watcher: (id<RunLoopEvents>)self watcher: (id<RunLoopEvents>)self
forMode: mode]; forMode: mode];
#else #else
#if 0
NSTimer *timer;
timer = [NSTimer timerWithTimeInterval: 0.01
target: self
selector: @selector(callback:)
userInfo: nil
repeats: YES];
[currentRunLoop addTimer: timer forMode: mode];
#else
/* OBSOLETE
[currentRunLoop addMsgTarget: self
withMethod: @selector(callback:)
forMode: mode];
*/
[currentRunLoop addEvent: (void*)0 [currentRunLoop addEvent: (void*)0
type: ET_WINMSG type: ET_WINMSG
watcher: (id<RunLoopEvents>)self watcher: (id<RunLoopEvents>)self
forMode: mode]; forMode: mode];
#endif #endif
#endif
} }
/** /**
@ -439,7 +423,7 @@ to control debug output... or log specific event to a log panel.
NSTextField *theText; NSTextField *theText;
NSTextField *theText2; NSTextField *theText2;
rect = NSMakeRect (715,800,236,182); rect = NSMakeRect (715, 800, 236, 182);
configWindow = RETAIN([[NSWindow alloc] initWithContentRect: rect configWindow = RETAIN([[NSWindow alloc] initWithContentRect: rect
styleMask: style styleMask: style
backing: NSBackingStoreBuffered backing: NSBackingStoreBuffered
@ -448,7 +432,7 @@ to control debug output... or log specific event to a log panel.
[configWindow setReleasedWhenClosed: NO]; [configWindow setReleasedWhenClosed: NO];
content = [configWindow contentView]; content = [configWindow contentView];
theText = [[NSTextField alloc] initWithFrame: NSMakeRect (27,155,190,22)]; theText = [[NSTextField alloc] initWithFrame: NSMakeRect (27, 155, 190, 22)];
[theText setStringValue: @"Win32 GNUStep Display Server"]; [theText setStringValue: @"Win32 GNUStep Display Server"];
[theText setEditable: NO]; [theText setEditable: NO];
[theText setEnabled: NO]; [theText setEnabled: NO];
@ -461,7 +445,7 @@ to control debug output... or log specific event to a log panel.
/* /*
NSTextField *theText1; NSTextField *theText1;
theText1 = [[NSTextField alloc] initWithFrame: NSMakeRect (27,135,190,22)]; theText1 = [[NSTextField alloc] initWithFrame: NSMakeRect (27, 135, 190, 22)];
[theText1 setStringValue: @"Revitalized By Tom MacSween"]; [theText1 setStringValue: @"Revitalized By Tom MacSween"];
[theText1 setEditable: NO]; [theText1 setEditable: NO];
[theText1 setEnabled: NO]; [theText1 setEnabled: NO];
@ -471,7 +455,7 @@ to control debug output... or log specific event to a log panel.
[[theText1 cell] setBezeled: NO]; [[theText1 cell] setBezeled: NO];
[content addSubview: theText1];*/ [content addSubview: theText1];*/
theText2 = [[NSTextField alloc] initWithFrame: NSMakeRect (17,115,200,22)]; theText2 = [[NSTextField alloc] initWithFrame: NSMakeRect (17, 115, 200, 22)];
[theText2 setStringValue: Version]; [theText2 setStringValue: Version];
[theText2 setEditable: NO]; [theText2 setEditable: NO];
[theText2 setEnabled: NO]; [theText2 setEnabled: NO];
@ -483,7 +467,7 @@ to control debug output... or log specific event to a log panel.
// popup for style // popup for style
styleButton styleButton
= [[NSPopUpButton alloc] initWithFrame: NSMakeRect (30,80,171,22)]; = [[NSPopUpButton alloc] initWithFrame: NSMakeRect (30, 80, 171, 22)];
[styleButton setAutoenablesItems: YES]; [styleButton setAutoenablesItems: YES];
[styleButton setTarget: self]; [styleButton setTarget: self];
[styleButton setAction: @selector(setStyle:)]; [styleButton setAction: @selector(setStyle:)];
@ -499,14 +483,14 @@ to control debug output... or log specific event to a log panel.
// check box for using taskbar // check box for using taskbar
taskbarButton = [[NSButton alloc] initWithFrame: NSMakeRect (30,55,171,22)]; taskbarButton = [[NSButton alloc] initWithFrame: NSMakeRect (30, 55, 171, 22)];
[taskbarButton setButtonType: NSSwitchButton]; [taskbarButton setButtonType: NSSwitchButton];
[taskbarButton setTitle: @"Use Win Taskbar"]; [taskbarButton setTitle: @"Use Win Taskbar"];
[taskbarButton setTarget: self]; [taskbarButton setTarget: self];
[taskbarButton setAction: @selector(setTaskBar:)]; [taskbarButton setAction: @selector(setTaskBar:)];
[content addSubview: taskbarButton]; [content addSubview: taskbarButton];
// save to defaults // save to defaults
saveButton = [[NSButton alloc] initWithFrame: NSMakeRect (30,25,171,22)]; saveButton = [[NSButton alloc] initWithFrame: NSMakeRect (30, 25, 171, 22)];
[saveButton setButtonType: NSMomentaryPushInButton]; [saveButton setButtonType: NSMomentaryPushInButton];
[saveButton setTitle: @"Save to defaults"]; [saveButton setTitle: @"Save to defaults"];
[saveButton setTarget: self]; [saveButton setTarget: self];
@ -579,7 +563,7 @@ to control debug output... or log specific event to a log panel.
NSRunInformationalAlertPanel(@"Server Preferences Changed", NSRunInformationalAlertPanel(@"Server Preferences Changed",
@"Changes will take affect on the next restart", @"Changes will take affect on the next restart",
@"OK",nil, nil); @"OK", nil, nil);
flags.HAVE_SERVER_PREFS = YES; flags.HAVE_SERVER_PREFS = YES;
[configWindow close]; [configWindow close];
[saveButton setEnabled: NO]; [saveButton setEnabled: NO];
@ -1259,12 +1243,12 @@ printf("\n\n##############################################################\n");
if ([self displayEvent: uMsg]== YES) if ([self displayEvent: uMsg]== YES)
{ {
printf("\n\n\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"); printf("\n\n\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
printf("+++ NEW EVENT CYCLE %u +++\n",uMsg); printf("+++ NEW EVENT CYCLE %u +++\n", uMsg);
printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"); printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
#ifdef __W32_debug_Event_loop #ifdef __W32_debug_Event_loop
printf("Events Posted = %d\n",flags.eventQueCount); printf("Events Posted = %d\n", flags.eventQueCount);
printf("EVENT Que Count = %d\n",(int)[GSCurrentServer() eventQueCount]); printf("EVENT Que Count = %d\n", (int)[GSCurrentServer() eventQueCount]);
printf("%s",[[GSCurrentServer() dumpQue: 10] cString]); printf("%s", [[GSCurrentServer() dumpQue: 10] cString]);
#endif #endif
} }
#endif #endif
@ -1493,7 +1477,7 @@ printf("\n\n##############################################################\n");
default: default:
// Process all other messages. // Process all other messages.
#ifdef __W32_debug__ #ifdef __W32_debug__
printf("Uhandled message: %d on window %s\n",uMsg,[[GSWindowWithNumber((int)hwnd) className] cString]); printf("Uhandled message: %d on window %s\n", uMsg, [[GSWindowWithNumber((int)hwnd) className] cString]);
#endif #endif
NSDebugLLog(@"NSEvent", @"Got unhandled Message %d for %d", uMsg, hwnd); NSDebugLLog(@"NSEvent", @"Got unhandled Message %d for %d", uMsg, hwnd);
break; break;
@ -1514,9 +1498,9 @@ printf("\n\n##############################################################\n");
#ifdef __W32_debug__ #ifdef __W32_debug__
if ([ev type]== NSAppKitDefined) if ([ev type]== NSAppKitDefined)
{ {
printf("uMsg %d ",uMsg); printf("uMsg %d ", uMsg);
printf("Post event %s ",[[ev eventNameWithSubtype: YES] cString]); printf("Post event %s ", [[ev eventNameWithSubtype: YES] cString]);
printf("on window %s\n",[[[ev window] className] cString]); printf("on window %s\n", [[[ev window] className] cString]);
} }
#endif #endif
return 0; return 0;
@ -1631,11 +1615,11 @@ printf("\n\n##############################################################\n");
#ifdef __debugServer__ #ifdef __debugServer__
printf("\n\n##############################################################\n"); printf("\n\n##############################################################\n");
printf("handlesWindowDecorations %s\n",handlesWindowDecorations ? "YES" : "NO"); printf("handlesWindowDecorations %s\n", handlesWindowDecorations ? "YES" : "NO");
printf("checking for NSMiniaturizableWindowMask %u\n",(style & NSMiniaturizableWindowMask)); printf("checking for NSMiniaturizableWindowMask %u\n", (style & NSMiniaturizableWindowMask));
printf("GS Window Style %u\n",style); printf("GS Window Style %u\n", style);
printf("Extended Style %d [hex] %X\n",(int)estyle,(UINT)estyle); printf("Extended Style %d [hex] %X\n", (int)estyle, (UINT)estyle);
printf("Win32 Style picked %ld [hex] %X\n",wstyle,(unsigned int)wstyle); printf("Win32 Style picked %ld [hex] %X\n", wstyle, (unsigned int)wstyle);
printf("\n##############################################################\n"); printf("\n##############################################################\n");
#endif #endif
@ -1725,7 +1709,8 @@ printf("\n\n##############################################################\n");
- (void) titlewindow: (NSString*)window_title : (int) winNum - (void) titlewindow: (NSString*)window_title : (int) winNum
{ {
NSDebugLLog(@"WTrace", @"titlewindow: %@ : %d", window_title, winNum); NSDebugLLog(@"WTrace", @"titlewindow: %@ : %d", window_title, winNum);
SetWindowText((HWND)winNum, [window_title cString]); SetWindowTextW((HWND)winNum, (const unichar*)
[window_title cStringUsingEncoding: NSUnicodeStringEncoding]);
} }
- (void) miniwindow: (int) winNum - (void) miniwindow: (int) winNum

View file

@ -1,7 +1,7 @@
/* -*- mode:ObjC -*- /* -*- mode:ObjC -*-
Win32GLContext - backend implementation of NSOpenGLContext Win32GLContext - backend implementation of NSOpenGLContext
Copyright (C) 1998,2002,2007 Free Software Foundation, Inc. Copyright (C) 1998, 2002, 2007 Free Software Foundation, Inc.
Written by: Xavier Glattard Written by: Xavier Glattard
Date: Jan 2007 Date: Jan 2007
@ -20,7 +20,8 @@
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/ */
@ -79,8 +80,8 @@ LRESULT CALLBACK win32SubwindowProc(
wclss.cbClsExtra = 0; wclss.cbClsExtra = 0;
wclss.cbWndExtra = 0; wclss.cbWndExtra = 0;
wclss.hInstance = hInstance; wclss.hInstance = hInstance;
wclss.hIcon = LoadIcon(NULL,IDI_APPLICATION); wclss.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wclss.hCursor = LoadCursor(NULL,IDC_ARROW); wclss.hCursor = LoadCursor(NULL, IDC_ARROW);
wclss.hbrBackground = NULL; wclss.hbrBackground = NULL;
wclss.lpszMenuName = NULL; wclss.lpszMenuName = NULL;
wclss.lpszClassName = NSOPENGLSUBWINDOWCLASS; wclss.lpszClassName = NSOPENGLSUBWINDOWCLASS;
@ -89,7 +90,7 @@ LRESULT CALLBACK win32SubwindowProc(
atom = RegisterClass(&wclss); atom = RegisterClass(&wclss);
NSAssert(atom, @"Failed To Register The Win32Subwindow MS window class."); NSAssert(atom, @"Failed To Register The Win32Subwindow MS window class.");
NSDebugMLLog(@"WGL",@"MS window class initialized (%u)",atom); NSDebugMLLog(@"WGL", @"MS window class initialized (%u)", atom);
} }
- (id) initWithView: (NSOpenGLView *) view - (id) initWithView: (NSOpenGLView *) view
@ -142,7 +143,7 @@ LRESULT CALLBACK win32SubwindowProc(
/* Grab the window class we have registered on [+initialize] */ /* Grab the window class we have registered on [+initialize] */
atom = GetClassInfo( hInstance, NSOPENGLSUBWINDOWCLASS, &wclss ); atom = GetClassInfo( hInstance, NSOPENGLSUBWINDOWCLASS, &wclss );
NSAssert(atom,@"MS window class not found !"); NSAssert(atom, @"MS window class not found !");
RECT parent_rect; RECT parent_rect;
GetWindowRect((HWND)[win windowNumber], &parent_rect); GetWindowRect((HWND)[win windowNumber], &parent_rect);
@ -152,7 +153,7 @@ LRESULT CALLBACK win32SubwindowProc(
width = NSWidth(rect); width = NSWidth(rect);
height = NSHeight(rect); height = NSHeight(rect);
NSDebugMLLog(@"WGL",@"MS window creation (%d,%d,%u,%u)",x, y, width, height); NSDebugMLLog(@"WGL", @"MS window creation (%d, %d, %u, %u)", x, y, width, height);
winid = CreateWindow( winid = CreateWindow(
NSOPENGLSUBWINDOWCLASS, NSOPENGLSUBWINDOWNAME, NSOPENGLSUBWINDOWCLASS, NSOPENGLSUBWINDOWNAME,
@ -160,7 +161,7 @@ LRESULT CALLBACK win32SubwindowProc(
x, y, width, height, x, y, width, height,
(HWND)[win windowNumber], (HMENU)NULL, hInstance, (LPVOID)self); (HWND)[win windowNumber], (HMENU)NULL, hInstance, (LPVOID)self);
NSAssert(winid,@"Failed to create a MS window"); NSAssert(winid, @"Failed to create a MS window");
ShowCursor( TRUE ); ShowCursor( TRUE );
} }
@ -227,7 +228,7 @@ LRESULT CALLBACK win32SubwindowProc(
width = NSWidth(rect); width = NSWidth(rect);
height = NSHeight(rect); height = NSHeight(rect);
MoveWindow(winid,x, y, width, height,/*FIXME*/TRUE); MoveWindow(winid, x, y, width, height, /*FIXME*/TRUE);
} }
- (void) dealloc - (void) dealloc
@ -477,16 +478,16 @@ LRESULT CALLBACK win32SubwindowProc(
Win32Subwindow *wsubwin; Win32Subwindow *wsubwin;
Win32GLContext* ctx = nil; Win32GLContext* ctx = nil;
NSDebugFLLog(@"WGLEvents",@"Entering."); NSDebugFLLog(@"WGLEvents", @"Entering.");
wsubwin = (Win32Subwindow*) GetWindowLongPtr(hWnd,GWLP_USERDATA); wsubwin = (Win32Subwindow*) GetWindowLongPtr(hWnd, GWLP_USERDATA);
if(wsubwin) ctx = (Win32GLContext*)[wsubwin->attached openGLContext]; if(wsubwin) ctx = (Win32GLContext*)[wsubwin->attached openGLContext];
switch (message) { switch (message) {
case WM_CREATE: case WM_CREATE:
NSDebugFLLog(@"WGLEvents",@"WM_CREATE event received."); NSDebugFLLog(@"WGLEvents", @"WM_CREATE event received.");
wsubwin = (Win32Subwindow*)(((LPCREATESTRUCT) lParam)->lpCreateParams); wsubwin = (Win32Subwindow*)(((LPCREATESTRUCT) lParam)->lpCreateParams);
ctx = (Win32GLContext*)[wsubwin->attached openGLContext]; ctx = (Win32GLContext*)[wsubwin->attached openGLContext];
NSDebugFLLog(@"WGLEvents",@"subwindow : %@", wsubwin); NSDebugFLLog(@"WGLEvents", @"subwindow : %@", wsubwin);
// initialize OpenGL rendering // initialize OpenGL rendering
NSCAssert(wsubwin->hDC = GetDC(hWnd), @"No DC"); NSCAssert(wsubwin->hDC = GetDC(hWnd), @"No DC");
[ctx->format _setDrawable: wsubwin->hDC]; [ctx->format _setDrawable: wsubwin->hDC];
@ -495,11 +496,11 @@ LRESULT CALLBACK win32SubwindowProc(
ctx->wgl_context = wglCreateContext(wsubwin->hDC), ctx->wgl_context = wglCreateContext(wsubwin->hDC),
@"wglCreateContext failed"); @"wglCreateContext failed");
// wglMakeCurrent(wsubwin->hDC, hGLRC) // wglMakeCurrent(wsubwin->hDC, hGLRC)
SetWindowLongPtr(hWnd,GWLP_USERDATA,(LONG_PTR)wsubwin); SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)wsubwin);
NSDebugFLLog(@"WGLEvents",@"WM_CREATE done."); NSDebugFLLog(@"WGLEvents", @"WM_CREATE done.");
return 0; return 0;
case WM_DESTROY: case WM_DESTROY:
NSDebugFLLog(@"WGLEvents",@"WM_DESTROY event received."); NSDebugFLLog(@"WGLEvents", @"WM_DESTROY event received.");
// finish OpenGL rendering // finish OpenGL rendering
if(ctx->wgl_context) { if(ctx->wgl_context) {
@ -510,7 +511,7 @@ LRESULT CALLBACK win32SubwindowProc(
DeleteObject(hPalette); DeleteObject(hPalette);
}*/ }*/
ReleaseDC(hWnd, wsubwin->hDC); ReleaseDC(hWnd, wsubwin->hDC);
NSDebugFLLog(@"WGLEvents",@"WM_DESTROY done."); NSDebugFLLog(@"WGLEvents", @"WM_DESTROY done.");
return 0; return 0;
/* case WM_SIZE: /* case WM_SIZE:
// track window size changes // track window size changes
@ -562,12 +563,12 @@ LRESULT CALLBACK win32SubwindowProc(
} }
break;*/ break;*/
default: default:
NSDebugFLLog(@"WGLEvents",@"other event received (%u).",message); NSDebugFLLog(@"WGLEvents", @"other event received (%u).", message);
// return MainWndProc((HWND)GetWindowLongPtr(hWnd,GWLP_HWNDPARENT), message, wParam, lParam); // return MainWndProc((HWND)GetWindowLongPtr(hWnd, GWLP_HWNDPARENT), message, wParam, lParam);
return DefWindowProc(hWnd, message, wParam, lParam); return DefWindowProc(hWnd, message, wParam, lParam);
break; break;
} }
NSDebugFLLog(@"WGLEvents",@"Failed."); NSDebugFLLog(@"WGLEvents", @"Failed.");
return FALSE; return FALSE;
} }

View file

@ -1,7 +1,7 @@
/* -*- mode:ObjC -*- /* -*- mode:ObjC -*-
Win32GLContext - backend implementation of NSOpenGLContext Win32GLContext - backend implementation of NSOpenGLContext
Copyright (C) 1998,2002,2007 Free Software Foundation, Inc. Copyright (C) 1998, 2002, 2007 Free Software Foundation, Inc.
Written by: Xavier Glattard Written by: Xavier Glattard
Date: Jan 2007 Date: Jan 2007
@ -20,7 +20,8 @@
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/ */
#include "config.h" #include "config.h"
@ -165,14 +166,14 @@ static void attributesWGL2NS( LPPIXELFORMATDESCRIPTOR ppfd, NSOpenGLPixelFormatA
- (id)initWithAttributes: (NSOpenGLPixelFormatAttribute *) attribs - (id)initWithAttributes: (NSOpenGLPixelFormatAttribute *) attribs
{ {
NSDebugMLLog(@"WGL",@"will init"); NSDebugMLLog(@"WGL", @"will init");
self = [super init]; self = [super init];
if(self) if(self)
{ {
wgl_drawable = 0; wgl_drawable = 0;
wgl_pixelformat = 0; wgl_pixelformat = 0;
attributesNS2WGL(attribs,&pfd); attributesNS2WGL(attribs, &pfd);
} }
return self; return self;
} }
@ -245,7 +246,7 @@ static void attributesWGL2NS( LPPIXELFORMATDESCRIPTOR ppfd, NSOpenGLPixelFormatA
@"SetPixelFormat failed."); @"SetPixelFormat failed.");
wgl_drawable = aDrawable; wgl_drawable = aDrawable;
NSDebugFLLog(@"WGL",@"found : %u",wgl_pixelformat); NSDebugFLLog(@"WGL", @"found : %u", wgl_pixelformat);
} }
- (void) dealloc - (void) dealloc

View file

@ -18,7 +18,8 @@
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/ */
@ -67,13 +68,13 @@
if ((int)lParam == flags.menuRef) if ((int)lParam == flags.menuRef)
target=YES; target=YES;
printf("RECEIVER [hwnd]%s\n",[[EVENT_WINDOW(hwnd) className] cString]); printf("RECEIVER [hwnd]%s\n", [[EVENT_WINDOW(hwnd) className] cString]);
printf("ON [lParam]%s\n",[[EVENT_WINDOW(lParam) className] cString]); printf("ON [lParam]%s\n", [[EVENT_WINDOW(lParam) className] cString]);
printf("[lParam] %s",[[self gswindowstate:EVENT_WINDOW(lParam)] cString]); printf("[lParam] %s", [[self gswindowstate:EVENT_WINDOW(lParam)] cString]);
printf("ACTIVATE_FLAG STATE %d \n",flags._last_WM_ACTIVATE); printf("ACTIVATE_FLAG STATE %d \n", flags._last_WM_ACTIVATE);
printf("[hwnd] %s",[[self gswindowstate:EVENT_WINDOW(hwnd)] cString]); printf("[hwnd] %s", [[self gswindowstate:EVENT_WINDOW(hwnd)] cString]);
fflush(stdout); fflush(stdout);
#endif #endif
@ -133,17 +134,17 @@
#ifdef __WM_ACTIVATEAPP__ #ifdef __WM_ACTIVATEAPP__
printf("NSApp is:[%s]\n",active ? "active" : "inactive"); printf("NSApp is:[%s]\n", active ? "active" : "inactive");
printf("lParam is [%s]\n thread = [%u]\n w32_Class[%s] \n", printf("lParam is [%s]\n thread = [%u]\n w32_Class[%s] \n",
(int)wParam ? "TRUE": "FALSE", (int)wParam ? "TRUE": "FALSE",
(unsigned int)lParam, (unsigned int)lParam,
[[self getNativeClassName:hwnd] cString]); [[self getNativeClassName:hwnd] cString]);
// debug GS_state details // debug GS_state details
printf("%s",[[self gswindowstate:EVENT_WINDOW(hwnd)] cString]); printf("%s", [[self gswindowstate:EVENT_WINDOW(hwnd)] cString]);
printf("%s",[[self gswindowstate:EVENT_WINDOW(wParam)] cString]); printf("%s", [[self gswindowstate:EVENT_WINDOW(wParam)] cString]);
printf("eventHandled=[%s]\n",flags._eventHandled ? "YES" : "NO"); printf("eventHandled=[%s]\n", flags._eventHandled ? "YES" : "NO");
printf("REQUESTED STATE %d\n",flags._last_WM_ACTIVATE); printf("REQUESTED STATE %d\n", flags._last_WM_ACTIVATE);
fflush(stdout); fflush(stdout);
#endif #endif

View file

@ -21,7 +21,8 @@
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/ */
@ -37,9 +38,9 @@
#ifdef __WM_NCCREATE__ #ifdef __WM_NCCREATE__
printf("WM_NCCREATE\n"); printf("WM_NCCREATE\n");
#ifdef __W32_debug__ #ifdef __W32_debug__
printf("%s",[[self w32_createDetails:(LPCREATESTRUCT)lParam] cString]); printf("%s", [[self w32_createDetails:(LPCREATESTRUCT)lParam] cString]);
#endif #endif
printf("\nRequested GS Window Style is %u\n",flags.currentGS_Style); printf("\nRequested GS Window Style is %u\n", flags.currentGS_Style);
fflush(stdout); fflush(stdout);
#endif #endif
@ -86,18 +87,18 @@
#ifdef __WM_CREATE__ #ifdef __WM_CREATE__
printf("WM_CREATE: *********************\n"); printf("WM_CREATE: *********************\n");
#ifdef __W32_debug__ #ifdef __W32_debug__
printf("%s",[[self w32_createDetails:(LPCREATESTRUCT)lParam] cString]); printf("%s", [[self w32_createDetails:(LPCREATESTRUCT)lParam] cString]);
fflush(stdout); fflush(stdout);
#endif #endif
printf("Parent isa %s\n",[[self getNativeClassName:GetParent(hwnd)] cString]); printf("Parent isa %s\n", [[self getNativeClassName:GetParent(hwnd)] cString]);
printf("[hwnd]Native WindowType %s\n",[[self getNativeClassName:(HWND)hwnd] cString]); printf("[hwnd]Native WindowType %s\n", [[self getNativeClassName:(HWND)hwnd] cString]);
printf("[hwnd]GS WindowType %s:\n",[[EVENT_WINDOW(hwnd) className] cString]); printf("[hwnd]GS WindowType %s:\n", [[EVENT_WINDOW(hwnd) className] cString]);
printf("HAVE_MAIN_MENU = %s\n",flags.HAVE_MAIN_MENU ? "YES": "NO"); printf("HAVE_MAIN_MENU = %s\n", flags.HAVE_MAIN_MENU ? "YES": "NO");
printf("Main Menu Window Num: %d Currrent window Num: %d\n", printf("Main Menu Window Num: %d Currrent window Num: %d\n",
[[[NSApp mainMenu] window] windowNumber],(int)hwnd); [[[NSApp mainMenu] window] windowNumber], (int)hwnd);
printf("Window Task bar flag %s\n",flags.useWMTaskBar ? "YES" : "NO"); printf("Window Task bar flag %s\n", flags.useWMTaskBar ? "YES" : "NO");
#endif #endif
return 0; return 0;

View file

@ -18,7 +18,8 @@
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/ */
#include "w32_Events.h" #include "w32_Events.h"
@ -40,10 +41,10 @@ static NSString * spacer =@"<BLANK_LINE>\n";
printf("*******************testing Conversion \n\n\n"); printf("*******************testing Conversion \n\n\n");
printf("MSScreenRectToGS GSScreenRectToMS\n"); printf("MSScreenRectToGS GSScreenRectToMS\n");
gsrect = MSScreenRectToGS(r, [window styleMask], self); gsrect = MSScreenRectToGS(r, [window styleMask], self);
msrect= GSScreenRectToMS(gsrect, [window styleMask],self); msrect= GSScreenRectToMS(gsrect, [window styleMask], self);
printf("*************************test complete\n\n\n"); printf("*************************test complete\n\n\n");
[self print_result:msrect and:gsrect and:r]; [self print_result: msrect and: gsrect and: r];
//TestsDone=YES; //TestsDone=YES;
} }
@ -51,20 +52,20 @@ static NSString * spacer =@"<BLANK_LINE>\n";
{ {
printf("MS - Control\n"); printf("MS - Control\n");
printf("MSrect = left %ld ",control.left); printf("MSrect = left %ld ", control.left);
printf(" top %ld",control.top); printf(" top %ld", control.top);
printf(" right %ld",control.right); printf(" right %ld", control.right);
printf(" Bottom %ld\n",control.bottom); printf(" Bottom %ld\n", control.bottom);
printf("GS - Calculated\n"); printf("GS - Calculated\n");
printf("NSRect = height %f width %f ",gsrect.size.height,gsrect.size.width); printf("NSRect = height %f width %f ", gsrect.size.height, gsrect.size.width);
printf(" X %f Y %f\n",gsrect.origin.x,gsrect.origin.y); printf(" X %f Y %f\n", gsrect.origin.x, gsrect.origin.y);
printf("MS - Calculated\n"); printf("MS - Calculated\n");
printf("MSrect = left %ld ",msrect.left); printf("MSrect = left %ld ", msrect.left);
printf(" top %ld",msrect.top); printf(" top %ld", msrect.top);
printf(" right %ld",msrect.right); printf(" right %ld", msrect.right);
printf(" Bottom %ld\n",msrect.bottom); printf(" Bottom %ld\n", msrect.bottom);
} }
- (BOOL) displayEvent:(unsigned int)uMsg - (BOOL) displayEvent:(unsigned int)uMsg
@ -169,25 +170,26 @@ typedef struct tagCREATESTRUCT {
- (NSMutableString *) w32_createDetails:(LPCREATESTRUCT)details - (NSMutableString *) w32_createDetails:(LPCREATESTRUCT)details
{ {
NSMutableString * output= [NSMutableString stringWithString: spacer];
NSMutableString * output= [NSMutableString stringWithString:spacer];
[output appendString:@"\n\nLPCREATESTRUCT details\n"]; [output appendString:@"\n\nLPCREATESTRUCT details\n"];
[output appendFormat:@"HINSTANCE %p ",details->hInstance]; [output appendFormat:@"HINSTANCE %p ", details->hInstance];
[output appendFormat:@"HMENU %p\n",details->hMenu]; [output appendFormat:@"HMENU %p\n", details->hMenu];
[output appendFormat:@"Creating window: Parent is %s:\n", [output appendFormat:@"Creating window: Parent is %s:\n",
[self getNativeClassName:details->hwndParent]]; [self getNativeClassName: details->hwndParent]];
[output appendFormat:@"Co-ordanates:height[%d] width[%d] Pos[%d] Pox[%d]\n", [output appendFormat:@"Co-ordanates: height[%d] width[%d] Pos[%d] Pox[%d]\n",
details->cy,details->cx,details->y,details->x]; details->cy, details->cx, details->y, details->x];
[output appendFormat:@"Style %lu Name: %s Win32Class: %s Extended Style %ld\n\n\n", [output appendFormat:
details->style,details->lpszName, @"Style %lu Name: %s Win32Class: %s Extended Style %ld\n\n\n",
details->lpszClass,details->dwExStyle]; details->style, details->lpszName,
[output appendString:spacer]; details->lpszClass, details->dwExStyle];
[output appendString: spacer];
return output; return output;
} }
@ -198,24 +200,24 @@ typedef struct tagCREATESTRUCT {
int c=[anArray count]; int c=[anArray count];
NSMutableString * output= [NSMutableString stringWithString:spacer]; NSMutableString * output= [NSMutableString stringWithString: spacer];
[output appendFormat:@"Application window count is: %d\n",c]; [output appendFormat:@"Application window count is: %d\n", c];
for (i=0;i<c;i++) for (i=0;i<c;i++)
{ {
NSWindow * theWindow=[anArray objectAtIndex:i]; NSWindow * theWindow=[anArray objectAtIndex: i];
[output appendString:[self WindowDetail:theWindow]]; [output appendString:[self WindowDetail: theWindow]];
} }
[output appendString:spacer]; [output appendString: spacer];
return output; return output;
} }
- (NSMutableString *) WindowDetail:(NSWindow *) theWindow - (NSMutableString *) WindowDetail:(NSWindow *) theWindow
{ {
return [self gswindowstate:theWindow]; return [self gswindowstate: theWindow];
} }
@ -223,10 +225,10 @@ typedef struct tagCREATESTRUCT {
{ {
NSMutableString * output= [NSMutableString stringWithCString:"MSRect Details\n"]; NSMutableString * output= [NSMutableString stringWithCString:"MSRect Details\n"];
[output appendFormat:@"left %ld ",aRect.left]; [output appendFormat:@"left %ld ", aRect.left];
[output appendFormat:@"top %ld ",aRect.top]; [output appendFormat:@"top %ld ", aRect.top];
[output appendFormat:@"right %ld ",aRect.right]; [output appendFormat:@"right %ld ", aRect.right];
[output appendFormat:@"Bottom %ld\n",aRect.bottom]; [output appendFormat:@"Bottom %ld\n", aRect.bottom];
return output; return output;
} }
@ -236,10 +238,10 @@ typedef struct tagCREATESTRUCT {
NSMutableString * output= [NSMutableString stringWithString:@" "]; NSMutableString * output= [NSMutableString stringWithString:@" "];
[output appendFormat:@"height %ld width %ld ",(int)aRect.size.height [output appendFormat:@"height %ld width %ld ", (int)aRect.size.height
,(int)aRect.size.width]; , (int)aRect.size.width];
[output appendFormat:@" XPos %ld YPos %ld\n",(int)aRect.origin.x [output appendFormat:@" XPos %ld YPos %ld\n", (int)aRect.origin.x
,(int)aRect.origin.y]; , (int)aRect.origin.y];
return output; return output;
} }
@ -247,44 +249,44 @@ typedef struct tagCREATESTRUCT {
- (NSMutableString *) gswindowstate:(NSWindow *)theWindow - (NSMutableString *) gswindowstate:(NSWindow *)theWindow
{ {
// NSRect cvRect=[[theWindow contentView] frame]; // NSRect cvRect=[[theWindow contentView] frame];
NSMutableString * output= [NSMutableString stringWithString:spacer]; NSMutableString * output= [NSMutableString stringWithString: spacer];
[output appendFormat:@"MenuRef = %d\n",flags.menuRef]; [output appendFormat:@"MenuRef = %d\n", flags.menuRef];
[output appendFormat:@"Main Menu %s\n",flags._is_menu ? "YES" : "NO"]; [output appendFormat:@"Main Menu %s\n", flags._is_menu ? "YES" : "NO"];
[output appendFormat:@"WINDOW title %@\n", [theWindow title]]; [output appendFormat:@"WINDOW title %@\n", [theWindow title]];
[output appendFormat:@"WINDOW className %@\n", [theWindow className]]; [output appendFormat:@"WINDOW className %@\n", [theWindow className]];
[output appendFormat:@"WINDOW isVisible: %s\n",[theWindow isVisible] ? "YES" : "NO"]; [output appendFormat:@"WINDOW isVisible: %s\n", [theWindow isVisible] ? "YES" : "NO"];
[output appendFormat:@"WINDOW isAutodisplay: %s\n",[theWindow isAutodisplay] ? "YES" : "NO"]; [output appendFormat:@"WINDOW isAutodisplay: %s\n", [theWindow isAutodisplay] ? "YES" : "NO"];
[output appendFormat:@"WINDOW isMiniaturized: %s\n",[theWindow isMiniaturized] ? "YES" : "NO"]; [output appendFormat:@"WINDOW isMiniaturized: %s\n", [theWindow isMiniaturized] ? "YES" : "NO"];
[output appendFormat:@"WINDOW viewsNeedDisplay: %s\n",[theWindow viewsNeedDisplay] ? "YES" : "NO"]; [output appendFormat:@"WINDOW viewsNeedDisplay: %s\n", [theWindow viewsNeedDisplay] ? "YES" : "NO"];
[output appendFormat:@"WINDOW isOpaque: %s\n",[theWindow isOpaque] ? "YES" : "NO"]; [output appendFormat:@"WINDOW isOpaque: %s\n", [theWindow isOpaque] ? "YES" : "NO"];
[output appendFormat:@"WINDOW isReleasedWhenClosed: %s\n ",[theWindow isReleasedWhenClosed] ? "YES" : "NO"]; [output appendFormat:@"WINDOW isReleasedWhenClosed: %s\n ", [theWindow isReleasedWhenClosed] ? "YES" : "NO"];
[output appendFormat:@"WINDOW isOneShot: %s\n",[theWindow isOneShot] ? "YES" : "NO"]; [output appendFormat:@"WINDOW isOneShot: %s\n", [theWindow isOneShot] ? "YES" : "NO"];
[output appendFormat:@"WINDOW isMainWindow: %s\n",[theWindow isMainWindow] ? "YES" : "NO"]; [output appendFormat:@"WINDOW isMainWindow: %s\n", [theWindow isMainWindow] ? "YES" : "NO"];
[output appendFormat:@"WINDOW isKeyWindow: %s\n",[theWindow isKeyWindow] ? "YES" : "NO"]; [output appendFormat:@"WINDOW isKeyWindow: %s\n", [theWindow isKeyWindow] ? "YES" : "NO"];
[output appendFormat:@"WINDOW styleMask: %d\n",[theWindow styleMask]]; [output appendFormat:@"WINDOW styleMask: %d\n", [theWindow styleMask]];
[output appendFormat:@"WINDOW frame:%@", [self NSRectDetails:[theWindow frame]]]; [output appendFormat:@"WINDOW frame:%@", [self NSRectDetails:[theWindow frame]]];
//[output appendString:[self subViewDetails:theWindow]]; //[output appendString:[self subViewDetails: theWindow]];
[output appendFormat:@"Native Class Name %@\n", [output appendFormat:@"Native Class Name %@\n",
[self getNativeClassName:(HWND)[theWindow windowNumber]]]; [self getNativeClassName:(HWND)[theWindow windowNumber]]];
[output appendFormat:@"Win32 GWL_EXStyle %ld\n", [output appendFormat:@"Win32 GWL_EXStyle %ld\n",
GetWindowLong((HWND)[theWindow windowNumber],GWL_EXSTYLE)]; GetWindowLong((HWND)[theWindow windowNumber], GWL_EXSTYLE)];
[output appendFormat:@"Win32 GWL_STYLE %X\n", [output appendFormat:@"Win32 GWL_STYLE %X\n",
GetWindowLong((HWND)[theWindow windowNumber],GWL_STYLE)]; GetWindowLong((HWND)[theWindow windowNumber], GWL_STYLE)];
[output appendFormat:@"Win32 GWL_WNDPROC %ld\n", [output appendFormat:@"Win32 GWL_WNDPROC %ld\n",
GetWindowLong((HWND)[theWindow windowNumber],GWL_WNDPROC)]; GetWindowLong((HWND)[theWindow windowNumber], GWL_WNDPROC)];
[output appendFormat:@"Win32 GWL_HINSTANCE %ld\n", [output appendFormat:@"Win32 GWL_HINSTANCE %ld\n",
GetWindowLong((HWND)[theWindow windowNumber],GWL_HINSTANCE)]; GetWindowLong((HWND)[theWindow windowNumber], GWL_HINSTANCE)];
[output appendFormat:@"Win32 GWL_HWNDPARENT %ld\n", [output appendFormat:@"Win32 GWL_HWNDPARENT %ld\n",
GetWindowLong((HWND)[theWindow windowNumber],GWL_HWNDPARENT)]; GetWindowLong((HWND)[theWindow windowNumber], GWL_HWNDPARENT)];
[output appendFormat:@"Win32 GWL_ID %ld\n", [output appendFormat:@"Win32 GWL_ID %ld\n",
GetWindowLong((HWND)[theWindow windowNumber],GWL_ID)]; GetWindowLong((HWND)[theWindow windowNumber], GWL_ID)];
[output appendString:spacer]; [output appendString: spacer];
[output appendFormat:@"Win32 windowtext %@\n", [output appendFormat:@"Win32 windowtext %@\n",
[self getWindowtext:(HWND)[theWindow windowNumber]]]; [self getWindowtext:(HWND)[theWindow windowNumber]]];
@ -293,20 +295,20 @@ typedef struct tagCREATESTRUCT {
- (NSMutableString *) MINMAXDetails:(MINMAXINFO *) mm - (NSMutableString *) MINMAXDetails:(MINMAXINFO *) mm
{ {
NSMutableString * output =[NSMutableString stringWithString:spacer]; NSMutableString * output =[NSMutableString stringWithString: spacer];
[output appendString:@"MINMAXINFO"]; [output appendString:@"MINMAXINFO"];
[output appendFormat:@"ptMaxSize width[%ld] X height[%ld]\n", [output appendFormat:@"ptMaxSize width[%ld] X height[%ld]\n",
mm->ptMaxSize.x,mm->ptMaxSize.y]; mm->ptMaxSize.x, mm->ptMaxSize.y];
[output appendFormat:@"ptMaxPosition width[%ld] X height[%ld]\n", [output appendFormat:@"ptMaxPosition width[%ld] X height[%ld]\n",
mm->ptMaxPosition.x,mm->ptMaxPosition.y]; mm->ptMaxPosition.x, mm->ptMaxPosition.y];
[output appendFormat:@"ptMinTrackSize width[%ld] X height[%ld]\n", [output appendFormat:@"ptMinTrackSize width[%ld] X height[%ld]\n",
mm->ptMinTrackSize.x,mm->ptMinTrackSize.y]; mm->ptMinTrackSize.x, mm->ptMinTrackSize.y];
[output appendFormat:@"ptMaxTrackSize width[%ld] X height[%ld]\n", [output appendFormat:@"ptMaxTrackSize width[%ld] X height[%ld]\n",
mm->ptMaxTrackSize.x,mm->ptMaxTrackSize.y]; mm->ptMaxTrackSize.x, mm->ptMaxTrackSize.y];
return output; return output;
} }
@ -322,17 +324,17 @@ typedef struct tagCREATESTRUCT {
NSRect cvRect = [cView frame]; NSRect cvRect = [cView frame];
NSRect svRect = [sView frame]; NSRect svRect = [sView frame];
NSRect tRect; NSRect tRect;
NSMutableString * output =[NSMutableString stringWithString:spacer]; NSMutableString * output =[NSMutableString stringWithString: spacer];
[output appendFormat:@"subView Details for %@\n", [theWindow title]]; [output appendFormat:@"subView Details for %@\n", [theWindow title]];
[output appendFormat:@"superRect %@", [self NSRectDetails:svRect]]; [output appendFormat:@"superRect %@", [self NSRectDetails: svRect]];
[output appendFormat:@"contentRect %@", [self NSRectDetails:cvRect]]; [output appendFormat:@"contentRect %@", [self NSRectDetails: cvRect]];
for (i=0;i<c;i++) for (i=0;i<c;i++)
{ {
temp=[theViews objectAtIndex:i]; temp=[theViews objectAtIndex: i];
tRect =[temp frame]; tRect =[temp frame];
[output appendFormat:@"subView %u rect %@", [output appendFormat:@"subView %u rect %@",
i, [self NSRectDetails:tRect]]; i, [self NSRectDetails: tRect]];
} }
return output; return output;
} }
@ -347,7 +349,7 @@ typedef struct tagCREATESTRUCT {
[[aNotification name] cString]); [[aNotification name] cString]);
NSWindow *theWindow=[aNotification object]; NSWindow *theWindow=[aNotification object];
printf("%s",[[self gswindowstate:theWindow] cString]); printf("%s", [[self gswindowstate: theWindow] cString]);
#endif #endif
} }
@end @end

View file

@ -21,7 +21,8 @@
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/ */
@ -32,7 +33,7 @@
- (void) decodeWM_CLOSEParams:(WPARAM)wParam :(LPARAM)lParam :(HWND)hwnd; - (void) decodeWM_CLOSEParams:(WPARAM)wParam :(LPARAM)lParam :(HWND)hwnd;
{ {
NSEvent * ev; NSEvent * ev;
NSPoint eventLocation = NSMakePoint(0,0); NSPoint eventLocation = NSMakePoint(0, 0);
ev = [NSEvent otherEventWithType: NSAppKitDefined ev = [NSEvent otherEventWithType: NSAppKitDefined
location: eventLocation location: eventLocation
modifierFlags: 0 modifierFlags: 0
@ -52,8 +53,8 @@
#ifdef __CLOSE__ #ifdef __CLOSE__
NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "CLOSE", hwnd); NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "CLOSE", hwnd);
printf("CLOSING\n"); printf("CLOSING\n");
printf("%s",[[self WindowDetail:EVENT_WINDOW(hwnd)] cString]); printf("%s", [[self WindowDetail:EVENT_WINDOW(hwnd)] cString]);
printf("sending event %s \n",[[ev eventNameWithSubtype:YES] cString]); printf("sending event %s \n", [[ev eventNameWithSubtype:YES] cString]);
fflush(stdout); fflush(stdout);
#endif #endif
} }
@ -83,7 +84,7 @@ printf("WM_NCDESTROY\n");
flags._eventHandled=YES; flags._eventHandled=YES;
#ifdef __DESTROY__ #ifdef __DESTROY__
printf("%s",[[self WindowDetail:EVENT_WINDOW(hwnd)] cString]); printf("%s", [[self WindowDetail:EVENT_WINDOW(hwnd)] cString]);
fflush(stdout); fflush(stdout);
#endif #endif
} }
@ -142,8 +143,8 @@ printf("WM_NCDESTROY\n");
break; break;
} }
#ifdef __SYSCOMMAND__ #ifdef __SYSCOMMAND__
printf("SYSTEM MENU REQUESTED 0x%X\n",wParam); printf("SYSTEM MENU REQUESTED 0x%X\n", wParam);
//printf("%s",[[self WindowDetail:EVENT_WINDOW(hwnd)] cString]); //printf("%s", [[self WindowDetail:EVENT_WINDOW(hwnd)] cString]);
#endif #endif
} }
@ -157,12 +158,12 @@ printf("WM_NCDESTROY\n");
// to be completed for styles // to be completed for styles
LONG result; LONG result;
ShowWindow(hwnd,SW_HIDE); ShowWindow(hwnd, SW_HIDE);
SetLastError(0); SetLastError(0);
result=SetWindowLong(hwnd,GWL_EXSTYLE,WS_EX_APPWINDOW); result=SetWindowLong(hwnd, GWL_EXSTYLE, WS_EX_APPWINDOW);
result=SetWindowLong(hwnd,GWL_STYLE,(LONG)aStyle); result=SetWindowLong(hwnd, GWL_STYLE, (LONG)aStyle);
// should check error here... // should check error here...
ShowWindow(hwnd,SW_SHOWNORMAL); ShowWindow(hwnd, SW_SHOWNORMAL);
} }
@end @end

View file

@ -18,7 +18,8 @@
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/ */
#include "w32_Events.h" #include "w32_Events.h"
@ -64,13 +65,13 @@
} }
#ifdef __WM_MOVE__ #ifdef __WM_MOVE__
printf("sending GS_EVENT %d GS_SUBTYPE %d\n",[ev type],[ev subtype]); printf("sending GS_EVENT %d GS_SUBTYPE %d\n", [ev type], [ev subtype]);
printf("HOLD_MENU_FOR_MOVE is %s\n",flags.HOLD_MENU_FOR_MOVE ? "TRUE" : "FALSE"); printf("HOLD_MENU_FOR_MOVE is %s\n", flags.HOLD_MENU_FOR_MOVE ? "TRUE" : "FALSE");
printf("HOLD_MENU_FOR_SIZE is %s\n",flags.HOLD_MENU_FOR_SIZE ? "TRUE" : "FALSE"); printf("HOLD_MENU_FOR_SIZE is %s\n", flags.HOLD_MENU_FOR_SIZE ? "TRUE" : "FALSE");
printf("%s\n",[[self WindowDetail:EVENT_WINDOW(hwnd)] cString]); printf("%s\n", [[self WindowDetail:EVENT_WINDOW(hwnd)] cString]);
printf("EVENTLOCATION %s",[[self NSRectDetails:rect] cString]); printf("EVENTLOCATION %s", [[self NSRectDetails:rect] cString]);
printf("[hwnd rect] is %s",[[self NSRectDetails:[EVENT_WINDOW(hwnd) frame]] cString]); printf("[hwnd rect] is %s", [[self NSRectDetails:[EVENT_WINDOW(hwnd) frame]] cString]);
fflush(stdout); fflush(stdout);
#endif #endif
@ -123,7 +124,7 @@
case SIZE_MINIMIZED: case SIZE_MINIMIZED:
{ {
if (flags.HOLD_MINI_FOR_SIZE==TRUE) //// this is fix for [5,25 bug] if (flags.HOLD_MINI_FOR_SIZE==TRUE) //// this is fix for [5, 25 bug]
break; break;
// make event // make event
@ -191,7 +192,7 @@
{ {
[EVENT_WINDOW(hwnd) sendEvent:ev]; [EVENT_WINDOW(hwnd) sendEvent:ev];
[self resizeBackingStoreFor:hwnd]; [self resizeBackingStoreFor:hwnd];
// fixes part one of bug [5,25] see notes // fixes part one of bug [5, 25] see notes
if (flags.useWMTaskBar==YES) if (flags.useWMTaskBar==YES)
[EVENT_WINDOW(hwnd) deminiaturize:self]; [EVENT_WINDOW(hwnd) deminiaturize:self];
} }
@ -204,13 +205,13 @@
} }
#ifdef __WM_SIZE__ #ifdef __WM_SIZE__
printf("sending GS_EVENT %d GS_SUBTYPE %d\n",[ev type],[ev subtype]); printf("sending GS_EVENT %d GS_SUBTYPE %d\n", [ev type], [ev subtype]);
printf("[wParam] SIZE_FLAG is %d\n",(int)wParam); printf("[wParam] SIZE_FLAG is %d\n", (int)wParam);
printf("HOLD_MENU_FOR_MOVE is %s\n",flags.HOLD_MENU_FOR_MOVE ? "TRUE" : "FALSE"); printf("HOLD_MENU_FOR_MOVE is %s\n", flags.HOLD_MENU_FOR_MOVE ? "TRUE" : "FALSE");
printf("HOLD_MENU_FOR_SIZE is %s\n",flags.HOLD_MENU_FOR_SIZE ? "TRUE" : "FALSE"); printf("HOLD_MENU_FOR_SIZE is %s\n", flags.HOLD_MENU_FOR_SIZE ? "TRUE" : "FALSE");
printf("%s",[[self WindowDetail:EVENT_WINDOW(hwnd)] cString]); printf("%s", [[self WindowDetail:EVENT_WINDOW(hwnd)] cString]);
printf("size to:%s",[[self NSRectDetails:rect] cString]); printf("size to:%s", [[self NSRectDetails:rect] cString]);
printf("[hwnd rect] is %s",[[self NSRectDetails:[EVENT_WINDOW(hwnd) frame]] cString]); printf("[hwnd rect] is %s", [[self NSRectDetails:[EVENT_WINDOW(hwnd) frame]] cString]);
fflush(stdout); fflush(stdout);
#endif #endif
@ -272,11 +273,11 @@
[EVENT_WINDOW(hwnd) sendEvent:ev]; [EVENT_WINDOW(hwnd) sendEvent:ev];
//printf(" Rect 1 =\n%s",[[self MSRectDetails:drect] cString]); //printf(" Rect 1 =\n%s", [[self MSRectDetails:drect] cString]);
} }
//printf("wParam is %s\n",wParam ? "TRUE" : "FALSE");*/ //printf("wParam is %s\n", wParam ? "TRUE" : "FALSE");*/
} }
- (void) decodeWM_WINDOWPOSCHANGEDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd - (void) decodeWM_WINDOWPOSCHANGEDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
@ -310,8 +311,8 @@
} }
#ifdef __GETMINMAXINFO__ #ifdef __GETMINMAXINFO__
printf("%s",[[self WindowDetail:EVENT_WINDOW(hwnd)] cString]); printf("%s", [[self WindowDetail:EVENT_WINDOW(hwnd)] cString]);
printf("%s",[[self MINMAXDetails:mm] cString]); printf("%s", [[self MINMAXDetails:mm] cString]);
fflush(stdout); fflush(stdout);
#endif #endif
return 0; return 0;
@ -332,7 +333,7 @@
#ifdef __EXITSIZEMOVE__ #ifdef __EXITSIZEMOVE__
NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "EXITSIZEMOVE", hwnd); NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "EXITSIZEMOVE", hwnd);
printf("%s",[[self WindowDetail:EVENT_WINDOW(hwnd)] cString]); printf("%s", [[self WindowDetail:EVENT_WINDOW(hwnd)] cString]);
fflush(stdout); fflush(stdout);
#endif #endif

View file

@ -21,7 +21,8 @@
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/ */
#include "w32_Events.h" #include "w32_Events.h"
@ -32,12 +33,12 @@
//- (LRESULT) decodeWM_SETTEXTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd //- (LRESULT) decodeWM_SETTEXTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
//{ //{
//printf("WM_SETTEXT\n"); //printf("WM_SETTEXT\n");
//printf("Window text is: %s\n",(LPSTR)lParam); //printf("Window text is: %s\n", (LPSTR)lParam);
//BOOL result=SetWindowText(hwnd,(LPSTR)lParam); //BOOL result=SetWindowText(hwnd, (LPSTR)lParam);
// if (result==0) // if (result==0)
//printf("error on setWindow text %ld\n",GetLastError()); //printf("error on setWindow text %ld\n", GetLastError());
//return 0; //return 0;
//} //}
@ -57,7 +58,7 @@
win_num = (int)hwnd; win_num = (int)hwnd;
currentFocus = hwnd; currentFocus = hwnd;
eventLocation = NSMakePoint(0,0); eventLocation = NSMakePoint(0, 0);
if (currentFocus == desiredFocus) if (currentFocus == desiredFocus)
{ {
/* This was from a request from the front end. Mark as done. */ /* This was from a request from the front end. Mark as done. */
@ -82,7 +83,7 @@
NSDebugLLog(@"Focus", @"Got focus:%d (current = %d, key = %d)", NSDebugLLog(@"Focus", @"Got focus:%d (current = %d, key = %d)",
win_num, currentFocus, key_num); win_num, currentFocus, key_num);
NSDebugLLog(@"Focus", @" result of focus request"); NSDebugLLog(@"Focus", @" result of focus request");
printf("%s",[[self WindowDetail:EVENT_WINDOW(hwnd)] cString]); printf("%s", [[self WindowDetail:EVENT_WINDOW(hwnd)] cString]);
fflush(stdout); fflush(stdout);
#endif #endif
return 0; return 0;
@ -91,7 +92,7 @@
- (void) decodeWM_KILLFOCUSParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd - (void) decodeWM_KILLFOCUSParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{ {
// reused from original author (added debug output) // reused from original author (added debug output)
NSPoint eventLocation = NSMakePoint(0,0); NSPoint eventLocation = NSMakePoint(0, 0);
NSEvent * ev=nil; NSEvent * ev=nil;
ev = [NSEvent otherEventWithType:NSAppKitDefined ev = [NSEvent otherEventWithType:NSAppKitDefined
@ -110,7 +111,7 @@
#ifdef __KILLFOCUS__ #ifdef __KILLFOCUS__
NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "KILLFOCUS", hwnd); NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "KILLFOCUS", hwnd);
NSDebugLLog(@"Focus", @"Got KILLFOCUS (focus out) for %d", hwnd); NSDebugLLog(@"Focus", @"Got KILLFOCUS (focus out) for %d", hwnd);
printf("%s",[[self WindowDetail:EVENT_WINDOW(hwnd)] cString]); printf("%s", [[self WindowDetail:EVENT_WINDOW(hwnd)] cString]);
fflush(stdout); fflush(stdout);
#endif #endif
} }

View file

@ -21,7 +21,8 @@
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/ */
@ -141,8 +142,8 @@ invalidateWindow(WIN32Server *svr, HWND hwnd, RECT rect)
//NSLog(@"Window wstyle %d for style %d", wstyle, style); //NSLog(@"Window wstyle %d for style %d", wstyle, style);
#ifdef __W32_debug__ #ifdef __W32_debug__
printf("\n\n##############################################################\n"); printf("\n\n##############################################################\n");
printf("GS Window Style %u\n",style); printf("GS Window Style %u\n", style);
printf("Win32 Style picked %ld [hex] %X\n",wstyle,(unsigned int)wstyle); printf("Win32 Style picked %ld [hex] %X\n", wstyle, (unsigned int)wstyle);
printf("\n\n##############################################################\n"); printf("\n\n##############################################################\n");
#endif #endif
return wstyle; return wstyle;
@ -167,13 +168,13 @@ invalidateWindow(WIN32Server *svr, HWND hwnd, RECT rect)
{ {
case 0: case 0:
{ {
ShowWindow(hwnd,SW_SHOW); ShowWindow(hwnd, SW_SHOW);
flags._eventHandled=YES; flags._eventHandled=YES;
} }
break; break;
case SW_PARENTCLOSING: case SW_PARENTCLOSING:
{ {
ShowWindow(hwnd,SW_SHOW); ShowWindow(hwnd, SW_SHOW);
flags._eventHandled=YES; flags._eventHandled=YES;
} }
break; break;
@ -195,10 +196,10 @@ invalidateWindow(WIN32Server *svr, HWND hwnd, RECT rect)
} }
#ifdef __SHOWWINDOW__ #ifdef __SHOWWINDOW__
printf("[wParam] show window %s\n",wParam ? "TRUE" : "FALSE"); printf("[wParam] show window %s\n", wParam ? "TRUE" : "FALSE");
printf("[lParam] requested SW_FLAG %d\n",wParam); printf("[lParam] requested SW_FLAG %d\n", wParam);
//printf("is Main Menu %d\n",_is_menu); //printf("is Main Menu %d\n", _is_menu);
printf("%s",[[self WindowDetail:EVENT_WINDOW(hwnd)] cString]); printf("%s", [[self WindowDetail:EVENT_WINDOW(hwnd)] cString]);
fflush(stdout); fflush(stdout);
#endif #endif
} }
@ -214,7 +215,7 @@ invalidateWindow(WIN32Server *svr, HWND hwnd, RECT rect)
{ {
// GS handles this for now... // GS handles this for now...
#ifdef __ERASEBKGND__ #ifdef __ERASEBKGND__
printf("%s",[[self WindowDetail:EVENT_WINDOW(hwnd)] cString]); printf("%s", [[self WindowDetail:EVENT_WINDOW(hwnd)] cString]);
fflush(stdout); fflush(stdout);
#endif #endif
return (LRESULT)1; return (LRESULT)1;
@ -233,12 +234,12 @@ invalidateWindow(WIN32Server *svr, HWND hwnd, RECT rect)
BOOL bErase // erase state BOOL bErase // erase state
);*/ );*/
//theHdc=BeginPaint(hwnd,lpPaint); //theHdc=BeginPaint(hwnd, lpPaint);
//if (flags.HOLD_PAINT_FOR_SIZING==FALSE) //if (flags.HOLD_PAINT_FOR_SIZING==FALSE)
// { // {
if (GetUpdateRect(hwnd, &rect, NO)) if (GetUpdateRect(hwnd, &rect, NO))
{ {
//InvalidateRect(hwnd,rect,YES); //InvalidateRect(hwnd, rect, YES);
invalidateWindow(self, hwnd, rect); invalidateWindow(self, hwnd, rect);
// validate the whole window, for in some cases an infinite series // validate the whole window, for in some cases an infinite series
@ -251,8 +252,8 @@ invalidateWindow(WIN32Server *svr, HWND hwnd, RECT rect)
//printf("WM_PAINT\n"); //printf("WM_PAINT\n");
#ifdef __PAINT__ #ifdef __PAINT__
printf("%s",[[self WindowDetail:EVENT_WINDOW(hwnd)] cString]); printf("%s", [[self WindowDetail:EVENT_WINDOW(hwnd)] cString]);
printf("%s",[[self MSRectDetails:rect] cString]); printf("%s", [[self MSRectDetails:rect] cString]);
fflush(stdout); fflush(stdout);
#endif #endif
} }
@ -321,8 +322,8 @@ invalidateWindow(WIN32Server *svr, HWND hwnd, RECT rect)
#ifdef __BACKING__ #ifdef __BACKING__
NSDebugLLog(@"NSEvent", @"Change backing store to %d %d", r.right - r.left, r.bottom - r.top); NSDebugLLog(@"NSEvent", @"Change backing store to %d %d", r.right - r.left, r.bottom - r.top);
printf("RESIZING BACKING Store\n"); printf("RESIZING BACKING Store\n");
printf("%s",[[self WindowDetail:EVENT_WINDOW(hwnd)] cString]); printf("%s", [[self WindowDetail:EVENT_WINDOW(hwnd)] cString]);
printf("New Rect: %s",[[self MSRectDetails:r] cString]); printf("New Rect: %s", [[self MSRectDetails:r] cString]);
fflush(stdout); fflush(stdout);
#endif #endif
} }