* Source/win32/: Fixed a compile error when debug flags were

activated. Removed detailed documation from MS. Read and
write correctly from defaults.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@21851 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2005-10-21 03:07:19 +00:00
parent 0a5674d15c
commit f15240096a
16 changed files with 1343 additions and 2303 deletions

View file

@ -1,3 +1,9 @@
2005-10-20 Tom MacSween <macsweent@sympatico.ca>
* Source/win32/: Fixed a compile error when debug flags were
activated. Removed detailed documation from MS. Read and
write correctly from defaults.
2005-09-19 Adam Fedor <fedor@gnu.org>
* Version 0.10.1

View file

@ -44,7 +44,11 @@
#include <AppKit/NSEvent.h>
#include <AppKit/NSCursor.h>
#include <AppKit/NSText.h>
#include <AppKit/NSPopUpButton.h>
#include <AppKit/NSPanel.h>
#include <AppKit/DPSOperators.h>
#include <AppKit/NSImage.h>
#include "win32/WIN32Server.h"
@ -69,17 +73,14 @@
//#define __W32_debug__ // event frame debugging/logging
#define EVENT_WINDOW(lp) (GSWindowWithNumber((int)lp))
@interface WIN32Server : GSDisplayServer
{
HINSTANCE hinstance;
HWND currentFocus;
HWND desiredFocus;
HWND currentActive;
DWORD windowStyleForGSStyle(unsigned int style);
struct {
typedef struct w32serverFlags {
BOOL useWMTaskBar;
BOOL useWMStyles;
BOOL HAVE_SERVER_PREFS;
int _last_WM_ACTIVATE;
int eventQueCount;
int menuRef; // reference to menu window
@ -91,24 +92,44 @@
BOOL HOLD_TRANSIENT_FOR_SIZE; // override GS size event on popup context
BOOL HOLD_TRANSIENT_FOR_MOVE; // override GS move event on popup context
BOOL HAVE_MAIN_MENU; // do we have a main menu?
BOOL HOLD_PAINT_FOR_SIZING;
BOOL _is_menu; // is event window the main menu?
BOOL _eventHandled; // did we handle the event?
BOOL _is_cache; // is the event window a cache rep
BOOL _hasGSClassName; // does the event window have a GSclassName
int lastEventType;
int hold;
} flags;
} serverFlags;
@interface WIN32Server : GSDisplayServer
{
serverFlags flags;
HINSTANCE hinstance;
HWND currentFocus;
HWND desiredFocus;
HWND currentActive;
HICON currentAppIcon;
// config window
NSWindow *configWindow;
NSPopUpButton * styleButton;
NSButton * taskbarButton;
NSButton * saveButton;
}
- (LRESULT) windowEventProc: (HWND)hwnd : (UINT)uMsg
: (WPARAM)wParam : (LPARAM)lParam;
- (void) initConfigWindow;
- (void) setStyle:(id)sender;
- (void) setTaskBar:(id)sender;
- (void) setSave:(id)sender;
- (void) setFlagsforEventLoop: (HWND)hwnd;
- (NSString *) getNativeClassName: (HWND)hwnd;
- (NSString *) getWindowtext: (HWND)hwnd;
// declared but should be implimented in a subclass window server
// (subclass resposibility)
// declared but should be implimented in a subclass window server (subclass resposibility)
- (LRESULT) decodeWM_ACTIVEParams: (WPARAM)wParam : (LPARAM)lParam
: (HWND)hwnd;
- (LRESULT) decodeWM_ACTIVEAPPParams: (HWND)hwnd : (WPARAM)wParam
@ -116,8 +137,8 @@
- (void) decodeWM_NCACTIVATEParams: (WPARAM)wParam : (LPARAM)lParam
: (HWND)hwnd;
/*
Hooks for the subclass to process notifications and syncronize the
win32 env with the application.
hooks for the subclass to process notifications and syncronize the win32 env
with the application
*/
- (void) ApplicationDidFinishLaunching: (NSNotification*)aNotification;
- (void) ApplicationWillFinishLaunching: (NSNotification*)aNotification;
@ -133,17 +154,20 @@
- (void) decodeWM_WINDOWPOSCHANGEDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (LRESULT) decodeWM_GETMINMAXINFOParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (LRESULT) decodeWM_EXITSIZEMOVEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (LRESULT) decodeWM_MOVINGParams: (HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam;
- (void) decodeWM_SIZINGParams: (HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam;
- (LRESULT) decodeWM_NCCREATEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (LRESULT) decodeWM_CREATEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (DWORD) windowStyleForGSStyle: (unsigned int) style;
- (void) decodeWM_SHOWWINDOWParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) decodeWM_NCPAINTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (LRESULT) decodeWM_ERASEBKGNDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) decodeWM_PAINTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) decodeWM_SYNCPAINTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) decodeWM_CAPTURECHANGEDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) decodeWM_GETICONParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
//- (HICON) decodeWM_GETICONParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) resizeBackingStoreFor: (HWND)hwnd;
//- (LRESULT) decodeWM_SETTEXTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
@ -156,9 +180,10 @@
- (void) decodeWM_NCDESTROYParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) decodeWM_QUERYOPENParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) decodeWM_SYSCOMMANDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) decodeWM_COMMANDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
// diagnotic and debugging
- (BOOL) displayEvent: (unsigned int)uMsg;
- (BOOL) displayEvent:(uint)uMsg;
- (void) registerForWindowEvents;
- (void) registerForViewEvents;
@end

View file

