From d530f8e5ba598b235946aa62f443f4ca17d1281e Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Wed, 31 Jan 2007 14:04:20 +0000 Subject: [PATCH] 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 --- Source/win32/GSDisplayServer_details.m | 8 +- Source/win32/WIN32Server.m | 115 +++++++---------- Source/win32/w32_GLcontext.m | 87 ++++++------- Source/win32/w32_GLformat.m | 23 ++-- Source/win32/w32_activate.m | 31 ++--- Source/win32/w32_create.m | 25 ++-- Source/win32/w32_debug.m | 172 +++++++++++++------------ Source/win32/w32_general.m | 25 ++-- Source/win32/w32_movesize.m | 45 +++---- Source/win32/w32_text_focus.m | 21 +-- Source/win32/w32_windowdisplay.m | 35 ++--- 11 files changed, 291 insertions(+), 296 deletions(-) diff --git a/Source/win32/GSDisplayServer_details.m b/Source/win32/GSDisplayServer_details.m index 6cdbf36..774eb89 100644 --- a/Source/win32/GSDisplayServer_details.m +++ b/Source/win32/GSDisplayServer_details.m @@ -11,14 +11,14 @@ License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This library is distributed in the hope that it will be useful, + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. */ @@ -51,12 +51,12 @@ return output; } - [output appendFormat:@"%d From the EventQue\n-> ",c]; + [output appendFormat:@"%d From the EventQue\n-> ", c]; for (i=0;i " - ,i,[(NSEvent *)[event_queue objectAtIndex:i] type]]; + , i, [(NSEvent *)[event_queue objectAtIndex:i] type]]; } [output appendString:@"\n"]; return output; diff --git a/Source/win32/WIN32Server.m b/Source/win32/WIN32Server.m index db5cb49..19fbdb7 100644 --- a/Source/win32/WIN32Server.m +++ b/Source/win32/WIN32Server.m @@ -1,6 +1,6 @@ /* 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 Date: March 2002 @@ -14,14 +14,14 @@ License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This library is distributed in the hope that it will be useful, + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. */ @@ -63,9 +63,9 @@ static NSString *NSMenuWillTearOff = @"MenuWillTearOff"; static NSString *NSMenuwillPopUP =@"MenuwillPopUP"; static NSString *NSWindowDidCreateWindow =@"WindowDidCreateWindow"; -static NSEvent *process_key_event(WIN32Server *svr, +static NSEvent *process_key_event(WIN32Server *svr, HWND hwnd, WPARAM wParam, LPARAM lParam, NSEventType eventType); -static NSEvent *process_mouse_event(WIN32Server *svr, +static NSEvent *process_mouse_event(WIN32Server *svr, HWND hwnd, WPARAM wParam, LPARAM lParam, NSEventType eventType); //static BOOL HAVE_MAIN_MENU = NO; @@ -73,7 +73,7 @@ static BOOL handlesWindowDecorations = NO; static void validateWindow(WIN32Server *svr, HWND hwnd, RECT rect); -LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, +LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); @implementation WIN32Server @@ -99,7 +99,8 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, } 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); } } @@ -147,7 +148,7 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, inMode: mode dequeue: flag]; - printf("Got EventType %d\n",[theEvent type]); + printf("Got EventType %d\n", [theEvent type]); return theEvent; #else @@ -163,14 +164,14 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, { [self callback: nil]; [super discardEventsMatchingMask: mask - beforeEvent: limit]; + beforeEvent: limit]; } // server /* Initialize AppKit backend */ -+ (void)initializeBackend ++ (void) initializeBackend { #ifdef __debugServer__ @@ -264,28 +265,11 @@ printf("\n\n##############################################################\n"); watcher: (id)self forMode: mode]; #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 type: ET_WINMSG watcher: (id)self forMode: mode]; #endif -#endif } /** @@ -439,7 +423,7 @@ to control debug output... or log specific event to a log panel. NSTextField *theText; NSTextField *theText2; - rect = NSMakeRect (715,800,236,182); + rect = NSMakeRect (715, 800, 236, 182); configWindow = RETAIN([[NSWindow alloc] initWithContentRect: rect styleMask: style backing: NSBackingStoreBuffered @@ -448,7 +432,7 @@ to control debug output... or log specific event to a log panel. [configWindow setReleasedWhenClosed: NO]; 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 setEditable: NO]; [theText setEnabled: NO]; @@ -461,7 +445,7 @@ to control debug output... or log specific event to a log panel. /* 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 setEditable: NO]; [theText1 setEnabled: NO]; @@ -471,7 +455,7 @@ to control debug output... or log specific event to a log panel. [[theText1 cell] setBezeled: NO]; [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 setEditable: NO]; [theText2 setEnabled: NO]; @@ -483,7 +467,7 @@ to control debug output... or log specific event to a log panel. // popup for style styleButton - = [[NSPopUpButton alloc] initWithFrame: NSMakeRect (30,80,171,22)]; + = [[NSPopUpButton alloc] initWithFrame: NSMakeRect (30, 80, 171, 22)]; [styleButton setAutoenablesItems: YES]; [styleButton setTarget: self]; [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 - taskbarButton = [[NSButton alloc] initWithFrame: NSMakeRect (30,55,171,22)]; + taskbarButton = [[NSButton alloc] initWithFrame: NSMakeRect (30, 55, 171, 22)]; [taskbarButton setButtonType: NSSwitchButton]; [taskbarButton setTitle: @"Use Win Taskbar"]; [taskbarButton setTarget: self]; [taskbarButton setAction: @selector(setTaskBar:)]; [content addSubview: taskbarButton]; // 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 setTitle: @"Save to defaults"]; [saveButton setTarget: self]; @@ -577,9 +561,9 @@ to control debug output... or log specific event to a log panel. // user must restart application for changes - NSRunInformationalAlertPanel(@"Server Preferences Changed", - @"Changes will take affect on the next restart", - @"OK",nil, nil); + NSRunInformationalAlertPanel(@"Server Preferences Changed", + @"Changes will take affect on the next restart", + @"OK", nil, nil); flags.HAVE_SERVER_PREFS = YES; [configWindow close]; [saveButton setEnabled: NO]; @@ -639,7 +623,7 @@ NSWindowDidEndSheetNotification notification does not contain a userInfo dictionary. NSWindowDidExposeNotification - Posted whenever a portion of a nonretained NSWindow is exposed, + Posted whenever a portion of a nonretained NSWindow is exposed, whether by being ordered in front of other windows or by other windows being removed from in front of it. The notification object is the NSWindow that has been exposed. The userInfo @@ -885,7 +869,7 @@ printf("\n\n##############################################################\n"); if ((int)hwnd == win) { /* - * If the window at the point we want is excluded, + * If the window at the point we want is excluded, * we must look through ALL windows at a lower level * until we find one which contains the same point. */ @@ -1259,12 +1243,12 @@ printf("\n\n##############################################################\n"); if ([self displayEvent: uMsg]== YES) { printf("\n\n\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"); - printf("+++ NEW EVENT CYCLE %u +++\n",uMsg); + printf("+++ NEW EVENT CYCLE %u +++\n", uMsg); printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"); #ifdef __W32_debug_Event_loop - printf("Events Posted = %d\n",flags.eventQueCount); - printf("EVENT Que Count = %d\n",(int)[GSCurrentServer() eventQueCount]); - printf("%s",[[GSCurrentServer() dumpQue: 10] cString]); + printf("Events Posted = %d\n", flags.eventQueCount); + printf("EVENT Que Count = %d\n", (int)[GSCurrentServer() eventQueCount]); + printf("%s", [[GSCurrentServer() dumpQue: 10] cString]); #endif } #endif @@ -1493,7 +1477,7 @@ printf("\n\n##############################################################\n"); default: // Process all other messages. #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 NSDebugLLog(@"NSEvent", @"Got unhandled Message %d for %d", uMsg, hwnd); break; @@ -1514,9 +1498,9 @@ printf("\n\n##############################################################\n"); #ifdef __W32_debug__ if ([ev type]== NSAppKitDefined) { - printf("uMsg %d ",uMsg); - printf("Post event %s ",[[ev eventNameWithSubtype: YES] cString]); - printf("on window %s\n",[[[ev window] className] cString]); + printf("uMsg %d ", uMsg); + printf("Post event %s ", [[ev eventNameWithSubtype: YES] cString]); + printf("on window %s\n", [[[ev window] className] cString]); } #endif return 0; @@ -1631,11 +1615,11 @@ printf("\n\n##############################################################\n"); #ifdef __debugServer__ printf("\n\n##############################################################\n"); - printf("handlesWindowDecorations %s\n",handlesWindowDecorations ? "YES" : "NO"); - printf("checking for NSMiniaturizableWindowMask %u\n",(style & NSMiniaturizableWindowMask)); - printf("GS Window Style %u\n",style); - printf("Extended Style %d [hex] %X\n",(int)estyle,(UINT)estyle); - printf("Win32 Style picked %ld [hex] %X\n",wstyle,(unsigned int)wstyle); + printf("handlesWindowDecorations %s\n", handlesWindowDecorations ? "YES" : "NO"); + printf("checking for NSMiniaturizableWindowMask %u\n", (style & NSMiniaturizableWindowMask)); + printf("GS Window Style %u\n", style); + printf("Extended Style %d [hex] %X\n", (int)estyle, (UINT)estyle); + printf("Win32 Style picked %ld [hex] %X\n", wstyle, (unsigned int)wstyle); printf("\n##############################################################\n"); #endif @@ -1643,21 +1627,21 @@ printf("\n\n##############################################################\n"); * from here down is reused and unmodified from WIN32EventServer.m * which has been removed form the subproject */ - NSDebugLLog(@"WTrace", @"window: %@ : %d : %d : %d", NSStringFromRect(frame), + NSDebugLLog(@"WTrace", @"window: %@ : %d : %d : %d", NSStringFromRect(frame), type, style, screen); NSDebugLLog(@"WTrace", @" device frame: %d, %d, %d, %d", r.left, r.top, r.right - r.left, r.bottom - r.top); - hwnd = CreateWindowEx(estyle, - "GNUstepWindowClass", - "GNUstepWindow", + hwnd = CreateWindowEx(estyle, + "GNUstepWindowClass", + "GNUstepWindow", wstyle, r.left, r.top, r.right - r.left, - r.bottom - r.top, - (HWND)NULL, - (HMENU)NULL, - hinstance, + r.bottom - r.top, + (HWND)NULL, + (HMENU)NULL, + hinstance, (void*)type); NSDebugLLog(@"WTrace", @" num/handle: %d", hwnd); @@ -1675,7 +1659,7 @@ printf("\n\n##############################################################\n"); { DWORD wstyle = [self windowStyleForGSStyle: style]; - NSAssert(handlesWindowDecorations, + NSAssert(handlesWindowDecorations, @"-stylewindow: : called when handlesWindowDecorations == NO"); NSDebugLLog(@"WTrace", @"stylewindow: %d : %d", style, winNum); @@ -1725,7 +1709,8 @@ printf("\n\n##############################################################\n"); - (void) titlewindow: (NSString*)window_title : (int) 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 @@ -1843,7 +1828,7 @@ printf("\n\n##############################################################\n"); r = GSScreenRectToMS(frame, [window styleMask], self); GetWindowRect((HWND)winNum, &r2); - SetWindowPos((HWND)winNum, NULL, + SetWindowPos((HWND)winNum, NULL, r.left, r.top, r.right - r.left, r.bottom - r.top, SWP_NOZORDER); if ((win->useHDC) @@ -1991,7 +1976,7 @@ printf("\n\n##############################################################\n"); { /* If we don't handle decorations, all our windows are going to be - border- and decorationless. In that case, -gui won't call this method, + border- and decorationless. In that case, -gui won't call this method, but we still use it internally. */ *l = *r = *t = *b = 0.0; @@ -2420,7 +2405,7 @@ process_mouse_event(WIN32Server *svr, HWND hwnd, WPARAM wParam, LPARAM lParam, } -LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, +LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { WIN32Server *ctxt = (WIN32Server *)GSCurrentServer(); diff --git a/Source/win32/w32_GLcontext.m b/Source/win32/w32_GLcontext.m index 63ffb7f..2eb6c83 100644 --- a/Source/win32/w32_GLcontext.m +++ b/Source/win32/w32_GLcontext.m @@ -1,7 +1,7 @@ /* -*- mode:ObjC -*- 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 Date: Jan 2007 @@ -13,14 +13,15 @@ License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This library is distributed in the hope that it will be useful, + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public 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. */ @@ -39,9 +40,9 @@ #define NSOPENGLSUBWINDOWNAME "NSOpenGLSubwindow" extern LRESULT CALLBACK MainWndProc( - HWND hWnd, - UINT message, - WPARAM wParam, + HWND hWnd, + UINT message, + WPARAM wParam, LPARAM lParam ); @interface Win32Subwindow : NSObject @@ -59,9 +60,9 @@ int setupPixelFormat(HDC hDC, LPPIXELFORMATDESCRIPTOR ppfd ); LRESULT CALLBACK win32SubwindowProc( - HWND hWnd, - UINT message, - WPARAM wParam, + HWND hWnd, + UINT message, + WPARAM wParam, LPARAM lParam ); @implementation Win32Subwindow @@ -79,8 +80,8 @@ LRESULT CALLBACK win32SubwindowProc( wclss.cbClsExtra = 0; wclss.cbWndExtra = 0; wclss.hInstance = hInstance; - wclss.hIcon = LoadIcon(NULL,IDI_APPLICATION); - wclss.hCursor = LoadCursor(NULL,IDC_ARROW); + wclss.hIcon = LoadIcon(NULL, IDI_APPLICATION); + wclss.hCursor = LoadCursor(NULL, IDC_ARROW); wclss.hbrBackground = NULL; wclss.lpszMenuName = NULL; wclss.lpszClassName = NSOPENGLSUBWINDOWCLASS; @@ -89,7 +90,7 @@ LRESULT CALLBACK win32SubwindowProc( atom = RegisterClass(&wclss); 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 @@ -142,7 +143,7 @@ LRESULT CALLBACK win32SubwindowProc( /* Grab the window class we have registered on [+initialize] */ atom = GetClassInfo( hInstance, NSOPENGLSUBWINDOWCLASS, &wclss ); - NSAssert(atom,@"MS window class not found !"); + NSAssert(atom, @"MS window class not found !"); RECT parent_rect; GetWindowRect((HWND)[win windowNumber], &parent_rect); @@ -152,15 +153,15 @@ LRESULT CALLBACK win32SubwindowProc( width = NSWidth(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( - NSOPENGLSUBWINDOWCLASS, NSOPENGLSUBWINDOWNAME, - WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE, - x, y, width, height, + NSOPENGLSUBWINDOWCLASS, NSOPENGLSUBWINDOWNAME, + WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE, + x, y, width, height, (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 ); } @@ -189,7 +190,7 @@ LRESULT CALLBACK win32SubwindowProc( win = [attached window]; NSAssert1(win, @"%@'s window is nil now!", attached); - NSAssert1(![attached isRotatedOrScaledFromBase], + NSAssert1(![attached isRotatedOrScaledFromBase], @"%@ is rotated or scaled, now!", attached); server = GSServerForWindow(win); @@ -227,7 +228,7 @@ LRESULT CALLBACK win32SubwindowProc( width = NSWidth(rect); height = NSHeight(rect); - MoveWindow(winid,x, y, width, height,/*FIXME*/TRUE); + MoveWindow(winid, x, y, width, height, /*FIXME*/TRUE); } - (void) dealloc @@ -361,7 +362,7 @@ static Win32GLContext *currentGLContext; [NSException raise: NSGenericException format: @"GL Context is not bind, cannot be made current"]; - NSAssert(wgl_context && format->wgl_drawable, + NSAssert(wgl_context && format->wgl_drawable, NSInternalInconsistencyException); NSDebugMLLog(@"WGL", @"before wglMakeCurrent"); @@ -420,11 +421,11 @@ static Win32GLContext *currentGLContext; // GLXFBConfig *conf_tab; // int n_elem; // int attrs[] = { -// GLX_DOUBLEBUFFER, 1, -// GLX_DEPTH_SIZE, 16, -// GLX_RED_SIZE, 1, -// GLX_BLUE_SIZE, 1, -// GLX_GREEN_SIZE, 1, +// GLX_DOUBLEBUFFER, 1, +// GLX_DEPTH_SIZE, 16, +// GLX_RED_SIZE, 1, +// GLX_BLUE_SIZE, 1, +// GLX_GREEN_SIZE, 1, // None // }; @@ -432,7 +433,7 @@ static Win32GLContext *currentGLContext; // if (n_elem > 0) // { // printf("found %d context\n", n_elem); -// // win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 10, 10, +// // win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 10, 10, // // 800, 600, 1, 0, 1); // glx_drawable = glXCreateWindow(dpy, *conf_tab, xsubwin->winid, NULL); @@ -446,7 +447,7 @@ static Win32GLContext *currentGLContext; //FIXME //The following line should be the good one. But it crashes my X server... -// glx_drawable = glXCreateWindow(dpy, *format->conf_tab, xsubwin->winid, +// glx_drawable = glXCreateWindow(dpy, *format->conf_tab, xsubwin->winid, // NULL); NSDebugMLLog(@"WGL", @"wgl_window : %u", win); } @@ -469,37 +470,37 @@ static Win32GLContext *currentGLContext; @end LRESULT CALLBACK win32SubwindowProc( - HWND hWnd, - UINT message, - WPARAM wParam, + HWND hWnd, + UINT message, + WPARAM wParam, LPARAM lParam ) { Win32Subwindow *wsubwin; Win32GLContext* ctx = nil; - NSDebugFLLog(@"WGLEvents",@"Entering."); - wsubwin = (Win32Subwindow*) GetWindowLongPtr(hWnd,GWLP_USERDATA); + NSDebugFLLog(@"WGLEvents", @"Entering."); + wsubwin = (Win32Subwindow*) GetWindowLongPtr(hWnd, GWLP_USERDATA); if(wsubwin) ctx = (Win32GLContext*)[wsubwin->attached openGLContext]; switch (message) { case WM_CREATE: - NSDebugFLLog(@"WGLEvents",@"WM_CREATE event received."); + NSDebugFLLog(@"WGLEvents", @"WM_CREATE event received."); wsubwin = (Win32Subwindow*)(((LPCREATESTRUCT) lParam)->lpCreateParams); ctx = (Win32GLContext*)[wsubwin->attached openGLContext]; - NSDebugFLLog(@"WGLEvents",@"subwindow : %@", wsubwin); + NSDebugFLLog(@"WGLEvents", @"subwindow : %@", wsubwin); // initialize OpenGL rendering NSCAssert(wsubwin->hDC = GetDC(hWnd), @"No DC"); [ctx->format _setDrawable: wsubwin->hDC]; //TODO setupPalette(wsubwin->hDC); NSCAssert( - ctx->wgl_context = wglCreateContext(wsubwin->hDC), + ctx->wgl_context = wglCreateContext(wsubwin->hDC), @"wglCreateContext failed"); // wglMakeCurrent(wsubwin->hDC, hGLRC) - SetWindowLongPtr(hWnd,GWLP_USERDATA,(LONG_PTR)wsubwin); - NSDebugFLLog(@"WGLEvents",@"WM_CREATE done."); + SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)wsubwin); + NSDebugFLLog(@"WGLEvents", @"WM_CREATE done."); return 0; case WM_DESTROY: - NSDebugFLLog(@"WGLEvents",@"WM_DESTROY event received."); + NSDebugFLLog(@"WGLEvents", @"WM_DESTROY event received."); // finish OpenGL rendering if(ctx->wgl_context) { @@ -510,7 +511,7 @@ LRESULT CALLBACK win32SubwindowProc( DeleteObject(hPalette); }*/ ReleaseDC(hWnd, wsubwin->hDC); - NSDebugFLLog(@"WGLEvents",@"WM_DESTROY done."); + NSDebugFLLog(@"WGLEvents", @"WM_DESTROY done."); return 0; /* case WM_SIZE: // track window size changes @@ -562,12 +563,12 @@ LRESULT CALLBACK win32SubwindowProc( } break;*/ default: - NSDebugFLLog(@"WGLEvents",@"other event received (%u).",message); -// return MainWndProc((HWND)GetWindowLongPtr(hWnd,GWLP_HWNDPARENT), message, wParam, lParam); + NSDebugFLLog(@"WGLEvents", @"other event received (%u).", message); +// return MainWndProc((HWND)GetWindowLongPtr(hWnd, GWLP_HWNDPARENT), message, wParam, lParam); return DefWindowProc(hWnd, message, wParam, lParam); break; } - NSDebugFLLog(@"WGLEvents",@"Failed."); + NSDebugFLLog(@"WGLEvents", @"Failed."); return FALSE; } diff --git a/Source/win32/w32_GLformat.m b/Source/win32/w32_GLformat.m index 2367ba6..8701aa6 100644 --- a/Source/win32/w32_GLformat.m +++ b/Source/win32/w32_GLformat.m @@ -1,7 +1,7 @@ /* -*- mode:ObjC -*- 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 Date: Jan 2007 @@ -13,14 +13,15 @@ License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This library is distributed in the hope that it will be useful, + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. - + You should have received a copy of the GNU Library General Public 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" @@ -165,24 +166,24 @@ static void attributesWGL2NS( LPPIXELFORMATDESCRIPTOR ppfd, NSOpenGLPixelFormatA - (id)initWithAttributes: (NSOpenGLPixelFormatAttribute *) attribs { - NSDebugMLLog(@"WGL",@"will init"); + NSDebugMLLog(@"WGL", @"will init"); self = [super init]; if(self) { wgl_drawable = 0; wgl_pixelformat = 0; - attributesNS2WGL(attribs,&pfd); + attributesNS2WGL(attribs, &pfd); } return self; } #if 0 //FIXME, what screen number ? if (GSglxMinorVersion (dpy) >= 3) - conf.tab = glXChooseFBConfig(dpy, DefaultScreen(dpy), [data mutableBytes], + conf.tab = glXChooseFBConfig(dpy, DefaultScreen(dpy), [data mutableBytes], &n_elem); else - conf.visual = glXChooseVisual(dpy, DefaultScreen(dpy), + conf.visual = glXChooseVisual(dpy, DefaultScreen(dpy), [data mutableBytes]); if (((GSglxMinorVersion (dpy) >= 3) @@ -238,14 +239,14 @@ static void attributesWGL2NS( LPPIXELFORMATDESCRIPTOR ppfd, NSOpenGLPixelFormatA - (void) _setDrawable: (HDC) aDrawable { NSCAssert( - wgl_pixelformat = ChoosePixelFormat(aDrawable, &pfd), + wgl_pixelformat = ChoosePixelFormat(aDrawable, &pfd), @"ChoosePixelFormat failed."); NSCAssert( - SetPixelFormat(aDrawable, wgl_pixelformat, &pfd), + SetPixelFormat(aDrawable, wgl_pixelformat, &pfd), @"SetPixelFormat failed."); wgl_drawable = aDrawable; - NSDebugFLLog(@"WGL",@"found : %u",wgl_pixelformat); + NSDebugFLLog(@"WGL", @"found : %u", wgl_pixelformat); } - (void) dealloc diff --git a/Source/win32/w32_activate.m b/Source/win32/w32_activate.m index e61f978..83f6094 100644 --- a/Source/win32/w32_activate.m +++ b/Source/win32/w32_activate.m @@ -11,14 +11,15 @@ License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This library is distributed in the hope that it will be useful, + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public 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) target=YES; - printf("RECEIVER [hwnd]%s\n",[[EVENT_WINDOW(hwnd) className] cString]); - printf("ON [lParam]%s\n",[[EVENT_WINDOW(lParam) className] cString]); + printf("RECEIVER [hwnd]%s\n", [[EVENT_WINDOW(hwnd) className] cString]); + printf("ON [lParam]%s\n", [[EVENT_WINDOW(lParam) className] cString]); - printf("[lParam] %s",[[self gswindowstate:EVENT_WINDOW(lParam)] cString]); - printf("ACTIVATE_FLAG STATE %d \n",flags._last_WM_ACTIVATE); + printf("[lParam] %s", [[self gswindowstate:EVENT_WINDOW(lParam)] cString]); + 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); #endif @@ -133,17 +134,17 @@ #ifdef __WM_ACTIVATEAPP__ - printf("NSApp is:[%s]\n",active ? "active" : "inactive"); - printf("lParam is [%s]\n thread = [%u]\n w32_Class[%s] \n", - (int)wParam ? "TRUE": "FALSE", - (unsigned int)lParam, + printf("NSApp is:[%s]\n", active ? "active" : "inactive"); + printf("lParam is [%s]\n thread = [%u]\n w32_Class[%s] \n", + (int)wParam ? "TRUE": "FALSE", + (unsigned int)lParam, [[self getNativeClassName:hwnd] cString]); // debug GS_state details - printf("%s",[[self gswindowstate:EVENT_WINDOW(hwnd)] cString]); - printf("%s",[[self gswindowstate:EVENT_WINDOW(wParam)] cString]); - printf("eventHandled=[%s]\n",flags._eventHandled ? "YES" : "NO"); + printf("%s", [[self gswindowstate:EVENT_WINDOW(hwnd)] cString]); + printf("%s", [[self gswindowstate:EVENT_WINDOW(wParam)] cString]); + 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); #endif diff --git a/Source/win32/w32_create.m b/Source/win32/w32_create.m index ac2b0aa..47d289d 100644 --- a/Source/win32/w32_create.m +++ b/Source/win32/w32_create.m @@ -14,14 +14,15 @@ License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This library is distributed in the hope that it will be useful, + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public 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__ printf("WM_NCCREATE\n"); #ifdef __W32_debug__ - printf("%s",[[self w32_createDetails:(LPCREATESTRUCT)lParam] cString]); + printf("%s", [[self w32_createDetails:(LPCREATESTRUCT)lParam] cString]); #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); #endif @@ -86,18 +87,18 @@ #ifdef __WM_CREATE__ printf("WM_CREATE: *********************\n"); #ifdef __W32_debug__ - printf("%s",[[self w32_createDetails:(LPCREATESTRUCT)lParam] cString]); + printf("%s", [[self w32_createDetails:(LPCREATESTRUCT)lParam] cString]); fflush(stdout); #endif - printf("Parent isa %s\n",[[self getNativeClassName:GetParent(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("HAVE_MAIN_MENU = %s\n",flags.HAVE_MAIN_MENU ? "YES": "NO"); - printf("Main Menu Window Num: %d Currrent window Num: %d\n", - [[[NSApp mainMenu] window] windowNumber],(int)hwnd); - printf("Window Task bar flag %s\n",flags.useWMTaskBar ? "YES" : "NO"); + printf("Parent isa %s\n", [[self getNativeClassName:GetParent(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("HAVE_MAIN_MENU = %s\n", flags.HAVE_MAIN_MENU ? "YES": "NO"); + printf("Main Menu Window Num: %d Currrent window Num: %d\n", + [[[NSApp mainMenu] window] windowNumber], (int)hwnd); + printf("Window Task bar flag %s\n", flags.useWMTaskBar ? "YES" : "NO"); #endif return 0; diff --git a/Source/win32/w32_debug.m b/Source/win32/w32_debug.m index a6ed97f..74f068b 100644 --- a/Source/win32/w32_debug.m +++ b/Source/win32/w32_debug.m @@ -11,14 +11,15 @@ License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This library is distributed in the hope that it will be useful, + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public 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" @@ -40,10 +41,10 @@ static NSString * spacer =@"\n"; printf("*******************testing Conversion \n\n\n"); printf("MSScreenRectToGS GSScreenRectToMS\n"); gsrect = MSScreenRectToGS(r, [window styleMask], self); - msrect= GSScreenRectToMS(gsrect, [window styleMask],self); + msrect= GSScreenRectToMS(gsrect, [window styleMask], self); printf("*************************test complete\n\n\n"); - [self print_result:msrect and:gsrect and:r]; + [self print_result: msrect and: gsrect and: r]; //TestsDone=YES; } @@ -51,20 +52,20 @@ static NSString * spacer =@"\n"; { printf("MS - Control\n"); - printf("MSrect = left %ld ",control.left); - printf(" top %ld",control.top); - printf(" right %ld",control.right); - printf(" Bottom %ld\n",control.bottom); + printf("MSrect = left %ld ", control.left); + printf(" top %ld", control.top); + printf(" right %ld", control.right); + printf(" Bottom %ld\n", control.bottom); printf("GS - Calculated\n"); - 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("NSRect = height %f width %f ", gsrect.size.height, gsrect.size.width); + printf(" X %f Y %f\n", gsrect.origin.x, gsrect.origin.y); printf("MS - Calculated\n"); - printf("MSrect = left %ld ",msrect.left); - printf(" top %ld",msrect.top); - printf(" right %ld",msrect.right); - printf(" Bottom %ld\n",msrect.bottom); + printf("MSrect = left %ld ", msrect.left); + printf(" top %ld", msrect.top); + printf(" right %ld", msrect.right); + printf(" Bottom %ld\n", msrect.bottom); } - (BOOL) displayEvent:(unsigned int)uMsg @@ -169,25 +170,26 @@ typedef struct tagCREATESTRUCT { - (NSMutableString *) w32_createDetails:(LPCREATESTRUCT)details { + NSMutableString * output= [NSMutableString stringWithString: spacer]; - NSMutableString * output= [NSMutableString stringWithString:spacer]; [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", - [self getNativeClassName:details->hwndParent]]; + [output appendFormat:@"Creating window: Parent is %s:\n", + [self getNativeClassName: details->hwndParent]]; - [output appendFormat:@"Co-ordanates:height[%d] width[%d] Pos[%d] Pox[%d]\n", - details->cy,details->cx,details->y,details->x]; + [output appendFormat:@"Co-ordanates: height[%d] width[%d] Pos[%d] Pox[%d]\n", + details->cy, details->cx, details->y, details->x]; - [output appendFormat:@"Style %lu Name: %s Win32Class: %s Extended Style %ld\n\n\n", - details->style,details->lpszName, - details->lpszClass,details->dwExStyle]; - [output appendString:spacer]; + [output appendFormat: + @"Style %lu Name: %s Win32Class: %s Extended Style %ld\n\n\n", + details->style, details->lpszName, + details->lpszClass, details->dwExStyle]; + [output appendString: spacer]; return output; } @@ -198,24 +200,24 @@ typedef struct tagCREATESTRUCT { 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;iptMaxSize.x,mm->ptMaxSize.y]; + [output appendFormat:@"ptMaxSize width[%ld] X height[%ld]\n", + mm->ptMaxSize.x, mm->ptMaxSize.y]; - [output appendFormat:@"ptMaxPosition width[%ld] X height[%ld]\n", - mm->ptMaxPosition.x,mm->ptMaxPosition.y]; + [output appendFormat:@"ptMaxPosition width[%ld] X height[%ld]\n", + mm->ptMaxPosition.x, mm->ptMaxPosition.y]; - [output appendFormat:@"ptMinTrackSize width[%ld] X height[%ld]\n", - mm->ptMinTrackSize.x,mm->ptMinTrackSize.y]; + [output appendFormat:@"ptMinTrackSize width[%ld] X height[%ld]\n", + mm->ptMinTrackSize.x, mm->ptMinTrackSize.y]; - [output appendFormat:@"ptMaxTrackSize width[%ld] X height[%ld]\n", - mm->ptMaxTrackSize.x,mm->ptMaxTrackSize.y]; + [output appendFormat:@"ptMaxTrackSize width[%ld] X height[%ld]\n", + mm->ptMaxTrackSize.x, mm->ptMaxTrackSize.y]; return output; } @@ -322,17 +324,17 @@ typedef struct tagCREATESTRUCT { NSRect cvRect = [cView frame]; NSRect svRect = [sView frame]; NSRect tRect; - NSMutableString * output =[NSMutableString stringWithString:spacer]; + NSMutableString * output =[NSMutableString stringWithString: spacer]; [output appendFormat:@"subView Details for %@\n", [theWindow title]]; - [output appendFormat:@"superRect %@", [self NSRectDetails:svRect]]; - [output appendFormat:@"contentRect %@", [self NSRectDetails:cvRect]]; + [output appendFormat:@"superRect %@", [self NSRectDetails: svRect]]; + [output appendFormat:@"contentRect %@", [self NSRectDetails: cvRect]]; for (i=0;i