@ -1,344 +1,367 @@
# WIN32Server - Implements window handling for MSWindows
#
# Copyright (C) 2005 Free Software Foundation, Inc.
#
# Written by: Tom MacSween <macsweent@sympatico.ca>
# Date August 2005
# This file is part of the GNU Objective C User Interface Library.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# 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,
# 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.
#
#sed -f Event_format.sed result.sed >test_result.log
s/CYCLE 0 /WM_NULL 0/ g
s/CYCLE 1 /WM_CREATE 1/g
s/CYCLE 2 /WM_DESTROY 2/g
s/CYCLE 3 /WM_MOVE 3/g
s/CYCLE 5 /WM_SIZE 5/g
s/CYCLE 6 /WM_ACTIVATE 6/g
s/CYCLE 7 /WM_SETFOCUS 7/g
s/CYCLE 8 /WM_KILLFOCUS 8/g
s/CYCLE 10 /WM_ENABLE 10/g
s/CYCLE 11 /WM_SETREDRAW 11/g
s/CYCLE 12 /WM_SETTEXT 12/g
s/CYCLE 13 /WM_GETTEXT 13/g
s/CYCLE 14 /WM_GETTEXTLENGTH 14/g
s/CYCLE 15 /WM_PAINT 15/g
s/CYCLE 16 /WM_CLOSE 16/g
s/CYCLE 17 /WM_QUERYENDSESSION 17/g
s/CYCLE 18 /WM_QUIT 18/g
s/CYCLE 19 /WM_QUERYOPEN 19/g
s/CYCLE 20 /WM_ERASEBKGND 20/g
s/CYCLE 21 /WM_SYSCOLORCHANGE 21/g
s/CYCLE 22 /WM_ENDSESSION 22/g
s/CYCLE 24 /WM_SHOWWINDOW 24/g
s/CYCLE 26 /WM_SETTINGCHANGE 26/g
s/CYCLE 26 /WM_WININICHANGE 26/g
s/CYCLE 27 /WM_DEVMODECHANGE 27/g
s/CYCLE 28 /WM_ACTIVATEAPP 28/g
s/CYCLE 29 /WM_FONTCHANGE 29/g
s/CYCLE 30 /WM_TIMECHANGE 30/g
s/CYCLE 31 /WM_CANCELMODE 31/g
s/CYCLE 32 /WM_SETCURSOR 32/g
s/CYCLE 33 /WM_MOUSEACTIVATE 33/g
s/CYCLE 34 /WM_CHILDACTIVATE 34/g
s/CYCLE 35 /WM_QUEUESYNC 35/g
s/CYCLE 36 /WM_GETMINMAXINFO 36/g
s/CYCLE 38 /WM_PAINTICON 38/g
s/CYCLE 39 /WM_ICONERASEBKGND 39/g
s/CYCLE 40 /WM_NEXTDLGCTL 40/g
s/CYCLE 42 /WM_SPOOLERSTATUS 42/g
s/CYCLE 43 /WM_DRAWITEM 43/g
s/CYCLE 44 /WM_MEASUREITEM 44/g
s/CYCLE 45 /WM_DELETEITEM 45/g
s/CYCLE 46 /WM_VKEYTOITEM 46/g
s/CYCLE 47 /WM_CHARTOITEM 47/g
s/CYCLE 48 /WM_SETFONT 48/g
s/CYCLE 49 /WM_GETFONT 49/g
s/CYCLE 50 /WM_SETHOTKEY 50/g
s/CYCLE 51 /WM_GETHOTKEY 51/g
s/CYCLE 55 /WM_QUERYDRAGICON 55/g
s/CYCLE 57 /WM_COMPAREITEM 57/g
s/CYCLE 65 /WM_COMPACTING 65/g
s/CYCLE 68 /WM_COMMNOTIFY 68/g
s/CYCLE 70 /WM_WINDOWPOSCHANGING 70/g
s/CYCLE 71 /WM_WINDOWPOSCHANGED 71/g
s/CYCLE 72 /WM_POWER 72/g
s/CYCLE 74 /WM_COPYDATA 74/g
s/CYCLE 75 /WM_CANCELJOURNAL 75/g
s/CYCLE 78 /WM_NOTIFY 78/g
s/CYCLE 80 /WM_INPUTLANGCHANGEREQUEST 80/g
s/CYCLE 81 /WM_INPUTLANGCHANGE 81/g
s/CYCLE 82 /WM_TCARD 82/g
s/CYCLE 83 /WM_HELP 83/g
s/CYCLE 84 /WM_USERCHANGED 84/g
s/CYCLE 85 /WM_NOTIFYFORMAT 85/g
s/CYCLE 123 /WM_CONTEXTMENU 123/g
s/CYCLE 124 /WM_STYLECHANGING 124/g
s/CYCLE 125 /WM_STYLECHANGED 125/g
s/CYCLE 126 /WM_DISPLAYCHANGE 126/g
s/CYCLE 127 /WM_GETICON 127/g
s/CYCLE 128 /WM_SETICON 128/g
s/CYCLE 129 /WM_NCCREATE 129/g
s/CYCLE 130 /WM_NCDESTROY 130/g
s/CYCLE 131 /WM_NCCALCSIZE 131/g
s/CYCLE 132 /WM_NCHITTEST 132/g
s/CYCLE 133 /WM_NCPAINT 133/g
s/CYCLE 134 /WM_NCACTIVATE 134/g
s/CYCLE 135 /WM_GETDLGCODE 135/g
s/CYCLE 136 /WM_SYNCPAINT 136/g
s/CYCLE 160 /WM_NCMOUSEMOVE 160/g
s/CYCLE 161 /WM_NCLBUTTONDOWN 161/g
s/CYCLE 162 /WM_NCLBUTTONUP 162/g
s/CYCLE 163 /WM_NCLBUTTONDBLCLK 163/g
s/CYCLE 164 /WM_NCRBUTTONDOWN 164/g
s/CYCLE 165 /WM_NCRBUTTONUP 165/g
s/CYCLE 166 /WM_NCRBUTTONDBLCLK 166/g
s/CYCLE 167 /WM_NCMBUTTONDOWN 167/g
s/CYCLE 168 /WM_NCMBUTTONUP 168/g
s/CYCLE 169 /WM_NCMBUTTONDBLCLK 169/g
s/CYCLE 171 /WM_NCXBUTTONDOWN 171/g
s/CYCLE 172 /WM_NCXBUTTONUP 172/g
s/CYCLE 173 /WM_NCXBUTTONDBLCLK 173/g
s/CYCLE 256 /WM_KEYDOWN 256/g
s/CYCLE 256 /WM_KEYFIRST 256/g
s/CYCLE 257 /WM_KEYUP 257/g
s/CYCLE 258 /WM_CHAR 258/g
s/CYCLE 259 /WM_DEADCHAR 259/g
s/CYCLE 260 /WM_SYSKEYDOWN 260/g
s/CYCLE 261 /WM_SYSKEYUP 261/g
s/CYCLE 262 /WM_SYSCHAR 262/g
s/CYCLE 263 /WM_SYSDEADCHAR 263/g
s/CYCLE 264 /WM_KEYLAST 264/g
s/CYCLE 272 /WM_INITDIALOG 271/g
s/CYCLE 273 /WM_COMMAND 273/g
s/CYCLE 274 /WM_SYSCOMMAND 274/g
s/CYCLE 275 /WM_TIMER 275/g
s/CYCLE 276 /WM_HSCROLL 276/g
s/CYCLE 277 /WM_VSCROLL 277/g
s/CYCLE 278 /WM_INITMENU 278/g
s/CYCLE 279 /WM_INITMENUPOPUP 279/g
s/CYCLE 287 /WM_MENUSELECT 287/g
s/CYCLE 288 /WM_MENUCHAR 288/g
s/CYCLE 289 /WM_ENTERIDLE 289/g
s/CYCLE 290 /WM_MENURBUTTONUP 290/g
s/CYCLE 306 /WM_CTLCOLORMSGBOX 306/g
s/CYCLE 307 /WM_CTLCOLOREDIT 307/g
s/CYCLE 308 /WM_CTLCOLORLISTBOX 308/g
s/CYCLE 309 /WM_CTLCOLORBTN 309/g
s/CYCLE 310 /WM_CTLCOLORDLG 310/g
s/CYCLE 311 /WM_CTLCOLORSCROLLBAR 311/g
s/CYCLE 312 /WM_CTLCOLORSTATIC 312/g
s/CYCLE 512 /WM_MOUSEMOVE 512/g
s/CYCLE 512 /WM_MOUSEFIRST 512/g
s/CYCLE 513 /WM_LBUTTONDOWN 513/g
s/CYCLE 514 /WM_LBUTTONUP 514/g
s/CYCLE 515 /WM_LBUTTONDBLCLK 515/g
s/CYCLE 516 /WM_RBUTTONDOWN 516/g
s/CYCLE 517 /WM_RBUTTONUP 517/g
s/CYCLE 518 /WM_RBUTTONDBLCLK 518/g
s/CYCLE 519 /WM_MBUTTONDOWN 519/g
s/CYCLE 520 /WM_MBUTTONUP 520/g
s/CYCLE 521 /WM_MBUTTONDBLCLK 521/g
s/CYCLE 522 /WM_MOUSEWHEEL 522/g
s/CYCLE 522 /WM_MOUSELAST 522/g
s/CYCLE 523 /WM_XBUTTONDOWN 523/g
s/CYCLE 524 /WM_XBUTTONUP 524/g
s/CYCLE 525 /WM_XBUTTONDBLCLK 525/g
s/CYCLE 525 /WM_MOUSELAST 525/g
s/CYCLE 528 /WM_PARENTNOTIFY 528/g
s/CYCLE 529 /WM_ENTERMENULOOP 529/g
s/CYCLE 530 /WM_EXITMENULOOP 530/g
s/CYCLE 531 /WM_NEXTMENU 531/g
s/CYCLE 531 /WM_NEXTMENU 531/g
s/CYCLE 532 /WM_SIZING 532/g
s/CYCLE 533 /WM_CAPTURECHANGED 533/g
s/CYCLE 534 /WM_MOVING 534/g
s/CYCLE 536 /WM_POWERBROADCAST 536/g
s/CYCLE 537 /WM_DEVICECHANGE 537/g
s/CYCLE 544 /WM_MDICREATE 544/g
s/CYCLE 545 /WM_MDIDESTROY 545/g
s/CYCLE 546 /WM_MDIACTIVATE 546/g
s/CYCLE 547 /WM_MDIRESTORE 547/g
s/CYCLE 548 /WM_MDINEXT 548/g
s/CYCLE 549 /WM_MDIMAXIMIZE 549/g
s/CYCLE 550 /WM_MDITILE 550/g
s/CYCLE 551 /WM_MDICASCADE 551/g
s/CYCLE 552 /WM_MDIICONARRANGE 552/g
s/CYCLE 553 /WM_MDIGETACTIVE 553/g
s/CYCLE 560 /WM_MDISETMENU 560/g
s/CYCLE 561 /WM_ENTERSIZEMOVE 561/g
s/CYCLE 562 /WM_EXITSIZEMOVE 562/g
s/CYCLE 563 /WM_DROPFILES 563/g
s/CYCLE 564 /WM_MDIREFRESHMENU 564/g
s/CYCLE 768 /WM_CUT 768/g
s/CYCLE 769 /WM_COPY 769/g
s/CYCLE 770 /WM_PASTE 770/g
s/CYCLE 771 /WM_CLEAR 771/g
s/CYCLE 772 /WM_UNDO 772/g
s/CYCLE 773 /WM_RENDERFORMAT 773/g
s/CYCLE 774 /WM_RENDERALLFORMATS 774/g
s/CYCLE 775 /WM_DESTROYCLIPBOARD 775/g
s/CYCLE 776 /WM_DRAWCLIPBOARD 776/g
s/CYCLE 777 /WM_PAINTCLIPBOARD 777/g
s/CYCLE 778 /WM_VSCROLLCLIPBOARD 778/g
s/CYCLE 779 /WM_SIZECLIPBOARD 779/g
s/CYCLE 780 /WM_ASKCBFORMATNAME 780/g
s/CYCLE 781 /WM_CHANGECBCHAIN 781/g
s/CYCLE 782 /WM_HSCROLLCLIPBOARD 782/g
s/CYCLE 783 /WM_QUERYNEWPALETTE 783/g
s/CYCLE 784 /WM_PALETTEISCHANGING 784/g
s/CYCLE 785 /WM_PALETTECHANGED 785/g
s/CYCLE 786 /WM_HOTKEY 786/g
s/CYCLE 791 /WM_PRINT 791/g
s/CYCLE 792 /WM_PRINTCLIENT 792/g
s/CYCLE 794 /WM_THEMECHANGED 794/g
s/CYCLE 856 /WM_HANDHELDFIRST 856/g
s/CYCLE 863 /WM_HANDHELDLAST 863/g
s/CYCLE 864 /WM_AFXFIRST 864/g
s/CYCLE 895 /WM_AFXLAST 895/g
s/CYCLE 896 /WM_PENWINFIRST 896/g
s/CYCLE 911 /WM_PENWINLAST 911/g
s/CYCLE 1024 /WM_USER 1024/g
s/CYCLE 32768 /WM_APP 32768/g
s/CYCLE 0x0123 /WM_MENUDRAG 0x0123/g
s/CYCLE 0x0124 /WM_MENUGETOBJECT 0x0124/g
s/CYCLE 0x0125 /WM_UNINITMENUPOPUP 0x0125/g
s/CYCLE 0x0126 /WM_MENUCOMMAND 0x0126/g
s/CYCLE 0x02A0 /WM_NCMOUSEHOVER 0x02A0/g
s/CYCLE 0x02A2 /WM_NCMOUSELEAVE 0x02A2/g
s/CYCLE 0x2A1 /WM_MOUSEHOVER 0x2A1/g
s/CYCLE 0x2A3 /WM_MOUSELEAVE 0x2A3/g
s/NEW EVENT WM_LBUTTONUP 514/\n\n\n\n******************************* NEW EVENT COMBO ON WM_LBUTTONUP 514 ***********************************/g
#state Formats
s/STATE 1/WA_ACTIVE (1) - deactivate (lParam)/g
s/STATE 2/WA_CLICKACTIVE (2) - deactivate (lParam) /g
s/STATE 0/WA_INACTIVE (0) - activate (lParam)/g
#window styles
s/Extended Style 16/WS_EX_ACCEPTFILES 16/g
s/Extended Style 262144/WS_EX_APPWINDOW 262144/g
s/Extended Style 512/WS_EX_CLIENTEDGE 512/g
s/Extended Style 33554432/WS_EX_COMPOSITED 33554432/g
s/Extended Style 1024/WS_EX_CONTEXTHELP 1024/g
s/Extended Style 65536/WS_EX_CONTROLPARENT 65536/g
s/Extended Style 16384/WS_EX_LEFTSCROLLBAR 16384/g
s/Extended Style 134217728/WS_EX_NOACTIVATE 134217728/g
s/Extended Style 1048576/WS_EX_NOINHERITLAYOUT 1048576/g
s/Extended Style 4/WS_EX_NOPARENTNOTIFY 4/g
s/Extended Style 392/WS_EX_PALETTEWINDOW 392/g
s/Extended Style 768/WS_EX_OVERLAPPEDWINDOW 768/g
s/Extended Style 4096/WS_EX_RIGHT 4096/g
s/Extended Style 0/WS_EX_RIGHTSCROLLBAR 0/g
s/Extended Style 131072/WS_EX_STATICEDGE 131072/g
s/Extended Style 32/WS_EX_TRANSPARENT 32/g
s/Extended Style 256/WS_EX_WINDOWEDGE 256/g
s/Extended Style 128/WS_EX_TOOLWINDOW 128/g
# size flags
s/SIZE_FLAG is 4/SIZE_MAXHIDE (4)/g
s/SIZE_FLAG is 2/SIZE_MAXIMIZED (2)/g
s/SIZE_FLAG is 3/SIZE_MAXSHOW (3)/g
s/SIZE_FLAG is 1/SIZE_MINIMIZED (1)/g
s/SIZE_FLAG is 0/SIZE_RESTORED (0)/g
# Event Type
s/EventType 0/NSLeftMouseDown/g
s/EventType 1/NSLeftMouseUp/g
s/EventType 2/NSOtherMouseDown/g
s/EventType 3/NSOtherMouseUp/g
s/EventType 4/NSRightMouseDown/g
s/EventType 5/NSRightMouseUp/g
s/EventType 6/NSMouseMoved/g
s/EventType 7/NSLeftMouseDragged/g
s/EventType 8/NSOtherMouseDragged/g
s/EventType 9/NSRightMouseDragged/g
s/EventType 10/NSMouseEntered/g
s/EventType 11/NSMouseExited/g
s/EventType 12/NSKeyDown/g
s/EventType 13/NSKeyUp/g
s/EventType 14/NSFlagsChanged/g
s/EventType 15/NSAppKitDefined/g
s/EventType 16/NSSystemDefined/g
s/EventType 17/NSApplicationDefined/g
s/EventType 18/NSPeriodic/g
s/EventType 19/NSCursorUpdate/g
s/EventType 20/NSScrollWheel/g
#show window
s/SW_FLAG 4/SW_OTHERUNZOOM 4/g
s/SW_FLAG 2/SW_OTHERZOOM 2/g
s/SW_FLAG 1/SW_PARENTCLOSING 1/g
s/SW_FLAG 3/SW_PARENTOPENING 3/g
s/SW_FLAG 0/ZERO 0/g
#Gnustep state flags
s/MENU item state is 0/NSOffState 0/g
s/MENU item state is 1/NSOnState 1/g
s/MENU item state is -1/NSMixedState -1/g
#
#GS eventTypes
#
s/GSMouse_EVENT 0/NSLeftMouseDown 0/g
#s/GSMouse_EVENT 1/NSLeftMouseUp 1/g
s/GSMouse_EVENT 2/NSOtherMouseDown 2/g
s/GSMouse_EVENT 3/NSOtherMouseUp 3/g
s/GSMouse_EVENT 4/NSRightMouseDown 4/g
#s/GSMouse_EVENT 5/NSRightMouseUp 5/g
s/GSMouse_EVENT 6/NSMouseMoved 6/g
s/GSMouse_EVENT 7/NSLeftMouseDragged 7/g
s/GSMouse_EVENT 8/NSOtherMouseDragged 8/g
s/GSMouse_EVENT 9/NSRightMouseDragged 9/g
s/GSMouse_EVENT 10/NSMouseEntered 10/g
s/GSMouse_EVENT 11/NSMouseExited 11/g
s/GSKeyboard_EVENT 12/NSKeyDown 12/g
s/GSKeyboard_EVENT 13/NSKeyUp 13/g
s/GS_EVENT 14/NSFlagsChanged 14/g
s/GS_EVENT 15/NSAppKitDefined 15/g
s/GS_EVENT 16/NSSystemDefined 16/g
s/GS_EVENT 17/NSApplicationDefined 17/g
s/GS_EVENT 18/NSPeriodic 18/g
s/GS_EVENT 19/NSCursorUpdate 19/g
s/GS_EVENT 20/NSScrollWheel 20/g
#
#GS_SUBTYPES
#
s/GS_SUBTYPE 1/GSAppKitWindowMoved 1/g
s/GS_SUBTYPE 2/GSAppKitWindowResized 2/g
s/GS_SUBTYPE 3/GSAppKitWindowClose 3/g
s/GS_SUBTYPE 4/GSAppKitWindowMiniaturize 4/g
s/GS_SUBTYPE 5/GSAppKitWindowFocusIn 5/g
s/GS_SUBTYPE 6/GSAppKitWindowFocusOut 6/g
s/GS_SUBTYPE 7/GSAppKitWindowLeave 7/g
s/GS_SUBTYPE 8/GSAppKitWindowEnter 8/g
s/GS_SUBTYPE 9/GSAppKitDraggingEnter 9/g
s/GS_SUBTYPE 10/GSAppKitDraggingUpdate 10/g
s/GS_SUBTYPE 11/GSAppKitDraggingStatus 11/g
s/GS_SUBTYPE 12/GSAppKitDraggingExit 12/g
s/GS_SUBTYPE 13/GSAppKitDraggingDrop 13/g
s/GS_SUBTYPE 14/GSAppKitDraggingFinished 14/g
#finalize format
s/+//g
s/*//g
s/#//g
s/=//g
s/ / /g
s/NEW EVENT COMBO ON WM_LBUTTONUP 514/NEW CYCLE/g
s/NEW EVENT/NEW EVENT\n/g
s/\n\n/\n/g
# WIN32Server - Implements window handling for MSWindows
#
# Copyright (C) 2005 Free Software Foundation, Inc.
#
# Written by: Tom MacSween <macsweent@sympatico.ca>
# Date August 2005
# This file is part of the GNU Objective C User Interface Library.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# 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,
# 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.
#
#sed -f Event_format.sed result.sed >test_result.log
s/CYCLE 0 /WM_NULL 0/ g
s/CYCLE 1 /WM_CREATE 1/g
s/CYCLE 2 /WM_DESTROY 2/g
s/CYCLE 3 /WM_MOVE 3/g
s/CYCLE 5 /WM_SIZE 5/g
s/CYCLE 6 /WM_ACTIVATE 6/g
s/CYCLE 7 /WM_SETFOCUS 7/g
s/CYCLE 8 /WM_KILLFOCUS 8/g
s/CYCLE 10 /WM_ENABLE 10/g
s/CYCLE 11 /WM_SETREDRAW 11/g
s/CYCLE 12 /WM_SETTEXT 12/g
s/CYCLE 13 /WM_GETTEXT 13/g
s/CYCLE 14 /WM_GETTEXTLENGTH 14/g
s/CYCLE 15 /WM_PAINT 15/g
s/CYCLE 16 /WM_CLOSE 16/g
s/CYCLE 17 /WM_QUERYENDSESSION 17/g
s/CYCLE 18 /WM_QUIT 18/g
s/CYCLE 19 /WM_QUERYOPEN 19/g
s/CYCLE 20 /WM_ERASEBKGND 20/g
s/CYCLE 21 /WM_SYSCOLORCHANGE 21/g
s/CYCLE 22 /WM_ENDSESSION 22/g
s/CYCLE 24 /WM_SHOWWINDOW 24/g
s/CYCLE 26 /WM_SETTINGCHANGE 26/g
s/CYCLE 26 /WM_WININICHANGE 26/g
s/CYCLE 27 /WM_DEVMODECHANGE 27/g
s/CYCLE 28 /WM_ACTIVATEAPP 28/g
s/CYCLE 29 /WM_FONTCHANGE 29/g
s/CYCLE 30 /WM_TIMECHANGE 30/g
s/CYCLE 31 /WM_CANCELMODE 31/g
s/CYCLE 32 /WM_SETCURSOR 32/g
s/CYCLE 33 /WM_MOUSEACTIVATE 33/g
s/CYCLE 34 /WM_CHILDACTIVATE 34/g
s/CYCLE 35 /WM_QUEUESYNC 35/g
s/CYCLE 36 /WM_GETMINMAXINFO 36/g
s/CYCLE 38 /WM_PAINTICON 38/g
s/CYCLE 39 /WM_ICONERASEBKGND 39/g
s/CYCLE 40 /WM_NEXTDLGCTL 40/g
s/CYCLE 42 /WM_SPOOLERSTATUS 42/g
s/CYCLE 43 /WM_DRAWITEM 43/g
s/CYCLE 44 /WM_MEASUREITEM 44/g
s/CYCLE 45 /WM_DELETEITEM 45/g
s/CYCLE 46 /WM_VKEYTOITEM 46/g
s/CYCLE 47 /WM_CHARTOITEM 47/g
s/CYCLE 48 /WM_SETFONT 48/g
s/CYCLE 49 /WM_GETFONT 49/g
s/CYCLE 50 /WM_SETHOTKEY 50/g
s/CYCLE 51 /WM_GETHOTKEY 51/g
s/CYCLE 55 /WM_QUERYDRAGICON 55/g
s/CYCLE 57 /WM_COMPAREITEM 57/g
s/CYCLE 65 /WM_COMPACTING 65/g
s/CYCLE 68 /WM_COMMNOTIFY 68/g
s/CYCLE 70 /WM_WINDOWPOSCHANGING 70/g
s/CYCLE 71 /WM_WINDOWPOSCHANGED 71/g
s/CYCLE 72 /WM_POWER 72/g
s/CYCLE 74 /WM_COPYDATA 74/g
s/CYCLE 75 /WM_CANCELJOURNAL 75/g
s/CYCLE 78 /WM_NOTIFY 78/g
s/CYCLE 80 /WM_INPUTLANGCHANGEREQUEST 80/g
s/CYCLE 81 /WM_INPUTLANGCHANGE 81/g
s/CYCLE 82 /WM_TCARD 82/g
s/CYCLE 83 /WM_HELP 83/g
s/CYCLE 84 /WM_USERCHANGED 84/g
s/CYCLE 85 /WM_NOTIFYFORMAT 85/g
s/CYCLE 123 /WM_CONTEXTMENU 123/g
s/CYCLE 124 /WM_STYLECHANGING 124/g
s/CYCLE 125 /WM_STYLECHANGED 125/g
s/CYCLE 126 /WM_DISPLAYCHANGE 126/g
s/CYCLE 127 /WM_GETICON 127/g
s/CYCLE 128 /WM_SETICON 128/g
s/CYCLE 129 /WM_NCCREATE 129/g
s/CYCLE 130 /WM_NCDESTROY 130/g
s/CYCLE 131 /WM_NCCALCSIZE 131/g
s/CYCLE 132 /WM_NCHITTEST 132/g
s/CYCLE 133 /WM_NCPAINT 133/g
s/CYCLE 134 /WM_NCACTIVATE 134/g
s/CYCLE 135 /WM_GETDLGCODE 135/g
s/CYCLE 136 /WM_SYNCPAINT 136/g
s/CYCLE 160 /WM_NCMOUSEMOVE 160/g
s/CYCLE 161 /WM_NCLBUTTONDOWN 161/g
s/CYCLE 162 /WM_NCLBUTTONUP 162/g
s/CYCLE 163 /WM_NCLBUTTONDBLCLK 163/g
s/CYCLE 164 /WM_NCRBUTTONDOWN 164/g
s/CYCLE 165 /WM_NCRBUTTONUP 165/g
s/CYCLE 166 /WM_NCRBUTTONDBLCLK 166/g
s/CYCLE 167 /WM_NCMBUTTONDOWN 167/g
s/CYCLE 168 /WM_NCMBUTTONUP 168/g
s/CYCLE 169 /WM_NCMBUTTONDBLCLK 169/g
s/CYCLE 171 /WM_NCXBUTTONDOWN 171/g
s/CYCLE 172 /WM_NCXBUTTONUP 172/g
s/CYCLE 173 /WM_NCXBUTTONDBLCLK 173/g
s/CYCLE 256 /WM_KEYDOWN 256/g
s/CYCLE 256 /WM_KEYFIRST 256/g
s/CYCLE 257 /WM_KEYUP 257/g
s/CYCLE 258 /WM_CHAR 258/g
s/CYCLE 259 /WM_DEADCHAR 259/g
s/CYCLE 260 /WM_SYSKEYDOWN 260/g
s/CYCLE 261 /WM_SYSKEYUP 261/g
s/CYCLE 262 /WM_SYSCHAR 262/g
s/CYCLE 263 /WM_SYSDEADCHAR 263/g
s/CYCLE 264 /WM_KEYLAST 264/g
s/CYCLE 272 /WM_INITDIALOG 271/g
s/CYCLE 273 /WM_COMMAND 273/g
s/CYCLE 274 /WM_SYSCOMMAND 274/g
s/CYCLE 275 /WM_TIMER 275/g
s/CYCLE 276 /WM_HSCROLL 276/g
s/CYCLE 277 /WM_VSCROLL 277/g
s/CYCLE 278 /WM_INITMENU 278/g
s/CYCLE 279 /WM_INITMENUPOPUP 279/g
s/CYCLE 287 /WM_MENUSELECT 287/g
s/CYCLE 288 /WM_MENUCHAR 288/g
s/CYCLE 289 /WM_ENTERIDLE 289/g
s/CYCLE 290 /WM_MENURBUTTONUP 290/g
s/CYCLE 306 /WM_CTLCOLORMSGBOX 306/g
s/CYCLE 307 /WM_CTLCOLOREDIT 307/g
s/CYCLE 308 /WM_CTLCOLORLISTBOX 308/g
s/CYCLE 309 /WM_CTLCOLORBTN 309/g
s/CYCLE 310 /WM_CTLCOLORDLG 310/g
s/CYCLE 311 /WM_CTLCOLORSCROLLBAR 311/g
s/CYCLE 312 /WM_CTLCOLORSTATIC 312/g
s/CYCLE 512 /WM_MOUSEMOVE 512/g
s/CYCLE 512 /WM_MOUSEFIRST 512/g
s/CYCLE 513 /WM_LBUTTONDOWN 513/g
s/CYCLE 514 /WM_LBUTTONUP 514/g
s/CYCLE 515 /WM_LBUTTONDBLCLK 515/g
s/CYCLE 516 /WM_RBUTTONDOWN 516/g
s/CYCLE 517 /WM_RBUTTONUP 517/g
s/CYCLE 518 /WM_RBUTTONDBLCLK 518/g
s/CYCLE 519 /WM_MBUTTONDOWN 519/g
s/CYCLE 520 /WM_MBUTTONUP 520/g
s/CYCLE 521 /WM_MBUTTONDBLCLK 521/g
s/CYCLE 522 /WM_MOUSEWHEEL 522/g
s/CYCLE 522 /WM_MOUSELAST 522/g
s/CYCLE 523 /WM_XBUTTONDOWN 523/g
s/CYCLE 524 /WM_XBUTTONUP 524/g
s/CYCLE 525 /WM_XBUTTONDBLCLK 525/g
s/CYCLE 525 /WM_MOUSELAST 525/g
s/CYCLE 528 /WM_PARENTNOTIFY 528/g
s/CYCLE 529 /WM_ENTERMENULOOP 529/g
s/CYCLE 530 /WM_EXITMENULOOP 530/g
s/CYCLE 531 /WM_NEXTMENU 531/g
s/CYCLE 531 /WM_NEXTMENU 531/g
s/CYCLE 532 /WM_SIZING 532/g
s/CYCLE 533 /WM_CAPTURECHANGED 533/g
s/CYCLE 534 /WM_MOVING 534/g
s/CYCLE 536 /WM_POWERBROADCAST 536/g
s/CYCLE 537 /WM_DEVICECHANGE 537/g
s/CYCLE 544 /WM_MDICREATE 544/g
s/CYCLE 545 /WM_MDIDESTROY 545/g
s/CYCLE 546 /WM_MDIACTIVATE 546/g
s/CYCLE 547 /WM_MDIRESTORE 547/g
s/CYCLE 548 /WM_MDINEXT 548/g
s/CYCLE 549 /WM_MDIMAXIMIZE 549/g
s/CYCLE 550 /WM_MDITILE 550/g
s/CYCLE 551 /WM_MDICASCADE 551/g
s/CYCLE 552 /WM_MDIICONARRANGE 552/g
s/CYCLE 553 /WM_MDIGETACTIVE 553/g
s/CYCLE 560 /WM_MDISETMENU 560/g
s/CYCLE 561 /WM_ENTERSIZEMOVE 561/g
s/CYCLE 562 /WM_EXITSIZEMOVE 562/g
s/CYCLE 563 /WM_DROPFILES 563/g
s/CYCLE 564 /WM_MDIREFRESHMENU 564/g
s/CYCLE 768 /WM_CUT 768/g
s/CYCLE 769 /WM_COPY 769/g
s/CYCLE 770 /WM_PASTE 770/g
s/CYCLE 771 /WM_CLEAR 771/g
s/CYCLE 772 /WM_UNDO 772/g
s/CYCLE 773 /WM_RENDERFORMAT 773/g
s/CYCLE 774 /WM_RENDERALLFORMATS 774/g
s/CYCLE 775 /WM_DESTROYCLIPBOARD 775/g
s/CYCLE 776 /WM_DRAWCLIPBOARD 776/g
s/CYCLE 777 /WM_PAINTCLIPBOARD 777/g
s/CYCLE 778 /WM_VSCROLLCLIPBOARD 778/g
s/CYCLE 779 /WM_SIZECLIPBOARD 779/g
s/CYCLE 780 /WM_ASKCBFORMATNAME 780/g
s/CYCLE 781 /WM_CHANGECBCHAIN 781/g
s/CYCLE 782 /WM_HSCROLLCLIPBOARD 782/g
s/CYCLE 783 /WM_QUERYNEWPALETTE 783/g
s/CYCLE 784 /WM_PALETTEISCHANGING 784/g
s/CYCLE 785 /WM_PALETTECHANGED 785/g
s/CYCLE 786 /WM_HOTKEY 786/g
s/CYCLE 791 /WM_PRINT 791/g
s/CYCLE 792 /WM_PRINTCLIENT 792/g
s/CYCLE 794 /WM_THEMECHANGED 794/g
s/CYCLE 856 /WM_HANDHELDFIRST 856/g
s/CYCLE 863 /WM_HANDHELDLAST 863/g
s/CYCLE 864 /WM_AFXFIRST 864/g
s/CYCLE 895 /WM_AFXLAST 895/g
s/CYCLE 896 /WM_PENWINFIRST 896/g
s/CYCLE 911 /WM_PENWINLAST 911/g
s/CYCLE 1024 /WM_USER 1024/g
s/CYCLE 32768 /WM_APP 32768/g
s/CYCLE 0x0123 /WM_MENUDRAG 0x0123/g
s/CYCLE 0x0124 /WM_MENUGETOBJECT 0x0124/g
s/CYCLE 0x0125 /WM_UNINITMENUPOPUP 0x0125/g
s/CYCLE 0x0126 /WM_MENUCOMMAND 0x0126/g
s/CYCLE 0x02A0 /WM_NCMOUSEHOVER 0x02A0/g
s/CYCLE 0x02A2 /WM_NCMOUSELEAVE 0x02A2/g
s/CYCLE 0x2A1 /WM_MOUSEHOVER 0x2A1/g
s/CYCLE 0x2A3 /WM_MOUSELEAVE 0x2A3/g
s/NEW EVENT WM_LBUTTONUP 514/\n\n\n\n******************************* NEW EVENT COMBO ON WM_LBUTTONUP 514 ***********************************/g
#state Formats
s/STATE 1/WA_ACTIVE (1) - deactivate (lParam)/g
s/STATE 2/WA_CLICKACTIVE (2) - deactivate (lParam) /g
s/STATE 0/WA_INACTIVE (0) - activate (lParam)/g
#window styles
s/Extended Style 16/WS_EX_ACCEPTFILES 16/g
s/Extended Style 262144/WS_EX_APPWINDOW 262144/g
s/Extended Style 512/WS_EX_CLIENTEDGE 512/g
s/Extended Style 33554432/WS_EX_COMPOSITED 33554432/g
s/Extended Style 1024/WS_EX_CONTEXTHELP 1024/g
s/Extended Style 65536/WS_EX_CONTROLPARENT 65536/g
s/Extended Style 16384/WS_EX_LEFTSCROLLBAR 16384/g
s/Extended Style 134217728/WS_EX_NOACTIVATE 134217728/g
s/Extended Style 1048576/WS_EX_NOINHERITLAYOUT 1048576/g
s/Extended Style 4/WS_EX_NOPARENTNOTIFY 4/g
s/Extended Style 392/WS_EX_PALETTEWINDOW 392/g
s/Extended Style 768/WS_EX_OVERLAPPEDWINDOW 768/g
s/Extended Style 4096/WS_EX_RIGHT 4096/g
s/Extended Style 0/WS_EX_RIGHTSCROLLBAR 0/g
s/Extended Style 131072/WS_EX_STATICEDGE 131072/g
s/Extended Style 32/WS_EX_TRANSPARENT 32/g
s/Extended Style 256/WS_EX_WINDOWEDGE 256/g
s/Extended Style 128/WS_EX_TOOLWINDOW 128/g
# size flags
s/SIZE_FLAG is 4/SIZE_MAXHIDE (4)/g
s/SIZE_FLAG is 2/SIZE_MAXIMIZED (2)/g
s/SIZE_FLAG is 3/SIZE_MAXSHOW (3)/g
s/SIZE_FLAG is 1/SIZE_MINIMIZED (1)/g
s/SIZE_FLAG is 0/SIZE_RESTORED (0)/g
# Event Type
s/EventType 0/NSLeftMouseDown/g
s/EventType 1/NSLeftMouseUp/g
s/EventType 2/NSOtherMouseDown/g
s/EventType 3/NSOtherMouseUp/g
s/EventType 4/NSRightMouseDown/g
s/EventType 5/NSRightMouseUp/g
s/EventType 6/NSMouseMoved/g
s/EventType 7/NSLeftMouseDragged/g
s/EventType 8/NSOtherMouseDragged/g
s/EventType 9/NSRightMouseDragged/g
s/EventType 10/NSMouseEntered/g
s/EventType 11/NSMouseExited/g
s/EventType 12/NSKeyDown/g
s/EventType 13/NSKeyUp/g
s/EventType 14/NSFlagsChanged/g
s/EventType 15/NSAppKitDefined/g
s/EventType 16/NSSystemDefined/g
s/EventType 17/NSApplicationDefined/g
s/EventType 18/NSPeriodic/g
s/EventType 19/NSCursorUpdate/g
s/EventType 20/NSScrollWheel/g
#show window
s/SW_FLAG 4/SW_OTHERUNZOOM 4/g
s/SW_FLAG 2/SW_OTHERZOOM 2/g
s/SW_FLAG 1/SW_PARENTCLOSING 1/g
s/SW_FLAG 3/SW_PARENTOPENING 3/g
s/SW_FLAG 0/ZERO 0/g
#Gnustep state flags
s/MENU item state is 0/NSOffState 0/g
s/MENU item state is 1/NSOnState 1/g
s/MENU item state is -1/NSMixedState -1/g
#
#GS eventTypes
#
s/GSMouse_EVENT 0/NSLeftMouseDown 0/g
#s/GSMouse_EVENT 1/NSLeftMouseUp 1/g
s/GSMouse_EVENT 2/NSOtherMouseDown 2/g
s/GSMouse_EVENT 3/NSOtherMouseUp 3/g
s/GSMouse_EVENT 4/NSRightMouseDown 4/g
#s/GSMouse_EVENT 5/NSRightMouseUp 5/g
s/GSMouse_EVENT 6/NSMouseMoved 6/g
s/GSMouse_EVENT 7/NSLeftMouseDragged 7/g
s/GSMouse_EVENT 8/NSOtherMouseDragged 8/g
s/GSMouse_EVENT 9/NSRightMouseDragged 9/g
s/GSMouse_EVENT 10/NSMouseEntered 10/g
s/GSMouse_EVENT 11/NSMouseExited 11/g
s/GSKeyboard_EVENT 12/NSKeyDown 12/g
s/GSKeyboard_EVENT 13/NSKeyUp 13/g
s/GS_EVENT 14/NSFlagsChanged 14/g
s/GS_EVENT 15/NSAppKitDefined 15/g
s/GS_EVENT 16/NSSystemDefined 16/g
s/GS_EVENT 17/NSApplicationDefined 17/g
s/GS_EVENT 18/NSPeriodic 18/g
s/GS_EVENT 19/NSCursorUpdate 19/g
s/GS_EVENT 20/NSScrollWheel 20/g
#
#GS_SUBTYPES
#
s/GS_SUBTYPE 1/GSAppKitWindowMoved 1/g
s/GS_SUBTYPE 2/GSAppKitWindowResized 2/g
s/GS_SUBTYPE 3/GSAppKitWindowClose 3/g
s/GS_SUBTYPE 4/GSAppKitWindowMiniaturize 4/g
s/GS_SUBTYPE 5/GSAppKitWindowFocusIn 5/g
s/GS_SUBTYPE 6/GSAppKitWindowFocusOut 6/g
s/GS_SUBTYPE 7/GSAppKitWindowLeave 7/g
s/GS_SUBTYPE 8/GSAppKitWindowEnter 8/g
s/GS_SUBTYPE 9/GSAppKitDraggingEnter 9/g
s/GS_SUBTYPE 10/GSAppKitDraggingUpdate 10/g
s/GS_SUBTYPE 11/GSAppKitDraggingStatus 11/g
s/GS_SUBTYPE 12/GSAppKitDraggingExit 12/g
s/GS_SUBTYPE 13/GSAppKitDraggingDrop 13/g
s/GS_SUBTYPE 14/GSAppKitDraggingFinished 14/g
#
# syscommand params
#
s/SYSTEM MENU REQUESTED 0xF060/SC_CLOSE 0xF060/g
s/SYSTEM MENU REQUESTED 0xF180/SC_CONTEXTHELP 0xF180/g
s/SYSTEM MENU REQUESTED 0xF150/SC_HOTKEY 0xF150/g
s/SYSTEM MENU REQUESTED 0xF080/SC_HSCROLL 0xF080/g
s/SYSTEM MENU REQUESTED 0xF100/SC_KEYMENU 0xF100/g
s/SYSTEM MENU REQUESTED 0xF030/SC_MAXIMIZE 0xF030/g
s/SYSTEM MENU REQUESTED 0xF020/SC_MINIMIZE 0xF020/g
s/SYSTEM MENU REQUESTED 0xF170/SC_MONITORPOWER 0xF170/g
s/SYSTEM MENU REQUESTED 0xF090/SC_MOUSEMENU 0xF090/g
s/SYSTEM MENU REQUESTED 0xF010/SC_MOVE 0xF010/g
s/SYSTEM MENU REQUESTED 0xF040/SC_NEXTWINDOW 0xF040/g
s/SYSTEM MENU REQUESTED 0xF050/SC_PREVWINDOW 0xF050/g
s/SYSTEM MENU REQUESTED 0xF120/SC_RESTORE 0xF120/g
s/SYSTEM MENU REQUESTED 0xF140/SC_SCREENSAVE 0xF140/g
s/SYSTEM MENU REQUESTED 0xF000/SC_SIZE 0xF000/g
s/SYSTEM MENU REQUESTED 0xF130/SC_TASKLIST 0xF130/g
s/SYSTEM MENU REQUESTED 0xF070/SC_VSCROLL 0xF070/g
#finalize format
s/+//g
s/*//g
s/#//g
s/=//g
s/ / /g
s/NEW EVENT COMBO ON WM_LBUTTONUP 514/NEW CYCLE/g
s/NEW EVENT/NEW EVENT\n/g
s/<BLANK_LINE>/\n\n/g
s/\n\n/\n/g

View file

@ -45,6 +45,7 @@ win32_C_FILES = \
win32_OBJC_FILES = \
WIN32Server.m \
w32_debug.m \
w32_notifications.m \
w32_activate.m \
w32_create.m \
w32_general.m \

View file

@ -1,9 +1,61 @@
August 22, 2005
CYGWIN 1.5.17(0.129/4/2) or higher
CYGWIN CYGWIN_NT-5.1
CYGWIN 2005-05-25 19:38
September 29, 2005
Fixed in this release:
fixed a compile errors when the debug flags were activated
Removed Detailed Documentation that was mistakenly release in august
backend now reads and writes correctly to the defaults db
New Features:
Fully impliment window style mapping to allow for native win32 look.
The Main menu still looks like the standard GNUstep menu sence it is unique to
Gnustep. All other window look and act like win32 windows
GSUseWMTaskbar is now working correctly, and I have also added another defaults flag
called GSUseWMStyles which tells cygwin what style of windows it should use.
There is now a small configure panel which can be accessed in the app menu
under info -> server Preferneces. This will allow you to select win32 style windows,
Gnustep style window, or a combination of each if you like.
All of the notification related code has been moved to w32_notifications.m
inorder to keep it in one place for managability.
Future release:
complete context menu handling
More robust window registration under win32.
Parent - child window mapping down to the win32 level. This should give access
to more events and improve server to server communication, and hopfully
get a step closer to native evwent handling.
display of custom app icons on the taskbar.
Rect tracing when resizing windows
log file manager; this is allready in progress but not ready for release
integration with GSWorkspace
re impliment keyboard events so that cut copy past and other key equivilents work
PLEASE try it out and send FEEDBACK
Tom MacSween
macsweent@sympatico.ca
August 22, 2005
Project OverView:
I started this to simply fix the display of toolbars under cygwin...
Well I wound up doing a whole lot more:
@ -177,33 +229,5 @@ August 22, 2005
w32_windowdisplay.m
Future release:
complete context menu handling
Fully impliment window style mapping to allow for native win32 look.
More robust window registration under win32.
Parent - child window mapping down to the win32 level. This should give access
to more events and improve server to server communication, and hopfully
get a step closer to native evwent handling.
display of custom app icons on the taskbar.
Rect tracing when resizing windows
log file manager; this is allready in progress but not ready for release
integration with GSWorkspace
re impliment keyboard events so that cut copy past and other key equivilents work
Final closing remarks:
I think I have addressed most if not all of the major issues with the win32backend...
PLEASE try it out and send FEEDBACK
Tom MacSween
macsweent@sympatico.ca

View file

@ -42,6 +42,7 @@
#include <AppKit/NSEvent.h>
#include <AppKit/NSCursor.h>
#include <AppKit/NSText.h>
#include <AppKit/NSTextField.h>
#include <AppKit/DPSOperators.h>
#include "win32/WIN32Server.h"
@ -51,10 +52,11 @@
#ifdef __CYGWIN__
#include <sys/file.h>
#endif
static NSString * Version=@"(C) 2005 FSF gnustep-back 0.10.1";
// custom event notifications
static NSString *NSMenuWillTearOff = @"MenuWillTearOff";
static NSString *NSMenuwillPopUP =@"MenuwillPopUP";
static NSString *NSWindowDidCreateWindow=@"WindowDidCreateWindow";
static NSEvent *process_key_event(HWND hwnd, WPARAM wParam, LPARAM lParam,
NSEventType eventType);
@ -191,12 +193,12 @@ printf("\n\n##############################################################\n");
// Keep extra space for each window, for GS data
wc.cbWndExtra = sizeof(WIN_INTERN);
wc.hInstance = hinstance;
wc.hIcon = NULL;
wc.hIcon = NULL;//currentAppIcon;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = "GNUstepWindowClass";
wc.hIconSm = NULL;
wc.hIconSm = NULL;//currentAppIcon;
if (!RegisterClassEx(&wc))
return;
@ -261,7 +263,6 @@ printf("##initWithAttributes: (NSDictionary *)info #######\n");
printf("\n\n##############################################################\n");
#endif
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
[self _initWin32Context];
[super initWithAttributes: info];
@ -271,16 +272,37 @@ printf("\n\n##############################################################\n");
[self setupRunLoopInputSourcesForMode: NSModalPanelRunLoopMode];
[self setupRunLoopInputSourcesForMode: NSEventTrackingRunLoopMode];
flags.useWMTaskBar = YES;
if ([defs stringForKey: @"GSUseWMTaskbar"] != nil
&& [defs boolForKey: @"GSUseWMTaskbar"] == NO)
//flags.useWMTaskBar = YES;
//flags.useWMStyles = YES;
if ([[NSUserDefaults standardUserDefaults] stringForKey:@"GSUseWMTaskbar"] !=nil)
{
flags.useWMTaskBar = NO;
flags.useWMTaskBar = [[NSUserDefaults standardUserDefaults]
boolForKey:@"GSUseWMTaskbar"];
flags.HAVE_SERVER_PREFS=YES;
}
else
{
flags.HAVE_SERVER_PREFS=NO;
}
/* The backend needs to be able to keep tabs on events that are only
produced by GNUstep so that it can make changes or override
behavior in favor of the real platform window server */
if ([[NSUserDefaults standardUserDefaults] stringForKey:@"GSUseWMStyles"] !=nil)
{
flags.useWMStyles = [[NSUserDefaults standardUserDefaults]
boolForKey:@"GSUseWMStyles"];
flags.HAVE_SERVER_PREFS=YES;
}
else
{
flags.HAVE_SERVER_PREFS=NO;
}
if (flags.useWMStyles==YES)
handlesWindowDecorations = YES;
/* the backend needs to be able to keep tabs on events that are only produced by
GNUstep so that it can make changes or override behavior in favor of the real
platform window server */
[nc addObserver: self
selector: @selector(ApplicationDidFinishLaunching:)
name: NSApplicationDidFinishLaunchingNotification
@ -312,6 +334,10 @@ printf("\n\n##############################################################\n");
name: NSMenuwillPopUP
object: nil];
[nc addObserver: self
selector: @selector(WindowDidCreateWindow:)
name: NSWindowDidCreateWindow
object: nil];
#ifdef __APPNOTIFICATIONS__
[self registerForWindowEvents];
@ -354,25 +380,188 @@ printf("\n\n##############################################################\n");
[self subclassResponsibility: _cmd];
}
// make a configure window for the backend
/* win32 is unique in that it can support both the win32 look and feel or
a openstep look and feel.
To make it easier to switch between the 2 I have added a small server inspector
panel that will provide access to settings without recompile.
If main debug feature is on then I can also add access to some of the switches
to control debug output... or log specific event to a log panel.
*/
- (void) initConfigWindow
{
unsigned int style = NSTitledWindowMask
| NSClosableWindowMask;
NSRect rect;
NSView * content;
rect = NSMakeRect (715,800,236,182);
configWindow = RETAIN([[NSWindow alloc] initWithContentRect: rect
styleMask: style
backing: NSBackingStoreBuffered
defer: YES]);
[configWindow setTitle:@"server Preferences"];
[configWindow setReleasedWhenClosed:NO];
content = [configWindow contentView];
NSTextField *theText=[[NSTextField alloc] initWithFrame: NSMakeRect (27,155,190,22)];
[theText setStringValue:@"Win32 GNUStep Display Server"];
[theText setEditable:NO];
[theText setEnabled:NO];
[theText setSelectable:NO];
[[theText cell] setBackgroundColor:[NSColor lightGrayColor]];
[[theText cell] setBordered:NO];
[[theText cell] setBezeled:NO];
[content addSubview:theText];
/*NSTextField *theText1=[[NSTextField alloc] initWithFrame: NSMakeRect (27,135,190,22)];
[theText1 setStringValue:@"Revitalized By Tom MacSween"];
[theText1 setEditable:NO];
[theText1 setEnabled:NO];
[theText1 setSelectable:NO];
[[theText1 cell] setBackgroundColor:[NSColor lightGrayColor]];
[[theText1 cell] setBordered:NO];
[[theText1 cell] setBezeled:NO];
[content addSubview:theText1];*/
NSTextField *theText2=[[NSTextField alloc] initWithFrame: NSMakeRect (17,115,200,22)];
[theText2 setStringValue:Version];
[theText2 setEditable:NO];
[theText2 setEnabled:NO];
[theText2 setSelectable:NO];
[[theText2 cell] setBackgroundColor:[NSColor lightGrayColor]];
[[theText2 cell] setBordered:NO];
[[theText2 cell] setBezeled:NO];
[content addSubview:theText2];
// popup for style
styleButton = [[NSPopUpButton alloc] initWithFrame: NSMakeRect (30,80,171,22)];
[styleButton setAutoenablesItems:YES];
[styleButton setTarget:self];
[styleButton setAction: @selector(setStyle:)];
[styleButton setTitle: @"Select window Style"];
[styleButton addItemWithTitle:@"GNUStep window Style"];
[styleButton addItemWithTitle:@"MicroSoft window Style"];
[content addSubview:styleButton];
// set the tags on the items
[[styleButton itemAtIndex:0] setTag:0];
[[styleButton itemAtIndex:1] setTag:1];
[[styleButton itemAtIndex:2] setTag:2];
// check box for using taskbar
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 setButtonType: NSMomentaryPushInButton];
[saveButton setTitle: @"Save to defaults"];
[saveButton setTarget:self];
[saveButton setAction: @selector(setSave:)];
[content addSubview:saveButton];
[saveButton setEnabled:NO];
// set the buttons to match the current state
if(flags.useWMStyles==YES)
[styleButton selectItemAtIndex:2];
else
[styleButton selectItemAtIndex:1];
if(flags.useWMTaskBar==YES)
[taskbarButton setState:NSOnState];
else
[taskbarButton setState:NSOffState];
}
// config window actions
- (void) setStyle:(id)sender
{
//defaults key: GSUseWMStyles
// code flag: flags.useWMStyles
[saveButton setEnabled:YES];
if ([[sender selectedItem] tag] >1)
{
flags.useWMStyles=YES;
flags.useWMTaskBar=YES;
[taskbarButton setState:NSOnState];
}
else
{
flags.useWMStyles=NO;
flags.useWMTaskBar=NO;
[taskbarButton setState:NSOffState];
}
}
- (void) setTaskBar:(id)sender
{
//defaults key: GSUseWMTaskbar
// code flag: flags.useWMTaskBar
[saveButton setEnabled:YES];
flags.useWMTaskBar=[sender state];
}
- (void) setSave:(id)sender
{
NSString * theValue=@"NO";
//NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
//printf("Save to defaults\n");
if(flags.useWMTaskBar ==YES)
theValue=@"YES";
[[NSUserDefaults standardUserDefaults]
setObject:theValue forKey:@"GSUseWMTaskbar"];
theValue=@"NO";
if(flags.useWMStyles ==YES)
theValue=@"YES";
[[NSUserDefaults standardUserDefaults]
setObject:theValue forKey:@"GSUseWMStyles"];
// user must restart application for changes
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];
}
- (void) showServerPrefs:(id)sender
{
[configWindow makeKeyAndOrderFront:self];
}
/*
When debug is active (#define __W32_debug__) the following
additional notifications are registered for in the backend server.
Helps to show where appevents and server events are happening
relative to each other.
when debug is active (#define __W32_debug__) the following additional notifications
are registered for in the backend server. Helps to show where appevents and server
events are happening relitive to each other
NSWindowDidBecomeKeyNotification
Posted whenever an NSWindow becomes the key window.
The notification object is the NSWindow that has become key. This
notification does not contain a userInfo dictionary.
The notification object is the NSWindow that has become key. This notification
does not contain a userInfo dictionary.
NSWindowDidBecomeMainNotification
Posted whenever an NSWindow becomes the main window.
The notification object is the NSWindow that has become main. This
notification does not contain a userInfo dictionary.
The notification object is the NSWindow that has become main. This notification
does not contain a userInfo dictionary.
NSWindowDidChangeScreenNotification
Posted whenever a portion of an NSWindows frame moves onto or
off of a screen.
Posted whenever a portion of an NSWindows frame moves onto or off of a screen.
The notification object is the NSWindow that has changed screens. This
notification does not contain a userInfo dictionary.
This notification is not sent in Mac OS X versions earlier than 10.4.
@ -737,7 +926,7 @@ printf("\n\n##############################################################\n");
}
/* stubs for window server events note other stubs should be
declared for mous and keyboards
declared for mouse and keyboards
these should be implmented in a subclass or a catagory
*/
- (LRESULT) decodeWM_ACTIVEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
@ -746,17 +935,13 @@ printf("\n\n##############################################################\n");
return 0;
}
- (LRESULT) decodeWM_ACTIVEAPPParams: (HWND)hwnd : (WPARAM)wParam
: (LPARAM)lParam
- (LRESULT) decodeWM_ACTIVEAPPParams: (HWND)hwnd :(WPARAM)wParam : (LPARAM)lParam
{
[self subclassResponsibility: _cmd];
return 0;
}
- (void) decodeWM_NCACTIVATEParams: (WPARAM)wParam : (LPARAM)lParam
: (HWND)hwnd
- (void) decodeWM_NCACTIVATEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
[self subclassResponsibility: _cmd];
}
@ -768,6 +953,16 @@ printf("\n\n##############################################################\n");
return 0;
}
- (void) decodeWM_SIZINGParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam
{
[self subclassResponsibility: _cmd];
}
- (LRESULT) decodeWM_MOVINGParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam
{
[self subclassResponsibility: _cmd];
return 0;
}
- (LRESULT) decodeWM_MOVEParams: (HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam
{
@ -775,9 +970,7 @@ printf("\n\n##############################################################\n");
return 0;
}
- (void) decodeWM_NCCALCSIZEParams: (WPARAM)wParam : (LPARAM)lParam
: (HWND)hwnd
- (void) decodeWM_NCCALCSIZEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
[self subclassResponsibility: _cmd];
}
@ -815,6 +1008,12 @@ printf("\n\n##############################################################\n");
return 0;
}
- (DWORD) windowStyleForGSStyle: (unsigned int) style
{
[self subclassResponsibility: _cmd];
return 0;
}
- (void) decodeWM_SHOWWINDOWParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
@ -852,12 +1051,11 @@ printf("\n\n##############################################################\n");
[self subclassResponsibility: _cmd];
}
- (void) decodeWM_GETICONParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
[self subclassResponsibility: _cmd];
}
//- (HICON) decodeWM_GETICONParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
//{
//[self subclassResponsibility: _cmd];
//return nil;
//}
- (void) resizeBackingStoreFor: (HWND)hwnd
{
@ -921,8 +1119,13 @@ printf("\n\n##############################################################\n");
[self subclassResponsibility: _cmd];
}
- (void) decodeWM_COMMANDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
[self subclassResponsibility: _cmd];
- (BOOL) displayEvent: (unsigned int)uMsg; // diagnotic filter
}
- (BOOL) displayEvent:(uint)uMsg; // diagnotic filter
{
[self subclassResponsibility: _cmd];
return YES;
@ -1008,7 +1211,8 @@ printf("\n\n##############################################################\n");
switch (uMsg)
{
case WM_SIZING:
[self decodeWM_SIZINGParams:hwnd : wParam : lParam];
case WM_NCCREATE:
return [self decodeWM_NCCREATEParams: wParam : lParam : hwnd];
break;
@ -1019,11 +1223,12 @@ printf("\n\n##############################################################\n");
[self decodeWM_NCACTIVATEParams: wParam : lParam : hwnd];
break;
case WM_NCPAINT:
if (flags.useWMStyles==NO)
[self decodeWM_NCPAINTParams:wParam :lParam :hwnd];
break;
case WM_SHOWWINDOW:
[self decodeWM_SHOWWINDOWParams:wParam :lParam :hwnd];
break;
//case WM_SHOWWINDOW:
//[self decodeWM_SHOWWINDOWParams:wParam :lParam :hwnd];
//break;
case WM_NCDESTROY:
[self decodeWM_NCDESTROYParams:wParam :lParam :hwnd];
break;
@ -1050,6 +1255,7 @@ printf("\n\n##############################################################\n");
return [self decodeWM_MOVEParams:hwnd :wParam :lParam];
break;
case WM_MOVING:
return [self decodeWM_MOVINGParams:hwnd :wParam :lParam];
break;
case WM_SIZE:
return [self decodeWM_SIZEParams:hwnd :wParam :lParam];
@ -1062,7 +1268,7 @@ printf("\n\n##############################################################\n");
break;
case WM_ACTIVATE:
if ((int)lParam !=0)
[self decodeWM_ACTIVEParams:wParam :lParam : hwnd]; /************************/
[self decodeWM_ACTIVEParams:wParam :lParam : hwnd];
break;
case WM_ACTIVATEAPP:
//if (_is_cache == NO)
@ -1091,6 +1297,7 @@ printf("\n\n##############################################################\n");
case WM_PAINT:
[self decodeWM_PAINTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd];
case WM_SYNCPAINT:
if (flags.useWMStyles==NO)
[self decodeWM_SYNCPAINTParams:wParam :lParam :hwnd];
break;
case WM_CLOSE:
@ -1116,6 +1323,7 @@ printf("\n\n##############################################################\n");
case WM_ENTERIDLE:
break;
case WM_COMMAND:
[self decodeWM_COMMANDParams:wParam :lParam :hwnd];
break;
case WM_SYSKEYDOWN:
break;
@ -1126,10 +1334,13 @@ printf("\n\n##############################################################\n");
break;
case WM_HELP:
break;
case WM_GETICON:
[self decodeWM_GETICONParams:wParam :lParam :hwnd];
break;
case WM_CANCELMODE:
//case WM_GETICON:
//return [self decodeWM_GETICONParams:wParam :lParam :hwnd];
//break;
//case WM_SETICON:
//return [self decodeWM_SETICONParams: wParam : lParam : hwnd];
//break;
case WM_CANCELMODE: // new added by Tom MacSween
break;
case WM_ENABLE:
case WM_CHILDACTIVATE:
@ -1137,7 +1348,7 @@ printf("\n\n##############################################################\n");
case WM_NULL:
break;
/* resued from WIN32EventServer.m (now removed from this project). */
/* resued from WIN32EventServer.m (now removed from this project) */
case WM_NCHITTEST: //MOUSE
NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "NCHITTEST", hwnd);
break;
@ -1261,93 +1472,6 @@ printf("\n\n##############################################################\n");
@end
/* Styles are mapped between the two systems here note that this
* release does not utilize them but I have left them here for a
* future release.
*
* I have also removed the check for useWMTaskBar in this release.
* behavior is native win32 - at this point I do not have gworkspace
* running under cygwin so it is not relivant.
*
* I do not use the handlesWindowDecorations in my code but it is
* still set for use by the original code.
*
* I have not changed current inplimentation of mouse or keyboard
* events. */
static inline
DWORD windowStyleForGSStyle(unsigned int style)
{
/*
NSUtilityWindowMask 16
NSDocModalWindowMask 32
NSBorderlessWindowMask 0
NSTitledWindowMask 1
NSClosableWindowMask 2
NSMiniaturizableWindowMask 4
NSResizableWindowMask 8
NSIconWindowMask 64
NSMiniWindowMask 128
NSMenu(style) = NSTitledWindowMask | NSClosableWindowMask =3;
*/
DWORD wstyle = 0;
switch (style)
{
case NSTitledWindowMask: // 1
wstyle = WS_CAPTION;
break;
case NSClosableWindowMask: // 2
wstyle =WS_CAPTION+WS_SYSMENU;
break;
case NSMiniaturizableWindowMask: //4
wstyle =WS_MINIMIZEBOX+WS_SYSMENU;
break;
case NSResizableWindowMask: // 8
wstyle=WS_SIZEBOX;
case NSMiniWindowMask: //128
case NSIconWindowMask: // 64
wstyle = WS_ICONIC;
break;
//case NSUtilityWindowMask: //16
//case NSDocModalWindowMask: //32
break;
// combinations
case NSTitledWindowMask+NSClosableWindowMask: //3
wstyle =WS_CAPTION+WS_SYSMENU;
break;
case NSTitledWindowMask+NSClosableWindowMask+NSMiniaturizableWindowMask: //7
wstyle =WS_CAPTION+WS_MINIMIZEBOX+WS_SYSMENU;
break;
case NSTitledWindowMask+NSResizableWindowMask: // 9
wstyle = WS_CAPTION+WS_SIZEBOX;
break;
case NSTitledWindowMask+NSClosableWindowMask+NSResizableWindowMask: // 11
wstyle =WS_CAPTION+WS_SIZEBOX+WS_SYSMENU;
break;
case NSTitledWindowMask+NSClosableWindowMask+NSResizableWindowMask+
NSMiniaturizableWindowMask: //15
wstyle =WS_CAPTION+WS_SIZEBOX+WS_MINIMIZEBOX+WS_SYSMENU;
break;
default:
wstyle =WS_CAPTION;
break;
}
//NSLog(@"Window wstyle %d for style %d", wstyle, style);
#ifdef __debugServer__
printf("\n\n##############################################################\n");
printf("\n\n##############################################################\n");
printf("GS Window Style %u\n",style);
printf("Win32 Style picked %ld [hex] %X\n", wstyle, (unsigned int)wstyle);
printf("\n\n##############################################################\n");
printf("\n\n##############################################################\n");
#endif
return wstyle;
}
@implementation WIN32Server (WindowOps)
@ -1411,18 +1535,14 @@ DWORD windowStyleForGSStyle(unsigned int style)
flags.currentGS_Style=style;
if(style >=0)
wstyle = WS_POPUP;
else
{
wstyle = windowStyleForGSStyle(style);
printf("Window style for W32 is %u\n",(UINT)wstyle);
}
wstyle =[self windowStyleForGSStyle:style];
if ((style & NSMiniaturizableWindowMask) ==NSMiniaturizableWindowMask)//&& flags.useWMTaskBar == YES)
{
estyle = WS_EX_APPWINDOW;//0;
if(flags.useWMTaskBar==YES)
estyle = WS_EX_APPWINDOW;
else
estyle =WS_EX_TOOLWINDOW;
}
else
{
@ -1437,7 +1557,7 @@ DWORD windowStyleForGSStyle(unsigned int style)
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("Win32 Style picked %ld [hex] %X\n",wstyle,(uint)wstyle);
printf("\n##############################################################\n");
#endif
@ -1475,7 +1595,7 @@ DWORD windowStyleForGSStyle(unsigned int style)
- (void) stylewindow: (unsigned int)style : (int) winNum
{
DWORD wstyle = windowStyleForGSStyle(style);
DWORD wstyle = [self windowStyleForGSStyle:style];
NSAssert(handlesWindowDecorations,
@"-stylewindow:: called when handlesWindowDecorations==NO");
@ -1741,7 +1861,7 @@ DWORD windowStyleForGSStyle(unsigned int style)
{
if (handlesWindowDecorations)
{
DWORD wstyle = windowStyleForGSStyle(style);
DWORD wstyle = [self windowStyleForGSStyle:style];
RECT rect = {100, 100, 200, 200};
AdjustWindowRectEx(&rect, wstyle, NO, 0);

View file

@ -49,22 +49,24 @@
#include "win32/WIN32Geometry.h"
#include "w32_config.h"
@interface WIN32Server (w32_notifications)
@interface WIN32Server (w32_activate)
- (LRESULT) decodeWM_ACTIVEParams: (WPARAM)wParam :(LPARAM)lParam : (HWND)hwnd;
- (LRESULT) decodeWM_ACTIVEAPPParams: (HWND)hwnd :(WPARAM)wParam : (LPARAM)lParam;
- (void) decodeWM_NCACTIVATEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) ApplicationDidFinishLaunching: (NSNotification*)aNotification;
- (void) ApplicationWillFinishLaunching: (NSNotification*)aNotification;
- (void) ApplicationWillHideNotification: (NSNotification*)aNotification;
- (void) WindowWillMiniaturizeNotification:(NSNotification*)aNotification;
- (void) MenuWillTearOff: (NSNotification*)aNotification;
- (void) MenuwillPopUP: (NSNotification*)aNotification;
- (void) WindowDidCreateWindow: (NSNotification*)aNotification;
@end
@interface WIN32Server (w32_activate)
- (LRESULT) decodeWM_ACTIVEParams: (WPARAM)wParam :(LPARAM)lParam : (HWND)hwnd;
- (LRESULT) decodeWM_ACTIVEAPPParams: (HWND)hwnd :(WPARAM)wParam : (LPARAM)lParam;
- (void) decodeWM_NCACTIVATEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
@end
@interface WIN32Server (w32_movesize)
@ -75,25 +77,27 @@
- (void) decodeWM_WINDOWPOSCHANGEDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (LRESULT) decodeWM_GETMINMAXINFOParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (LRESULT) decodeWM_EXITSIZEMOVEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (LRESULT) decodeWM_SIZINGParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam;
- (void) decodeWM_SIZINGParams: (HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam;
- (LRESULT) decodeWM_MOVINGParams: (HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam;
@end
@interface WIN32Server (w32_create)
- (LRESULT) decodeWM_NCCREATEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (LRESULT) decodeWM_CREATEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) trackWindow:(NSNotification*)aNotification;
@end
@interface WIN32Server (w32_windowdisplay)
- (DWORD) windowStyleForGSStyle: (unsigned int) style;
- (void) decodeWM_SHOWWINDOWParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) decodeWM_NCPAINTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (LRESULT) decodeWM_ERASEBKGNDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) decodeWM_PAINTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) decodeWM_SYNCPAINTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) decodeWM_CAPTURECHANGEDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) decodeWM_GETICONParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (HICON) decodeWM_GETICONParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (HICON) decodeWM_SETICONParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) resizeBackingStoreFor: (HWND)hwnd;
@end
@ -115,7 +119,8 @@
- (void) decodeWM_NCDESTROYParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) decodeWM_QUERYOPENParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) decodeWM_SYSCOMMANDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) resetForGSWindowStyle: (HWND)hwnd gsStryle:(int)aStyle;
- (void) decodeWM_COMMANDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) resetForGSWindowStyle: (HWND)hwnd w32Style:(DWORD)aStyle;
//- (LRESULT) decodeWM_LBUTTONDOWNParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
@end
@ -123,7 +128,7 @@
@interface WIN32Server (w32_debug)
- (BOOL) displayEvent: (unsigned int)uMsg; // diagnotic filter
- (BOOL) displayEvent: (uint)uMsg; // diagnotic filter
- (void) test_Geomemetry: (HWND)hwnd;
- (void) print_result: (RECT)msrect and: (NSRect)gsrect and: (RECT)control;
- (NSMutableString *) w32_createDetails: (LPCREATESTRUCT)details;
@ -134,6 +139,7 @@
- (NSMutableString *) gswindowstate: (NSWindow *)theWindow;
- (NSMutableString *) MINMAXDetails: (MINMAXINFO *) mm;
- (NSMutableString *) subViewDetails: (NSWindow *)theWindow;
- (void) handleNotification: (NSNotification*)aNotification;
@end

View file

@ -27,109 +27,10 @@
#include <Foundation/NSData.h>
#include "w32_Events.h"
static NSString *NSMenuWillTearOff = @"MenuWillTearOff";
static NSString *NSMenuwillPopUP =@"MenuwillPopUP";
@interface NSMenu (w32Menu)
- (void) _rightMouseDisplay: (NSEvent*)theEvent;
- (void) setTornOff: (BOOL)flag;
@end
@implementation NSMenu (w32Menu)
// fixme to handle context menues better on win32
// although it works better then it used to, it still
// needs more work.
- (void) _rightMouseDisplay: (NSEvent*)theEvent
{
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
NSNotification * popped;
//printf("my menu tarnsient method\n");
// need to get hwnd for the window
[self displayTransient];
// post notification here
popped = [NSNotification
notificationWithName: NSMenuwillPopUP
object: _bWindow
userInfo: nil];
[nc postNotification: popped];
[_view mouseDown: theEvent];
[self closeTransient];
[_bWindow orderOut:self];
}
- (void) setTornOff: (BOOL)flag
{
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
NSNotification * torn;
NSMenu *supermenu;
_is_tornoff = flag;
if (flag)
{
supermenu = [self supermenu];
if (supermenu != nil)
{
[[supermenu menuRepresentation] setHighlightedItemIndex: -1];
supermenu->_attachedMenu = nil;
}
torn = [NSNotification
notificationWithName: NSMenuWillTearOff
object: self
userInfo: nil];
[nc postNotification: torn];
}
[_view update];
}
@end
@implementation WIN32Server (w32_activate)
/*
* wParam
* The low-order word specifies whether the window is being activated
* or deactivated.
* This parameter can be one of the following values.
* The high-order word specifies the minimized state of
* the window being activated or deactivated.
* A nonzero value indicates the window is minimized.
* WA_ACTIVE
* Activated by some method other than a mouse click
* (for example, by a call to the SetActiveWindow
* function or by use of the keyboard interface to select the window).
* WA_CLICKACTIVE
* Activated by a mouse click.
* WA_INACTIVE
* Deactivated.
* lParam
* Handle to the window being activated or deactivated, depending on
* the value of the wParam parameter. If the low-order word of wParam
* is WA_INACTIVE, lParam is the handle to the window being activated.
* If the low-order word of wParam is WA_ACTIVE or WA_CLICKACTIVE,
* lParam is the handle to the window being deactivated. This handle
* can be NULL.
*
* Return Value
* If an application processes this message, it should return zero.
*/
- (LRESULT) decodeWM_ACTIVEParams:(WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
// decode our params
flags._last_WM_ACTIVATE = LOWORD(wParam);
@ -170,7 +71,7 @@ static NSString *NSMenuwillPopUP =@"MenuwillPopUP";
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",_last_WM_ACTIVATE);
printf("ACTIVATE_FLAG STATE %d \n",flags._last_WM_ACTIVATE);
printf("[hwnd] %s",[[self gswindowstate:EVENT_WINDOW(hwnd)] cString]);
fflush(stdout);
@ -179,41 +80,8 @@ static NSString *NSMenuwillPopUP =@"MenuwillPopUP";
return 0;
}
/*
*
* The WM_ACTIVATEAPP message is sent when a window belonging to a
* different application than the active window is about to be
* activated. The message is sent to the application whose window is
* being activated and to the application whose window is being
* deactivated.
*
* A window receives this message through its WindowProc function.
*
* Syntax
*
* WM_ACTIVATEAPP
*
* WPARAM wParam
* LPARAM lParam;
* Parameters
*
* wParam
* Specifies whether the window is being activated or deactivated.
* This parameter is TRUE if the window is being activated; it is FALSE if
* the window is being deactivated.
* lParam
* Specifies a thread identifier (a DWORD). If the wParam parameter
* is TRUE, lParam is the identifier of the thread that owns the
* window being deactivated. If wParam is FALSE, lParam is the
* identifier of the thread that owns the window being activated.
*
* Return Value
* If an application processes this message, it should return zero. */
- (LRESULT) decodeWM_ACTIVEAPPParams: (HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam
{
BOOL active=[NSApp isActive];
switch ((int)wParam)
@ -268,12 +136,12 @@ static NSString *NSMenuwillPopUP =@"MenuwillPopUP";
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,
(uint)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",_eventHandled ? "YES" : "NO");
printf("eventHandled=[%s]\n",flags._eventHandled ? "YES" : "NO");
printf("REQUESTED STATE %d\n",flags._last_WM_ACTIVATE);
fflush(stdout);
@ -282,177 +150,11 @@ static NSString *NSMenuwillPopUP =@"MenuwillPopUP";
return 0;
}
/*
WM_NCACTIVATE Notification
The WM_NCACTIVATE message is sent to a window when its nonclient
area needs to be changed to indicate an active or inactive state. A
window receives this message through its WindowProc function.
Syntax
WM_NCACTIVATE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies when a title bar or icon needs to be changed to indicate
an active or inactive state. If an active title bar or icon is to
be drawn, the wParam parameter is TRUE. It is FALSE for an
inactive title bar or icon.
lParam
This parameter is not used.
Return Value
When the wParam parameter is FALSE, an application should return
TRUE to indicate that the system should proceed with the default
processing, or it should return FALSE to prevent the title bar or
icon from being deactivated. When wParam is TRUE, the return value
is ignored.
Remarks
The DefWindowProc function draws the title bar or icon title in its
active colors when the wParam parameter is TRUE and in its inactive
colors when wParam is FALSE.
*/
- (void) decodeWM_NCACTIVATEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
#ifdef __TESTEVENT__
printf("WM_NCACTIVATE\n");
#endif
}
/*
Notification hook from application
The default notification are:
NSApplicationDidFinishLaunchingNotification
NSApplicationWillFinishLaunchingNotification
NSApplicationWillHideNotification
NSWindowWillMiniaturizeNotification
Custom Notifications:
NSMenuWillTearOff
NSMenuwillPopUP
when these are received the Win32 server can now finalize its setup.
other hook can also be set at this point
syncronize the GS Env with The native Backend so we can use native
calls to manage certain things directly.
*/
- (void) ApplicationWillFinishLaunching: (NSNotification*)aNotification;
{
}
- (void) ApplicationDidFinishLaunching: (NSNotification*)aNotification
{
LONG result;
// Get our MainMenu window refference:
flags.menuRef=[[[NSApp mainMenu] window] windowNumber];
flags.HAVE_MAIN_MENU=YES;
/*
reset the style on the main menu panel so when it hides it will go
the the task bar I will use WS_EX_RIGHT for this. Note that this
is native code mixed with GNUStep */
ShowWindow((HWND)flags.menuRef,SW_HIDE);
SetLastError(0);
result=SetWindowLong((HWND)flags.menuRef,GWL_EXSTYLE,(LONG)WS_EX_RIGHT);
// should check error here...
ShowWindow((HWND)flags.menuRef,SW_SHOWNORMAL);
// set app icon image for win32
// future implimentation
#ifdef __WM_ACTIVE__
printf("reseting menu style\n");
if (result==0)
{
printf("setting mainMenu Style: Error %ld\n",GetLastError());
}
fflush(stdout);
#endif
}
- (void) ApplicationWillHideNotification: (NSNotification*)aNotification
{
flags.HOLD_MENU_FOR_MOVE=TRUE;
flags.HOLD_MENU_FOR_SIZE=TRUE;
ReleaseCapture(); // if the mouse is 'stuck' release it
#ifdef __WM_ACTIVE__
printf("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU\n");
printf("got Notification: %s\n",
[[aNotification name] cString]);
fflush(stdout);
#endif
}
-(void) WindowWillMiniaturizeNotification:(NSNotification*)aNotification
{
flags.HOLD_MINI_FOR_SIZE=TRUE;
flags.HOLD_MINI_FOR_MOVE=TRUE;
}
-(void) MenuWillTearOff:(NSNotification*)aNotification
{
LONG result;
NSMutableString * iconTitle =[NSMutableString stringWithString:@"MENU "];
NSMenu * theMenu=[aNotification object];
int windowNum =[[theMenu window] windowNumber];
ShowWindow((HWND)windowNum,SW_HIDE);
SetLastError(0);
result=SetWindowLong((HWND)windowNum,GWL_EXSTYLE,(LONG)WS_EX_RIGHT);
// should check error here...
// set the icon title
[iconTitle appendString: [theMenu title]];
result=SetWindowText((HWND)windowNum,[iconTitle cString]);
ShowWindow((HWND)windowNum,SW_SHOWNORMAL);
#ifdef __APPNOTIFICATIONS__
printf("got menu tear off Notification\n");
printf("menu title is: %s\n",[[theMenu title] cString]);
#endif
}
-(void) MenuwillPopUP:(NSNotification*)aNotification
{
LONG result;
int windowNum=[[aNotification object] windowNumber];
ShowWindow((HWND)windowNum,SW_HIDE);
SetLastError(0);
result=SetWindowLong((HWND)windowNum,GWL_EXSTYLE,(LONG)WS_EX_RIGHT);
// should check error here...
// set the icon title
result=SetWindowText((HWND)windowNum,"Context menu");
ShowWindow((HWND)windowNum,SW_SHOWNORMAL);
flags.HOLD_TRANSIENT_FOR_SIZE=TRUE;
flags.HOLD_TRANSIENT_FOR_MOVE=TRUE;
#ifdef __APPNOTIFICATIONS__
printf("got menu Popup Notification\n");
printf("window title is: %s\n",[[[aNotification object] title] cString]);
#endif
}
@end

View file

@ -2,7 +2,7 @@
Copyright (C) 2005 Free Software Foundation, Inc.
Written Tom MacSween <macsweent@sympatico.ca>
Written By: Tom MacSween <macsweent@sympatico.ca>
Date August 2005
This file is part of the GNU Objective C User Interface Library.
@ -52,8 +52,12 @@
#define __ERASEBKGND__
#define __GETMINMAXINFO__
#define __EXITSIZEMOVE__
#define __APPNOTIFICATIONS__
//#define __APPNOTIFICATIONS__
#define __SIZING__
#define __SYSCOMMAND__
#define __COMMAND__
#define __MOVING__
#define __ENTERSIZEMOVE__
#define __SETFOCUS_FLAG 1
#define __ACTIVE_FLAG 1
@ -69,6 +73,10 @@
#define __GETMINMAXINFO_FLAG 1
#define __EXITSIZEMOVE_FLAG 1
#define __SIZING_FLAG 1
#define __SYSCOMMAND_FLAG 1
#define __COMMAND_FLAG 1
#define __MOVING_FLAG 1
#define __ENTERSIZEMOVE_FLAG 1
#else
#define __ACTIVE_FLAG 0
#define __CREATE_FLAG 0
@ -84,6 +92,10 @@
#define __GETMINMAXINFO_FLAG 0
#define __EXITSIZEMOVE_FLAG 0
#define __SIZING_FLAG 0
#define __SYSCOMMAND_FLAG 0
#define __COMMAND_FLAG 0
#define __MOVING_FLAG 0
#define __ENTERSIZEMOVE_FLAG 0
#endif
#endif //_W32_CONFIG_h_INCLUDE

View file

@ -30,39 +30,6 @@
@implementation WIN32Server (w32_create)
/*
WM_NCCREATE Notification
The WM_NCCREATE message is sent prior to the WM_CREATE message when a window
is first created.
A window receives this message through its WindowProc function.
Syntax
WM_NCCREATE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
Pointer to the CREATESTRUCT structure that contains information about the
window being created. The members of CREATESTRUCT are identical to the
parameters of the CreateWindowEx function.
Return Value
If an application processes this message, it should return TRUE to
continue creation of the window. If the application returns FALSE,
the CreateWindow or CreateWindowEx function will return a NULL
handle.
*/
- (LRESULT) decodeWM_NCCREATEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
@ -78,174 +45,7 @@
return TRUE;
}
/*
WM_CREATE Notification
The WM_CREATE message is sent when an application requests that a
window be created by calling the CreateWindowEx or CreateWindow
function. (The message is sent before the function returns.) The
window procedure of the new window receives this message after the
window is created, but before the window becomes visible.
Syntax
WM_CREATE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
Pointer to a CREATESTRUCT structure that contains information
about the window being created.
typedef struct tagCREATESTRUCT {
LPVOID lpCreateParams;
HINSTANCE hInstance;
HMENU hMenu;
HWND hwndParent;
int cy;
int cx;
int y;
int x;
LONG style;
LPCTSTR lpszName;
LPCTSTR lpszClass;
DWORD dwExStyle;
} CREATESTRUCT, *LPCREATESTRUCT;
Return Value
If an application processes this message, it should return zero to
continue creation of the window. If the application returns 1, the
window is destroyed and the CreateWindowEx or CreateWindow function
returns a NULL handle.
dwExStyle [in] Specifies the extended window style of the window
being created. This parameter can be one or more of the following
values.
WS_EX_ACCEPTFILES
Specifies that a window created with this style accepts drag-drop files.
WS_EX_APPWINDOW
Forces a top-level window onto the taskbar when the window is visible.
WS_EX_CLIENTEDGE
Specifies that a window has a border with a sunken edge.
WS_EX_COMPOSITED
Windows XP: Paints all descendants of a window in bottom-to-top
painting order using double-buffering. For more information, see
Remarks. This cannot be used if the window has a class style of
either CS_OWNDC or CS_CLASSDC.
WS_EX_CONTEXTHELP
Includes a question mark in the title bar of the window. When the
user clicks the question mark, the cursor changes to a question mark
with a pointer. If the user then clicks a child window, the child
receives a WM_HELP message. The child window should pass the message
to the parent window procedure, which should call the WinHelp
function using the HELP_WM_HELP command. The Help application
displays a pop-up window that typically contains help for the child
window. WS_EX_CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or
WS_MINIMIZEBOX styles.
WS_EX_CONTROLPARENT
The window itself contains child windows that should take part in
dialog box navigation. If this style is specified, the dialog
manager recurses into children of this window when performing
navigation operations such as handling the TAB key, an arrow key, or
a keyboard mnemonic. WS_EX_DLGMODALFRAME Creates a window that has a
double border; the window can, optionally, be created with a title
bar by specifying the WS_CAPTION style in the dwStyle
parameter. WS_EX_LAYERED Windows 2000/XP: Creates a layered
window. Note that this cannot be used for child windows. Also, this
cannot be used if the window has a class style of either CS_OWNDC or
CS_CLASSDC. WS_EX_LAYOUTRTL Arabic and Hebrew versions of Windows
98/Me, Windows 2000/XP: Creates a window whose horizontal origin is
on the right edge. Increasing horizontal values advance to the
left. WS_EX_LEFT Creates a window that has generic left-aligned
properties. This is the default.
WS_EX_LEFTSCROLLBAR
If the shell language is Hebrew, Arabic, or another language that
supports reading order alignment, the vertical scroll bar (if
present) is to the left of the client area. For other languages, the
style is ignored. WS_EX_LTRREADING The window text is displayed
using left-to-right reading-order properties. This is the
default. WS_EX_MDICHILD Creates a multiple-document interface (MDI)
child window.
WS_EX_NOACTIVATE
Windows 2000/XP: A top-level window created with this style does not
become the foreground window when the user clicks it. The system
does not bring this window to the foreground when the user minimizes
or closes the foreground window. To activate the window, use the
SetActiveWindow or SetForegroundWindow function. The window does
not appear on the taskbar by default. To force the window to appear
on the taskbar, use the WS_EX_APPWINDOW style.
WS_EX_NOINHERITLAYOUT
Windows 2000/XP: A window created with this style does not pass its window
layout to its child windows.
WS_EX_NOPARENTNOTIFY
Specifies that a child window created with this style does not send
the WM_PARENTNOTIFY message to its parent window when it is created
or destroyed.
WS_EX_OVERLAPPEDWINDOW
Combines the WS_EX_CLIENTEDGE and WS_EX_WINDOWEDGE styles.
WS_EX_PALETTEWINDOW
Combines the WS_EX_WINDOWEDGE, WS_EX_TOOLWINDOW, and WS_EX_TOPMOST styles.
WS_EX_RIGHT
The window has generic "right-aligned" properties. This depends on
the window class. This style has an effect only if the shell
language is Hebrew, Arabic, or another language that supports
reading-order alignment; otherwise, the style is ignored. Using the
WS_EX_RIGHT style for static or edit controls has the same effect as
using the SS_RIGHT or ES_RIGHT style, respectively. Using this style
with button controls has the same effect as using BS_RIGHT and
BS_RIGHTBUTTON styles.
WS_EX_RIGHTSCROLLBAR
Vertical scroll bar (if present) is to the right of the client area. This is
the default. WS_EX_RTLREADING
If the shell language is Hebrew, Arabic, or another language that supports
reading-order alignment, the window text is displayed using right-to-left
reading-order properties. For other languages, the style is ignored.
WS_EX_STATICEDGE
Creates a window with a three-dimensional border style intended to
be used for items that do not accept user input. WS_EX_TOOLWINDOW
Creates a tool window; that is, a window intended to be used as a
floating toolbar. A tool window has a title bar that is shorter than
a normal title bar, and the window title is drawn using a smaller
font. A tool window does not appear in the taskbar or in the dialog
that appears when the user presses ALT+TAB. If a tool window has a
system menu, its icon is not displayed on the title bar. However,
you can display the system menu by right-clicking or by typing
ALT+SPACE. WS_EX_TOPMOST Specifies that a window created with this
style should be placed above all non- topmost windows and should
stay above them, even when the window is deactivated. To add or
remove this style, use the SetWindowPos function.
WS_EX_TRANSPARENT
Specifies that a window created with this style should not be
painted until siblings beneath the window (that were created by the
same thread) have been painted. The window appears transparent
because the bits of underlying sibling windows have already been
painted. To achieve transparency without these restrictions, use
the SetWindowRgn function.
WS_EX_WINDOWEDGE
Specifies that a window has a border with a raised edge.
*/
- (LRESULT) decodeWM_CREATEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
//Created by original author
@ -302,16 +102,4 @@ WS_EX_WINDOWEDGE
return 0;
}
- (void) trackWindow:(NSNotification*)aNotification
{
// stubbed for future development
// later when I have a Clss/ stye system in place, I can get the
// window server
//to Post a notification when a window is fully inited.... or I could use a catagorey extention
//to NSwindow, to make it post my notification.
}
@end

View file

@ -65,10 +65,9 @@ static NSString * spacer =@"<BLANK_LINE>\n";
printf(" top %ld",msrect.top);
printf(" right %ld",msrect.right);
printf(" Bottom %ld\n",msrect.bottom);
}
- (BOOL) displayEvent: (unsigned int)uMsg
- (BOOL) displayEvent:(uint)uMsg
{
#ifdef __W32_debug__ //_logging
@ -107,10 +106,10 @@ static NSString * spacer =@"<BLANK_LINE>\n";
case WM_WINDOWPOSCHANGING: return __STATE; break;
case WM_WINDOWPOSCHANGED: return __STATE; break;
case WM_MOVE: return __MOVE_FLAG; break;
case WM_MOVING: return __STATE; break;
case WM_MOVING: return __MOVING_FLAG; break;
case WM_SIZE: return __SIZE_FLAG; break;
case WM_SIZING: return __SIZING_FLAG; break;
case WM_ENTERSIZEMOVE: return __STATE; break;
case WM_ENTERSIZEMOVE: return __ENTERSIZEMOVE_FLAG; break;
case WM_EXITSIZEMOVE: return __EXITSIZEMOVE_FLAG; break;
case WM_ACTIVATE: return __ACTIVE_FLAG; break;
case WM_ACTIVATEAPP: return __ACTIVE_FLAG; break;
@ -132,10 +131,10 @@ static NSString * spacer =@"<BLANK_LINE>\n";
case WM_INITMENU: return __STATE; break;
case WM_MENUSELECT: return __STATE; break;
case WM_ENTERIDLE: return __STATE; break;
case WM_COMMAND: return __STATE; break;
case WM_COMMAND: return __COMMAND_FLAG; break;
case WM_SYSKEYDOWN: return __STATE; break;
case WM_SYSKEYUP: return __STATE; break;
case WM_SYSCOMMAND: return __STATE; break;
case WM_SYSCOMMAND: return __SYSCOMMAND_FLAG; break;
case WM_HELP: return __STATE; break;
case WM_GETICON: return __STATE; break;
case WM_CANCELMODE: return __STATE; break;
@ -292,44 +291,6 @@ typedef struct tagCREATESTRUCT {
return output;
}
/*
The MINMAXINFO structure contains information about a window's maximized
size and position and its minimum and maximum tracking size.
Syntax
typedef struct {
POINT ptReserved;
POINT ptMaxSize;
POINT ptMaxPosition;
POINT ptMinTrackSize;
POINT ptMaxTrackSize;
} MINMAXINFO;
Members
ptReserved
Reserved; do not use.
ptMaxSize
Specifies the maximized width (POINT. x) and the maximized height
(POINT. y) of the window. For systems with multiple monitors, this
refers to the primary monitor. ptMaxPosition Specifies the
position of the left side of the maximized window (POINT. x) and
the position of the top of the maximized window (POINT. y). For
systems with multiple monitors, this refers to the monitor on
which the window maximizes.
ptMinTrackSize
Specifies the minimum tracking width (POINT. x) and the minimum
tracking height (POINT. y) of the window. This is unchanged for
systems with multiple monitors.
ptMaxTrackSize
Specifies the maximum tracking width (POINT. x) and the maximum
tracking height (POINT. y) of the window. For systems with
multiple monitors, this is the size for a window that is made as
large as the virtual screen.
*/
- (NSMutableString *) MINMAXDetails:(MINMAXINFO *) mm
{
NSMutableString * output =[NSMutableString stringWithString:spacer];
@ -378,4 +339,18 @@ typedef struct tagCREATESTRUCT {
return output;
}
- (void) handleNotification:(NSNotification*)aNotification
{
#ifdef __APPNOTIFICATIONS__
printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
printf("+++ NEW EVENT +++\n");
printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
printf("WM_APPNOTIFICATION -1\n %s\nPosted by current application\n",
[[aNotification name] cString]);
NSWindow *theWindow=[aNotification object];
printf("%s",[[self gswindowstate:theWindow] cString]);
#endif
}
@end

View file

@ -28,42 +28,7 @@
#include "w32_Events.h"
@implementation WIN32Server (w32_General)
/*
WM_CLOSE Notification
The WM_CLOSE message is sent as a signal that a window or an
application should terminate.
A window receives this message through its WindowProc function.
Syntax
WM_CLOSE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
This parameter is not used.
Return Value
If an application processes this message, it should return zero.
Remarks
An application can prompt the user for confirmation, prior to
destroying a window, by processing the WM_CLOSE message and calling
the DestroyWindow function only if the user confirms the choice.
By default, the DefWindowProc function calls the DestroyWindow
function to destroy the window.
*/
- (void) decodeWM_CLOSEParams:(WPARAM)wParam :(LPARAM)lParam :(HWND)hwnd;
{
NSEvent * ev;
@ -93,42 +58,6 @@
#endif
}
/*
WM_NCDESTROY Notification
The WM_NCDESTROY message informs a window that its nonclient area is
being destroyed. The DestroyWindow function sends the WM_NCDESTROY
message to the window following the WM_DESTROY message. WM_DESTROY
is used to free the allocated memory object associated with the
window.
The WM_NCDESTROY message is sent after the child windows have been
destroyed. In contrast, WM_DESTROY is sent before the child windows
are destroyed. A window receives this message through its
WindowProc function.
Syntax
WM_NCDESTROY
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
This parameter is not used.
Return Value
If an application processes this message, it should return zero.
Remarks
This message frees any memory internally allocated for the window.
*/
- (void) decodeWM_NCDESTROYParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
#ifdef __TESTEVENT__
@ -136,42 +65,6 @@ printf("WM_NCDESTROY\n");
#endif
}
/*
WM_DESTROY Notification
The WM_DESTROY message is sent when a window is being destroyed. It
is sent to the window procedure of the window being destroyed after
the window is removed from the screen. This message is sent first
to the window being destroyed and then to the child windows (if any)
as they are destroyed. During the processing of the message, it can
be assumed that all child windows still exist. A window receives
this message through its WindowProc function.
Syntax
WM_DESTROY
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
This parameter is not used.
Return Value
If an application processes this message, it should return zero.
Remarks
If the window being destroyed is part of the clipboard viewer chain
(set by calling the SetClipboardViewer function), the window must
remove itself from the chain by processing the ChangeClipboardChain
function before returning from the WM_DESTROY message.
*/
- (void) decodeWM_DESTROYParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
WIN_INTERN *win = (WIN_INTERN *)GetWindowLong(hwnd, GWL_USERDATA);
@ -193,47 +86,8 @@ WM_DESTROY Notification
printf("%s",[[self WindowDetail:EVENT_WINDOW(hwnd)] cString]);
fflush(stdout);
#endif
}
/*
WM_QUERYOPEN Notification
The WM_QUERYOPEN message is sent to an icon when the user requests
that the window be restored to its previous size and position. A
window receives this message through its WindowProc function.
Syntax
WM_QUERYOPEN
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
This parameter is not used.
Return Value
If the icon can be opened, an application that processes this
message should return TRUE; otherwise, it should return FALSE to
prevent the icon from being opened.
Remarks
By default, the DefWindowProc function returns TRUE.
While processing this message, the application should not perform
any action that would cause an activation or focus change (for
example, creating a dialog box).
*/
- (void) decodeWM_QUERYOPENParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
#ifdef __TESTEVENT__
@ -241,149 +95,72 @@ WM_DESTROY Notification
#endif
}
/*
WM_SYSCOMMAND Notification
A window receives this message when the user chooses a command from
the Window menu (formerly known as the system or control menu) or
when the user chooses the maximize button, minimize button, restore
button, or close button.
Syntax
WM_SYSCOMMAND
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the type of system command requested. This parameter can
be one of the following values. SC_CLOSE Closes the window.
SC_CONTEXTHELP
Changes the cursor to a question mark with a pointer. If the user
then clicks a control in the dialog box, the control receives a
WM_HELP message. SC_DEFAULT Selects the default item; the user
double-clicked the window menu.
SC_HOTKEY
Activates the window associated with the application-specified hot
key. The lParam parameter identifies the window to
activate. SC_HSCROLL Scrolls horizontally.
SC_KEYMENU
Retrieves the window menu as a result of a keystroke. For more
information, see the Remarks section. SC_MAXIMIZE Maximizes the
window.
SC_MINIMIZE
Minimizes the window.
SC_MONITORPOWER
Sets the state of the display. This command supports devices that
have power- saving features, such as a battery-powered personal
computer. The lParam parameter can have the following values:
1 - the display is going to low power
2 - the display is being shut off
SC_MOUSEMENU
Retrieves the window menu as a result of a mouse click.
SC_MOVE
Moves the window.
SC_NEXTWINDOW
Moves to the next window.
SC_PREVWINDOW
Moves to the previous window.
SC_RESTORE
Restores the window to its normal position and size.
SC_SCREENSAVE
Executes the screen saver application specified in the [boot]
section of the System.ini file. SC_SIZE Sizes the window.
SC_TASKLIST
Activates the Start menu.
SC_VSCROLL
Scrolls vertically.
lParam
The low-order word specifies the horizontal position of the cursor,
in screen coordinates, if a window menu command is chosen with the
mouse. Otherwise, this parameter is not used. The high-order word
specifies the vertical position of the cursor, in screen
coordinates, if a window menu command is chosen with the mouse. This
parameter is 1 if the command is chosen using a system accelerator,
or zero if using a mnemonic.
Return Value
An application should return zero if it processes this message.
Remarks
To obtain the position coordinates in screen coordinates, use the following
code:
xPos = GET_X_LPARAM(lParam); // horizontal position
yPos = GET_Y_LPARAM(lParam); // vertical position
The DefWindowProc function carries out the window menu request for
the predefined actions specified in the previous table. In
WM_SYSCOMMAND messages, the four low-order bits of the wParam
parameter are used internally by the system. To obtain the correct
result when testing the value of wParam, an application must combine
the value 0xFFF0 with the wParam value by using the bitwise AND
operator. The menu items in a window menu can be modified by using
the GetSystemMenu, AppendMenu, InsertMenu, ModifyMenu,
InsertMenuItem, and SetMenuItemInfo functions. Applications that
modify the window menu must process WM_SYSCOMMAND messages. An
application can carry out any system command at any time by passing
a WM_SYSCOMMAND message to DefWindowProc. Any WM_SYSCOMMAND messages
not handled by the application must be passed to DefWindowProc. Any
command values added by an application must be processed by the
application and cannot be passed to DefWindowProc. Accelerator keys
that are defined to choose items from the window menu are translated
into WM_SYSCOMMAND messages; all other accelerator keystrokes are
translated into WM_COMMAND messages. If the wParam is SC_KEYMENU,
lParam contains the character code of the key that is used with the
ALT key to display the popup menu. For example, pressing ALT+F to
display the File popup will cause a WM_SYSCOMMAND with wParam equal
to SC_KEYMENU and lParam equal to 'f'.
*/
- (void) decodeWM_SYSCOMMANDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
// stubbed for future development
#ifdef __TESTEVENT__
printf("WM_SYSCOMMAND\n");
switch (wParam)
{
case SC_CLOSE:
break;
case SC_CONTEXTHELP:
break;
case SC_HOTKEY:
break;
case SC_HSCROLL:
break;
case SC_KEYMENU:
break;
case SC_MAXIMIZE:
break;
case SC_MINIMIZE:
flags.HOLD_MINI_FOR_SIZE=TRUE;
flags.HOLD_MINI_FOR_MOVE=TRUE;
break;
case SC_MONITORPOWER:
break;
case SC_MOUSEMENU:
break;
case SC_MOVE:
break;
case SC_NEXTWINDOW:
break;
case SC_PREVWINDOW:
break;
case SC_RESTORE:
break;
case SC_SCREENSAVE:
break;
case SC_SIZE:
break;
case SC_TASKLIST:
break;
case SC_VSCROLL:
break;
default:
break;
}
#ifdef __SYSCOMMAND__
printf("SYSTEM MENU REQUESTED 0x%X\n",wParam);
//printf("%s",[[self WindowDetail:EVENT_WINDOW(hwnd)] cString]);
#endif
}
// should be moved to the debug catagory
- (void) handleNotification:(NSNotification*)aNotification
- (void) decodeWM_COMMANDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
#ifdef __APPNOTIFICATIONS__
printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
printf("+++ NEW EVENT +++\n");
printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
printf("WM_APPNOTIFICATION -1\n %s\nPosted by current application\n",
[[aNotification name] cString]);
NSWindow *theWindow=[aNotification object];
printf("%s",[[self gswindowstate:theWindow] cString]);
#endif
printf("WM_COMMAND\n");
}
- (void) resetForGSWindowStyle:(HWND)hwnd gsStryle:(int)aStyle
- (void) resetForGSWindowStyle:(HWND)hwnd w32Style:(DWORD)aStyle
{
// to be completed for styles
LONG result;
ShowWindow(hwnd,SW_HIDE);
SetLastError(0);
result=SetWindowLong(hwnd,GWL_EXSTYLE,(LONG)WS_EX_RIGHT);
result=SetWindowLong(hwnd,GWL_EXSTYLE,WS_EX_APPWINDOW);
result=SetWindowLong(hwnd,GWL_STYLE,(LONG)aStyle);
// should check error here...
ShowWindow(hwnd,SW_SHOWNORMAL);
}

View file

@ -25,49 +25,8 @@
@implementation WIN32Server (w32_movesize)
/*
* The WM_MOVE message is sent after a window has been moved.
* A window receives this message through its WindowProc function.
*
* Syntax
*
* WM_MOVE
*
* WPARAM wParam
* LPARAM lParam;
*
* Parameters
*
* wParam
* This parameter is not used.
* lParam
* Specifies the x and y coordinates of the upper-left corner of the
* client area of the window. The low-order word contains the x-coordinate
* while the high-order word contains the y coordinate.
*
* Return Value
*
* If an application processes this message, it should return zero.
*
* Remarks
*
* The parameters are given in screen coordinates for overlapped and pop-up
* windows and in parent-client coordinates for child windows.
*
* The following example demonstrates how to obtain the position from
* the lParam parameter.
*
* xPos = (int)(short) LOWORD(lParam); // horizontal position
* yPos = (int)(short) HIWORD(lParam); // vertical position
*
* You can also use the MAKEPOINTS macro to convert the lParam parameter
* to a POINTS structure.
*
*/
- (LRESULT) decodeWM_MOVEParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam
{
NSPoint eventLocation;
NSRect rect;
RECT r;
@ -123,55 +82,6 @@
return 0;
}
/*
* WM_SIZE Notification
* The WM_SIZE message is sent to a window after its size has changed.
*
* A window receives this message through its WindowProc function.
*
* Syntax
*
* WM_SIZE
*
* WPARAM wParam
* LPARAM lParam;
*
* Parameters
*
* wParam
* Specifies the type of resizing requested. This parameter can be one
* of the following values.
* SIZE_MAXHIDE 4
* Message is sent to all pop-up windows when some other
* window is maximized.
* SIZE_MAXIMIZED 2
* The window has been maximized.
* SIZE_MAXSHOW 3
* Message is sent to all pop-up windows when some other window has been
* restored to its former size.
* SIZE_MINIMIZED 1
* The window has been minimized.
* SIZE_RESTORED 0
* The window has been resized, but neither the SIZE_MINIMIZED nor
* SIZE_MAXIMIZED value applies.
* lParam
* The low-order word of lParam specifies the new width of the client area.
* The high-order word of lParam specifies the new height of the client area.
*
* Return Value
*
* If an application processes this message, it should return zero.
*
* Remarks
*
* If the SetScrollPos or MoveWindow function is called for a child window as a
* result of the WM_SIZE message, the bRedraw or bRepaint parameter should be
* nonzero to cause the window to be repainted.
*
* Although the width and height of a window are 32-bit values,
* the lParam parameter contains only the low-order 16 bits of each.
*
*/
- (LRESULT) decodeWM_SIZEParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam
{
NSPoint eventLocation;
@ -231,8 +141,11 @@
{
if(flags.HOLD_MENU_FOR_SIZE==FALSE)
{
[[NSApp mainMenu] setMenuChangedMessagesEnabled:YES];
[EVENT_WINDOW(hwnd) sendEvent:ev];
[self resizeBackingStoreFor:hwnd];
[EVENT_WINDOW(hwnd) miniaturize:self];
[[NSApp mainMenu] setMenuChangedMessagesEnabled:NO];
}
}
else
@ -241,6 +154,7 @@
{
[EVENT_WINDOW(hwnd) sendEvent:ev];
[self resizeBackingStoreFor:hwnd];
if (flags.useWMTaskBar==YES)
[EVENT_WINDOW(hwnd) miniaturize:self];
}
}
@ -264,8 +178,11 @@
{
if(flags.HOLD_MENU_FOR_SIZE==FALSE)
{
[EVENT_WINDOW(hwnd) _setVisible:YES];
[EVENT_WINDOW(hwnd) sendEvent:ev];
[self resizeBackingStoreFor:hwnd];
//[EVENT_WINDOW(hwnd) deminiaturize:self];
}
}
else
@ -275,6 +192,7 @@
[EVENT_WINDOW(hwnd) sendEvent:ev];
[self resizeBackingStoreFor:hwnd];
// fixes part one of bug [5,25] see notes
if (flags.useWMTaskBar==YES)
[EVENT_WINDOW(hwnd) deminiaturize:self];
}
}
@ -304,155 +222,63 @@
return 0;
}
/*
WM_NCCALCSIZE Notification
The WM_NCCALCSIZE message is sent when the size and position of a
window's client area must be calculated. By processing this message,
an application can control the content of the window's client area
when the size or position of the window changes.
A window receives this message through its WindowProc function.
Syntax
WM_NCCALCSIZE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
If wParam is TRUE, it specifies that the application should indicate
which part of the client area contains valid information. The system
copies the valid information to the specified area within the new
client area. If wParam is FALSE, the application does not need to
indicate the valid part of the client area.
lParam
If wParam is TRUE, lParam points to an NCCALCSIZE_PARAMS structure
that contains information an application can use to calculate the
new size and position of the client rectangle. If wParam is FALSE,
lParam points to a RECT structure. On entry, the structure contains
the proposed window rectangle for the window. On exit, the structure
should contain the screen coordinates of the corresponding window
client area.
Return Value
If the wParam parameter is FALSE, the application should return zero.
If wParam is TRUE, the application should return zero or a
combination of the following values.
If wParam is TRUE and an application returns zero, the old client
area is preserved and is aligned with the upper-left corner of the
new client area.
WVR_ALIGNTOP
Specifies that the client area of the window is to be preserved
and aligned with the top of the new position of the window. For
example, to align the client area to the upper-left corner, return
the WVR_ALIGNTOP and WVR_ALIGNLEFT values.
WVR_ALIGNLEFT
Specifies that the client area of the window is to be preserved
and aligned with the left side of the new position of the
window. For example, to align the client area to the lower-left
corner, return the WVR_ALIGNLEFT and WVR_ALIGNBOTTOM values.
WVR_ALIGNBOTTOM
Specifies that the client area of the window is to be preserved
and aligned with the bottom of the new position of the window. For
example, to align the client area to the top-left corner, return
the WVR_ALIGNTOP and WVR_ALIGNLEFT values.
WVR_HREDRAW
Used in combination with any other values, causes the window to be
completely redrawn if the client rectangle changes size
horizontally. This value is similar to CS_HREDRAW class style
WVR_VREDRAW
Used in combination with any other values, causes the window to be
completely redrawn if the client rectangle changes size
vertically. This value is similar to CS_VREDRAW class style
WVR_REDRAW
This value causes the entire window to be redrawn. It is a
combination of WVR_HREDRAW and WVR_VREDRAW values. WVR_VALIDRECTS
This value indicates that, upon return from WM_NCCALCSIZE, the
rectangles specified by the rgrc[1] and rgrc[2] members of the
NCCALCSIZE_PARAMS structure contain valid destination and source
area rectangles, respectively. The system combines these
rectangles to calculate the area of the window to be
preserved. The system copies any part of the window image that is
within the source rectangle and clips the image to the destination
rectangle. Both rectangles are in parent-relative or
screen-relative coordinates.
This return value allows an application to implement more elaborate
client-area preservation strategies, such as centering or preserving
a subset of the client area.
Remarks
The window may be redrawn, depending on whether the CS_HREDRAW or
CS_VREDRAW class style is specified. This is the default,
backward-compatible processing of this message by the
DefWindowProc function (in addition to the usual client rectangle
calculation described in the preceding table).
*/
- (void) decodeWM_NCCALCSIZEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
// stub for future dev
#ifdef __TESTEVENT__
printf("WM_NCCALCSIZE\n");
#endif
/*NCCALCSIZE_PARAMS * newRects;
NSPoint eventLocation;
NSRect rect;
RECT drect;
NSEvent *ev =nil;
if(wParam==TRUE)
{
// get first rect from NCCALCSIZE_PARAMS Structure
newRects=(NCCALCSIZE_PARAMS *)lParam;
// get rect 1 from array
drect=newRects->rgrc[1];
//create a size event and send it to the window
rect = MSScreenRectToGS(drect, [EVENT_WINDOW(hwnd) styleMask], self);
eventLocation = rect.origin;
// make event
ev = [NSEvent otherEventWithType: NSAppKitDefined
location: eventLocation
modifierFlags: 0
timestamp: 0
windowNumber: (int)hwnd
context: GSCurrentContext()
subtype: GSAppKitWindowResized
data1: rect.size.width
data2: rect.size.height];
[EVENT_WINDOW(hwnd) sendEvent:ev];*/
//[[EVENT_WINDOW(hwnd) contentView] display];
//[self resizeBackingStoreFor:hwnd];
/* ev = [NSEvent otherEventWithType: NSAppKitDefined
location: eventLocation
modifierFlags: 0
timestamp: 0
windowNumber: (int)hwnd
context: GSCurrentContext()
subtype: GSAppKitWindowMoved
data1: rect.origin.x
data2: rect.origin.y];
[EVENT_WINDOW(hwnd) sendEvent:ev];
//printf(" Rect 1 =\n%s",[[self MSRectDetails:drect] cString]);
}
//printf("wParam is %s\n",wParam ? "TRUE" : "FALSE");*/
}
/*
WM_WINDOWPOSCHANGED Notification
The WM_WINDOWPOSCHANGED message is sent to a window whose size,
position, or place in the Z order has changed as a result of a call
to the SetWindowPos function or another window-management function.
A window receives this message through its WindowProc function.
Syntax
WM_WINDOWPOSCHANGED
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
Pointer to a WINDOWPOS structure that contains information about the
window's new size and position. Return Value
If an application processes this message, it should return zero.
Remarks
By default, the DefWindowProc function sends the WM_SIZE and WM_MOVE
messages to the window. The WM_SIZE and WM_MOVE messages are not
sent if an application handles the WM_WINDOWPOSCHANGED message
without calling DefWindowProc. It is more efficient to perform any
move or size change processing during the WM_WINDOWPOSCHANGED
message without calling DefWindowProc.
*/
- (void) decodeWM_WINDOWPOSCHANGEDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
// stub for future dev
@ -461,48 +287,6 @@
#endif
}
/*
WM_WINDOWPOSCHANGING Notification
The WM_WINDOWPOSCHANGING message is sent to a window whose size,
position, or place in the Z order is about to change as a result of
a call to the SetWindowPos function or another window-management
function. A window receives this message through its WindowProc
function.
Syntax
WM_WINDOWPOSCHANGING
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
Pointer to a WINDOWPOS structure that contains information about the
window's new size and position. Return Value
If an application processes this message, it should return zero.
Remarks
For a window with the WS_OVERLAPPED or WS_THICKFRAME style, the
DefWindowProc function sends the WM_GETMINMAXINFO message to the
window. This is done to validate the new size and position of the
window and to enforce the CS_BYTEALIGNCLIENT and CS_BYTEALIGNWINDOW
client styles. By not passing the WM_WINDOWPOSCHANGING message to
the DefWindowProc function, an application can override these
defaults. While this message is being processed, modifying any of
the values in WINDOWPOS affects the window's new size, position, or
place in the Z order. An application can prevent changes to the
window by setting or clearing the appropriate bits in the flags
member of WINDOWPOS.
*/
- (void) decodeWM_WINDOWPOSCHANGINGParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
// stub for future dev
@ -511,83 +295,6 @@ Remarks
#endif
}
/*
WM_GETMINMAXINFO Notification
The WM_GETMINMAXINFO message is sent to a window when the size or
position of the window is about to change. An application can use
this message to override the window's default maximized size and
position, or its default minimum or maximum tracking size.
A window receives this message through its WindowProc function.
Syntax
WM_GETMINMAXINFO
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
Pointer to a MINMAXINFO structure that contains the default
maximized position and dimensions, and the default minimum and
maximum tracking sizes. An application can override the defaults by
setting the members of this structure.
Return Value
If an application processes this message, it should return zero.
Remarks
The maximum tracking size is the largest window size that can be
produced by using the borders to size the window. The minimum
tracking size is the smallest window size that can be produced by
using the borders to size the window.
The MINMAXINFO structure contains information about a window's
maximized size and position and its minimum and maximum tracking
size.
Syntax
typedef struct {
POINT ptReserved;
POINT ptMaxSize;
POINT ptMaxPosition;
POINT ptMinTrackSize;
POINT ptMaxTrackSize;
} MINMAXINFO;
Members
ptReserved
Reserved; do not use.
ptMaxSize
Specifies the maximized width (POINT. x) and the maximized height
(POINT. y) of the window. For systems with multiple monitors, this
refers to the primary monitor. ptMaxPosition Specifies the
position of the left side of the maximized window (POINT. x) and
the position of the top of the maximized window (POINT. y). For
systems with multiple monitors, this refers to the monitor on
which the window maximizes.
ptMinTrackSize
Specifies the minimum tracking width (POINT. x) and the minimum
tracking height (POINT. y) of the window. This is unchanged for
systems with multiple monitors. ptMaxTrackSize Specifies the
maximum tracking width (POINT. x) and the maximum tracking height
(POINT. y) of the window. For systems with multiple monitors, this
is the size for a window that is made as large as the virtual
screen.
*/
- (LRESULT) decodeWM_GETMINMAXINFOParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
// reused from original author (added debug code)
@ -610,39 +317,6 @@ Remarks
return 0;
}
/*
WM_EXITSIZEMOVE Notification
The WM_EXITSIZEMOVE message is sent one time to a window, after it
has exited the moving or sizing modal loop. The window enters the
moving or sizing modal loop when the user clicks the window's title
bar or sizing border, or when the window passes the WM_SYSCOMMAND
message to the DefWindowProc function and the wParam parameter of
the message specifies the SC_MOVE or SC_SIZE value. The operation
is complete when DefWindowProc returns.
A window receives this message through its WindowProc function.
Syntax
WM_EXITSIZEMOVE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
This parameter is not used.
Return Value
An application should return zero if it processes this message.
*/
- (LRESULT) decodeWM_EXITSIZEMOVEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
// may have a small bug here note it for follow up
@ -665,63 +339,28 @@ Remarks
return 0;
}
/*
WM_SIZING Notification
The WM_SIZING message is sent to a window that the user is
resizing. By processing this message, an application can monitor the
size and position of the drag rectangle and, if needed, change its
size or position. A window receives this message through its
WindowProc function.
Syntax
WM_SIZING
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies which edge of the window is being sized. This parameter
can be one of the following values.
WMSZ_BOTTOM
Bottom edge
WMSZ_BOTTOMLEFT
Bottom-left corner
WMSZ_BOTTOMRIGHT
Bottom-right corner
WMSZ_LEFT
Left edge
WMSZ_RIGHT
Right edge
WMSZ_TOP
Top edge
WMSZ_TOPLEFT
Top-left corner
WMSZ_TOPRIGHT
Top-right corner
lParam
Pointer to a RECT structure with the screen coordinates of the
drag rectangle. To change the size or position of the drag
rectangle, an application must change the members of this
structure.
Return Value
An application should return TRUE if it processes this message.
*/
- (LRESULT) decodeWM_SIZINGParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam
- (void) decodeWM_SIZINGParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam
{
// stub for future dev
#ifdef __SIZING__
printf("SIZING was called\n");
// stub for future dev
#endif
return 0;
flags.HOLD_PAINT_FOR_SIZING=TRUE;
//[EVENT_WINDOW(hwnd) displayIfNeeded];
//[self decodeWM_SIZEParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam];
//printf("SIZING called\n");
//return TRUE;
}
- (LRESULT) decodeWM_MOVINGParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam
{
// stub for future dev
[self decodeWM_MOVEParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam];
return TRUE;
}
@end

View file

@ -0,0 +1,314 @@
/* WIN32Server - Implements window handling for MSWindows
Copyright (C) 2005 Free Software Foundation, Inc.
Written by: Tom MacSween <macsweent@sympatico.ca>
Date August 2005
This file is part of the GNU Objective C User Interface Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
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,
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.
*/
#include "w32_Events.h"
static NSString *NSMenuWillTearOff = @"MenuWillTearOff";
static NSString *NSMenuwillPopUP =@"MenuwillPopUP";
static NSString *NSWindowDidCreateWindow=@"WindowDidCreateWindow";
@interface NSMenu (w32Menu)
- (void) _rightMouseDisplay: (NSEvent*)theEvent;
- (void) setTornOff: (BOOL)flag;
@end
@implementation NSMenu (w32Menu)
// fixme to handle context menues better on win32
// although it works better then it used to, it still
// needs more work.
- (void) _rightMouseDisplay: (NSEvent*)theEvent
{
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
NSNotification * popped;
//printf("my menu tarnsient method\n");
// need to get hwnd for the window
[self displayTransient];
// post notification here
popped = [NSNotification
notificationWithName: NSMenuwillPopUP
object: _bWindow
userInfo: nil];
[nc postNotification: popped];
[_view mouseDown: theEvent];
[self closeTransient];
[_bWindow orderOut:self];
}
- (void) setTornOff: (BOOL)flag
{
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
NSNotification * torn;
NSMenu *supermenu;
_is_tornoff = flag;
if (flag)
{
supermenu = [self supermenu];
if (supermenu != nil)
{
[[supermenu menuRepresentation] setHighlightedItemIndex: -1];
supermenu->_attachedMenu = nil;
}
torn = [NSNotification
notificationWithName: NSMenuWillTearOff
object: self
userInfo: nil];
[nc postNotification: torn];
}
[_view update];
}
@end
@interface NSWindow (w32Window)
- (id) initWithContentRect: (NSRect)contentRect
styleMask: (unsigned int)aStyle
backing: (NSBackingStoreType)bufferingType
defer: (BOOL)flag;
@end
@implementation NSWindow (w32Window)
- (id) initWithContentRect: (NSRect)contentRect
styleMask: (unsigned int)aStyle
backing: (NSBackingStoreType)bufferingType
defer: (BOOL)flag
{
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
NSNotification * createdWindow;
id anObject=[self initWithContentRect: contentRect
styleMask: aStyle
backing: bufferingType
defer: flag
screen: nil];
createdWindow = [NSNotification
notificationWithName: NSWindowDidCreateWindow
object: self
userInfo: nil];
[nc postNotification: createdWindow];
return anObject;
}
@end
@implementation WIN32Server (w32_notifications)
/*
Notification hook from application
The default notification are:
NSApplicationDidFinishLaunchingNotification
NSApplicationWillFinishLaunchingNotification
NSApplicationWillHideNotification
NSWindowWillMiniaturizeNotification
Custom Notifications:
NSMenuWillTearOff
NSMenuwillPopUP
when these are received the Win32 server can now finalize its setup.
other hook can also be set at this point
syncronize the GS Env with The native Backend so we can use native calls to manage
certain things directly.
*/
- (void) ApplicationWillFinishLaunching: (NSNotification*)aNotification;
{
}
- (void) ApplicationDidFinishLaunching: (NSNotification*)aNotification
{
NSMenu * theMenu = [NSApp mainMenu];
NSMenu * subMenu;
NSMenuItem * anItem;
LONG result;
// Get our MainMenu window refference:
flags.menuRef=[[theMenu window] windowNumber];
flags.HAVE_MAIN_MENU=YES;
// add an entry in the main menu to bring up the config window
[self initConfigWindow];
// if info does not exist add it and create a submenu for it
if([theMenu itemWithTitle:@"Info"] ==nil)
{
anItem=[NSMenuItem new];
[anItem setTitle:@"Info"];
[theMenu insertItem:anItem atIndex:0];
subMenu=[NSMenu new];
[theMenu setSubmenu:subMenu forItem:anItem];
[anItem setEnabled:YES];
}
// add 'Server Preference' to the 'Info' item submenu
subMenu=[[theMenu itemWithTitle:@"Info"] submenu];
[subMenu addItemWithTitle:@"Server Preferences"
action:@selector(showServerPrefs:)
keyEquivalent:nil];
anItem=(NSMenuItem *)[subMenu itemWithTitle:@"Server Preferences"];
[anItem setTarget:self];
[anItem setEnabled:YES];
if (flags.HAVE_SERVER_PREFS==NO)
{
NSRunInformationalAlertPanel(@"Server Preferences Not Set",
@"Please set server Preferences\nlook in [info]->[Server Preferences]\nto change settings",
@"OK",nil, nil);
[configWindow makeKeyAndOrderFront:self];
}
/*
reset the style on the main menu panel so when it hides it will go the the task bar
I will use WS_EX_Left for this. Note that this is native code mixed with GNUStep
*/
if (flags.useWMStyles==YES)
{
ShowWindow((HWND)flags.menuRef,SW_HIDE);
SetLastError(0);
result=SetWindowLong((HWND)flags.menuRef,GWL_EXSTYLE,(LONG)WS_EX_LEFT);
// should check error here...
result=SetWindowText((HWND)flags.menuRef,[[theMenu title] cString]);
ShowWindow((HWND)flags.menuRef,SW_SHOWNORMAL);
// set app icon image for win32
}
// future implimentation
#ifdef __WM_ACTIVE__
printf("reseting menu style\n");
if (result==0)
{
printf("setting mainMenu Style: Error %ld\n",GetLastError());
}
fflush(stdout);
#endif
}
- (void) ApplicationWillHideNotification: (NSNotification*)aNotification
{
flags.HOLD_MENU_FOR_MOVE=TRUE;
flags.HOLD_MENU_FOR_SIZE=TRUE;
ReleaseCapture(); // if the mouse is 'stuck' release it
#ifdef __WM_ACTIVE__
printf("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU\n");
printf("got Notification: %s\n",
[[aNotification name] cString]);
fflush(stdout);
#endif
}
-(void) WindowWillMiniaturizeNotification:(NSNotification*)aNotification
{
flags.HOLD_MINI_FOR_SIZE=TRUE;
flags.HOLD_MINI_FOR_MOVE=TRUE;
}
-(void) MenuWillTearOff:(NSNotification*)aNotification
{
LONG result;
NSMutableString * iconTitle =[NSMutableString stringWithString:@"MENU "];
NSMenu * theMenu=[aNotification object];
int windowNum =[[theMenu window] windowNumber];
ShowWindow((HWND)windowNum,SW_HIDE);
SetLastError(0);
result=SetWindowLong((HWND)windowNum,GWL_EXSTYLE,(LONG)WS_EX_LEFT);
// should check error here...
// set the icon title
[iconTitle appendString: [theMenu title]];
result=SetWindowText((HWND)windowNum,[iconTitle cString]);
ShowWindow((HWND)windowNum,SW_SHOWNORMAL);
#ifdef __APPNOTIFICATIONS__
printf("got menu tear off Notification\n");
printf("menu title is: %s\n",[[theMenu title] cString]);
#endif
}
-(void) MenuwillPopUP:(NSNotification*)aNotification
{
LONG result;
int windowNum=[[aNotification object] windowNumber];
ShowWindow((HWND)windowNum,SW_HIDE);
SetLastError(0);
result=SetWindowLong((HWND)windowNum,GWL_EXSTYLE,(LONG)WS_EX_RIGHT);
// should check error here...
// set the icon title
result=SetWindowText((HWND)windowNum,"Context menu");
ShowWindow((HWND)windowNum,SW_SHOWNORMAL);
flags.HOLD_TRANSIENT_FOR_SIZE=TRUE;
flags.HOLD_TRANSIENT_FOR_MOVE=TRUE;
#ifdef __APPNOTIFICATIONS__
printf("got menu Popup Notification\n");
printf("window title is: %s\n",[[[aNotification object] title] cString]);
#endif
}
- (void) WindowDidCreateWindow:(NSNotification*)aNotification
{
unsigned int GSStyle;
NSString * GSClass=[[aNotification object] className];
[[aNotification object] setShowsResizeIndicator:NO];
// set window style
if ( [GSClass isEqual:@"NSMenuPanel"]==YES)
{
GSStyle= [[aNotification object] styleMask];
//windowNum=[[aNotification object] windowNumber];
//[self resetForGSWindowStyle:(HWND)windowNum w32Style:w32style];
//printf("GSClassName %s GS Style %u w32 Style %X\n",[GSClass cString],GSStyle,(UINT)w32style);
}
}
@end

View file

@ -28,45 +28,6 @@
@implementation WIN32Server (w32_text_focus)
/*
WM_SETTEXT Message
An application sends a WM_SETTEXT message to set the text of a window.
Syntax
To send this message, call the SendMessage function as
follows. lResult = SendMessage( // returns LRESULT in lResult (HWND)
hWndControl, // handle to destination control (UINT) WM_SETTEXT, //
message ID (WPARAM) wParam, // = (WPARAM) () wParam; (LPARAM) lParam
// = (LPARAM) () lParam; ); Parameters
wParam
This parameter is not used.
lParam
Pointer to a null-terminated string that is the window text. Return
Value
The return value is TRUE if the text is set. It is FALSE (for an
edit control), LB_ERRSPACE (for a list box), or CB_ERRSPACE (for a
combo box) if insufficient space is available to set the text in the
edit control. It is CB_ERR if this message is sent to a combo box
without an edit control.
Remarks
The DefWindowProc function sets and displays the window text. For an
edit control, the text is the contents of the edit control. For a
combo box, the text is the contents of the edit-control portion of
the combo box. For a button, the text is the button name. For other
windows, the text is the window title.
This message does not change the current selection in the list box
of a combo box. An application should use the CB_SELECTSTRING
message to select the item in a list box that matches the text in
the edit control.
*/
//- (LRESULT) decodeWM_SETTEXTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
//{
@ -81,38 +42,6 @@
//return 0;
//}
/*
WM_SETFOCUS Notification
The WM_SETFOCUS message is sent to a window after it has gained the
keyboard focus.
Syntax
WM_SETFOCUS
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the window that has lost the keyboard focus. This
parameter can be NULL.
lParam
This parameter is not used.
Return Value
An application should return zero if it processes this message.
Remarks
To display a caret, an application should call the appropriate caret
functions when it receives the WM_SETFOCUS message.
*/
- (LRESULT) decodeWM_SETFOCUSParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
@ -159,42 +88,6 @@
return 0;
}
/*
WM_KILLFOCUS Notification
The WM_KILLFOCUS message is sent to a window immediately before it
loses the keyboard focus.
Syntax
WM_KILLFOCUS
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the window that receives the keyboard focus. This
parameter can be NULL.
lParam
This parameter is not used.
Return Value
An application should return zero if it processes this message.
Remarks
If an application is displaying a caret, the caret should be
destroyed at this point. While processing this message, do not make
any function calls that display or activate a window. This causes
the thread to yield control and can cause the application to stop
responding to messages. For more information, see Message Deadlocks.
*/
- (void) decodeWM_KILLFOCUSParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
// reused from original author (added debug output)
@ -222,64 +115,6 @@
#endif
}
/*
WM_GETTEXT Message
An application sends a WM_GETTEXT message to copy the text that
corresponds to a window into a buffer provided by the caller.
Syntax
To send this message, call the SendMessage function as follows.
lResult = SendMessage( // returns LRESULT in lResult (HWND)
hWndControl, // handle to destination control (UINT) WM_GETTEXT, //
message ID (WPARAM) wParam, // = (WPARAM) () wParam; (LPARAM) lParam
// = (LPARAM) () lParam; ); Parameters
wParam
Specifies the maximum number of TCHARs to be copied, including the
terminating null character. Windows NT/2000/XP:ANSI applications may
have the string in the buffer reduced in size (to a minimum of half
that of the wParam value) due to conversion from ANSI to Unicode.
lParam
Pointer to the buffer that is to receive the text.
Return Value
The return value is the number of TCHARs copied, not including the
terminating null character.
Remarks
The DefWindowProc function copies the text associated with the
window into the specified buffer and returns the number of
characters copied. Note, for non- text static controls this gives
you the text with which the control was originally created, that is,
the ID number. However, it gives you the ID of the non-text static
control as originally created. That is, if you subsequently used a
STM_SETIMAGE to change it the original ID would still be returned.
For an edit control, the text to be copied is the content of the
edit control. For a combo box, the text is the content of the edit
control (or static-text) portion of the combo box. For a button, the
text is the button name. For other windows, the text is the window
title. To copy the text of an item in a list box, an application can
use the LB_GETTEXT message. When the WM_GETTEXT message is sent to
a static control with the SS_ICON style, a handle to the icon will
be returned in the first four bytes of the buffer pointed to by
lParam. This is true only if the WM_SETTEXT message has been used to
set the icon. Rich Edit: If the text to be copied exceeds 64K, use
either the EM_STREAMOUT or EM_GETSELTEXT message. Windows 2000/XP:
Sending a WM_GETTEXT message to a non-text static control, such as a
static bitmap or static icon control, does not return a string
value. Instead, it returns zero. In addition, in previous versions
of Microsoft® Windows® and Microsoft Windows NT®, applications could
send a WM_GETTEXT message to a non-text static control to retrieve
the control's ID. To retrieve a control's ID in Windows 2000/XP,
applications can use GetWindowLong passing GWL_ID as the index value
or GetWindowLongPtr using GWLP_ID.
*/
- (void) decodeWM_GETTEXTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
// stub for future dev

View file

@ -64,62 +64,94 @@ invalidateWindow(HWND hwnd, RECT rect)
}
}
@implementation WIN32Server (w32_windowdisplay)
/* styles are mapped between the two systems
* I have not changed current inplimentation of mouse or keyboard
* events. */
- (DWORD) windowStyleForGSStyle: (unsigned int) style
{
/*
WM_SHOWWINDOW Notification
The WM_SHOWWINDOW message is sent to a window when the window is
about to be hidden or shown. A window receives this message through
its WindowProc function.
Syntax
WM_SHOWWINDOW
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies whether a window is being shown. If wParam is TRUE, the
window is being shown. If wParam is FALSE, the window is being
hidden. lParam Specifies the status of the window being shown. If
lParam is zero, the message was sent because of a call to the
ShowWindow function; otherwise, lParam is one of the following
values.
SW_OTHERUNZOOM
The window is being uncovered because a maximize window was restored or
minimized.
SW_OTHERZOOM
The window is being covered by another window that has been maximized.
SW_PARENTCLOSING
The window's owner window is being minimized.
SW_PARENTOPENING
The window's owner window is being restored.
Return Value
If an application processes this message, it should return zero.
Remarks
The DefWindowProc function hides or shows the window, as specified
by the message. If a window has the WS_VISIBLE style when it is
created, the window receives this message after it is created, but
before it is displayed. A window also receives this message when its
visibility state is changed by the ShowWindow or ShowOwnedPopups
function. The WM_SHOWWINDOW message is not sent under the following
circumstances:
When a top-level, overlapped window is created with the WS_MAXIMIZE
or WS_MINIMIZE style. When the SW_SHOWNORMAL flag is specified in
the call to the ShowWindow function.
NSUtilityWindowMask 16
NSDocModalWindowMask 32
NSBorderlessWindowMask 0
NSTitledWindowMask 1
NSClosableWindowMask 2
NSMiniaturizableWindowMask 4
NSResizableWindowMask 8
NSIconWindowMask 64
NSMiniWindowMask 128
NSMenu(style) = NSTitledWindowMask | NSClosableWindowMask =3;
*/
DWORD wstyle = 0;
if (flags.useWMStyles==NO)
return WS_POPUP;
switch (style)
{
case 0:
wstyle=WS_POPUP;
break;
case NSTitledWindowMask: // 1
wstyle = WS_CAPTION;
break;
case NSClosableWindowMask: // 2
wstyle =WS_CAPTION+WS_SYSMENU;
break;
case NSMiniaturizableWindowMask: //4
wstyle =WS_MINIMIZEBOX+WS_SYSMENU;
break;
case NSResizableWindowMask: // 8
wstyle=WS_SIZEBOX;
case NSMiniWindowMask: //128
case NSIconWindowMask: // 64
wstyle = WS_ICONIC;
break;
//case NSUtilityWindowMask: //16
//case NSDocModalWindowMask: //32
break;
// combinations
case NSTitledWindowMask+NSClosableWindowMask: //3
wstyle =WS_CAPTION+WS_SYSMENU;
break;
case NSTitledWindowMask+NSClosableWindowMask+NSMiniaturizableWindowMask: //7
wstyle =WS_CAPTION+WS_MINIMIZEBOX+WS_SYSMENU;
break;
case NSTitledWindowMask+NSResizableWindowMask: // 9
wstyle = WS_CAPTION+WS_SIZEBOX;
break;
case NSTitledWindowMask+NSClosableWindowMask+NSResizableWindowMask: // 11
wstyle =WS_CAPTION+WS_SIZEBOX+WS_SYSMENU;
break;
case NSTitledWindowMask+NSResizableWindowMask+NSMiniaturizableWindowMask: //13
wstyle = WS_SIZEBOX+WS_MINIMIZEBOX+WS_SYSMENU+WS_CAPTION;
break;
case NSTitledWindowMask+NSClosableWindowMask+NSResizableWindowMask+
NSMiniaturizableWindowMask: //15
wstyle =WS_CAPTION+WS_SIZEBOX+WS_MINIMIZEBOX+WS_SYSMENU;
break;
default:
wstyle =WS_POPUP; //WS_CAPTION+WS_SYSMENU;
break;
}
//NSLog(@"Window wstyle %d for style %d", wstyle, style);
#ifdef __W32_debug__
printf("\n\n##############################################################\n");
printf("GS Window Style %u\n",style);
printf("Win32 Style picked %ld [hex] %X\n",wstyle,(uint)wstyle);
printf("\n\n##############################################################\n");
#endif
return wstyle;
}
/*deprecated remove from code */
- (void) decodeWM_SHOWWINDOWParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
//SW_OTHERUNZOOM //window is being uncovered
@ -173,49 +205,6 @@ invalidateWindow(HWND hwnd, RECT rect)
#endif
}
/*
WM_NCPAINT
The WM_NCPAINT message is sent to a window when its frame must be
painted. A window receives this message through its WindowProc
function.
LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // WM_NCPAINT
WPARAM wParam, // handle to update region (HRGN)
LPARAM lParam // not used
);
Parameters
wParam
Handle to the update region of the window. The update region is
clipped to the window frame. When wParam is 1, the entire window
frame needs to be updated.
lParam
This parameter is not used.
Return Values
An application returns zero if it processes this message.
Remarks
The DefWindowProc function paints the window frame.
An application can intercept the WM_NCPAINT message and paint its
own custom window frame. The clipping region for a window is always
rectangular, even if the shape of the frame is altered. The wParam
value can be passed to GetDCEx as in the following example.
case WM_NCPAINT:
{
HDC hdc;
hdc = GetDCEx(hwnd, (HRGN)wParam, DCX_WINDOW|DCX_INTERSECTRGN);
// Paint into this DC
ReleaseDC(hwnd, hdc);
}
*/
- (void) decodeWM_NCPAINTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
#ifdef __TESTEVENT__
@ -223,48 +212,6 @@ invalidateWindow(HWND hwnd, RECT rect)
#endif
}
/*
WM_ERASEBKGND Notification
The WM_ERASEBKGND message is sent when the window background must be
erased (for example, when a window is resized). The message is sent
to prepare an invalidated portion of a window for painting.
Syntax
WM_ERASEBKGND
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the device context.
lParam
This parameter is not used.
Return Value
An application should return nonzero if it erases the background;
otherwise, it should return zero.
Remarks
The DefWindowProc function erases the background by using the class
background brush specified by the hbrBackground member of the
WNDCLASS structure. If hbrBackground is NULL, the application should
process the WM_ERASEBKGND message and erase the background. An
application should return nonzero in response to WM_ERASEBKGND if it
processes the message and erases the background; this indicates that
no further erasing is required. If the application returns zero, the
window will remain marked for erasing. (Typically, this indicates
that the fErase member of the PAINTSTRUCT structure will be TRUE.)
*/
- (LRESULT) decodeWM_ERASEBKGNDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
// GS handles this for now...
@ -275,85 +222,36 @@ invalidateWindow(HWND hwnd, RECT rect)
return (LRESULT)1;
}
/*
WM_PAINT
The WM_PAINT message is sent when the system or another application
makes a request to paint a portion of an application's window. The
message is sent when the UpdateWindow or RedrawWindow function is
called, or by the DispatchMessage function when the application
obtains a WM_PAINT message by using the GetMessage or PeekMessage
function. A window receives this message through its WindowProc
function.
LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // WM_PAINT
WPARAM wParam, // not used
LPARAM lParam // not used
);
Parameters
wParam
This parameter is not used.
lParam
This parameter is not used.
Return Values
An application returns zero if it processes this message.
Remarks
The WM_PAINT message is generated by the system and should not be
sent by an application. To force a window to draw into a specific
device context, use the WM_PRINT or WM_PRINTCLIENT message. Note
that this requires the target window to support the WM_PRINTCLIENT
message. Most common controls support the WM_PRINTCLIENT message.
The DefWindowProc function validates the update region. The function
may also send the WM_NCPAINT message to the window procedure if the
window frame must be painted and send the WM_ERASEBKGND message if
the window background must be erased. The system sends this message
when there are no other messages in the application's message queue.
DispatchMessage determines where to send the message; GetMessage
determines which message to dispatch. GetMessage returns the
WM_PAINT message when there are no other messages in the
application's message queue, and DispatchMessage sends the message
to the appropriate window procedure. A window may receive internal
paint messages as a result of calling RedrawWindow with the
RDW_INTERNALPAINT flag set. In this case, the window may not have an
update region. An application should call the GetUpdateRect function
to determine whether the window has an update region. If
GetUpdateRect returns zero, the application should not call the
BeginPaint and EndPaint functions. An application must check for
any necessary internal painting by looking at its internal data
structures for each WM_PAINT message, because a WM_PAINT message may
have been caused by both a non-NULL update region and a call to
RedrawWindow with the RDW_INTERNALPAINT flag set. The system sends
an internal WM_PAINT message only once. After an internal WM_PAINT
message is returned from GetMessage or PeekMessage or is sent to a
window by UpdateWindow, the system does not post or send further
WM_PAINT messages until the window is invalidated or until
RedrawWindow is called again with the RDW_INTERNALPAINT flag set.
For some common controls, the default WM_PAINT message processing
checks the wParam parameter. If wParam is non-NULL, the control
assumes that the value is an HDC and paints using that device
context.
*/
- (void) decodeWM_PAINTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
// reused from original author (added debug code)
RECT rect;
//LPPAINTSTRUCT lpPaint;
//HDC theHdc;
/*BOOL InvalidateRect(
HWND hWnd, // handle to window
CONST RECT* lpRect, // rectangle coordinates
BOOL bErase // erase state
);*/
//theHdc=BeginPaint(hwnd,lpPaint);
//if(flags.HOLD_PAINT_FOR_SIZING==FALSE)
// {
if (GetUpdateRect(hwnd, &rect, NO))
{
//InvalidateRect(hwnd,rect,YES);
invalidateWindow(hwnd, rect);
// validate the whole window, for in some cases an infinite series
// of WM_PAINT is triggered
ValidateRect(hwnd, NULL);
}
// }
flags._eventHandled=YES;
//flags.HOLD_PAINT_FOR_SIZING=FALSE;
//printf("WM_PAINT\n");
#ifdef __PAINT__
printf("%s",[[self WindowDetail:EVENT_WINDOW(hwnd)] cString]);
printf("%s",[[self MSRectDetails:rect] cString]);
@ -361,79 +259,15 @@ invalidateWindow(HWND hwnd, RECT rect)
#endif
}
/*
WM_SYNCPAINT
The WM_SYNCPAINT message is used to synchronize painting while
avoiding linking independent GUI threads. A window receives this
message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // WM_SYNCPAINT
WPARAM wParam, // not used
LPARAM lParam // not used
);
Parameters
This message has no parameters.
Return Values
An application returns zero if it processes this message.
Remarks
When a window has been hidden, shown, moved, or sized, the system
may determine that it is necessary to send a WM_SYNCPAINT message to
the top-level windows of other threads. Applications must pass
WM_SYNCPAINT to DefWindowProc for processing. The DefWindowProc
function will send a WM_NCPAINT message to the window procedure if
the window frame must be painted and send a WM_ERASEBKGND message if
the window background must be erased.
*/
- (void) decodeWM_SYNCPAINTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
// stub for future dev
#ifdef __TESTEVENT__
printf("WM_SYNCPAINT\n");
#endif
//#ifdef __TESTEVENT__
//printf("WM_SYNCPAINT\n");
//#endif
}
/*
WM_CAPTURECHANGED Notification
The WM_CAPTURECHANGED message is sent to the window that is losing
the mouse capture. A window receives this message through its
WindowProc function.
Syntax
WM_CAPTURECHANGED
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
Handle to the window gaining the mouse capture.
Return Value
An application should return zero if it processes this message.
Remarks
A window receives this message even if it calls ReleaseCapture
itself. An application should not attempt to set the mouse capture
in response to this message. When it receives this message, a
window should redraw itself, if necessary, to reflect the new
mouse-capture state.
*/
- (void) decodeWM_CAPTURECHANGEDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
// stub for future dev
@ -442,61 +276,20 @@ invalidateWindow(HWND hwnd, RECT rect)
#endif
}
/*
WM_GETICON Notification
The WM_GETICON message is sent to a window to retrieve a handle to
the large or small icon associated with a window. The system
displays the large icon in the ALT+TAB dialog, and the small icon in
the window caption. A window receives this message through its
WindowProc function.
Syntax
WM_GETICON
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the type of icon being retrieved. This parameter can be
one of the following values.
ICON_BIG
Retrieve the large icon for the window.
ICON_SMALL
Retrieve the small icon for the window.
ICON_SMALL2
Windows XP: Retrieves the small icon provided by the
application. If the application does not provide one, the system
uses the system-generated icon for that window.
lParam
This parameter is not used.
Return Value
The return value is a handle to the large or small icon, depending
on the value of wParam. When an application receives this message,
it can return a handle to a large or small icon, or pass the
message to the DefWindowProc function.
Remarks
When an application receives this message, it can return a handle to
a large or small icon, or pass the message to DefWindowProc.
DefWindowProc returns a handle to the large or small icon associated
with the window, depending on the value of wParam.
*/
- (void) decodeWM_GETICONParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
- (HICON) decodeWM_GETICONParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
// stub for future dev
#ifdef __TESTEVENT__
printf("WM_GETICON\n");
#endif
return currentAppIcon;
}
- (HICON) decodeWM_SETICONParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
printf("WM_SETICON\n");
return currentAppIcon;
}
- (void) resizeBackingStoreFor: (HWND)hwnd
{