Changeset 11124
- Timestamp:
- Aug 16, 1999, 5:54:11 PM (26 years ago)
- Location:
- tags/trunk/src/user32/new
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified tags/trunk/src/user32/new/win32wnd.cpp ¶
r11019 r11124 1 /* $Id: win32wnd.cpp,v 1.2 4 1999-07-26 20:03:49 sandervlExp $ */1 /* $Id: win32wnd.cpp,v 1.25 1999-08-16 15:54:11 dengert Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 5 5 * 6 6 * Copyright 1998-1999 Sander van Leeuwen (sandervl@xs4all.nl) 7 * Copyright 1999 Daniela Engert (dani@ngrt.de) 7 8 * 8 9 * Parts based on Wine Windows code (windows\win.c) … … 842 843 //****************************************************************************** 843 844 //****************************************************************************** 844 ULONG Win32Window::MsgButton(ULONG msg, ULONG x, ULONGy)845 ULONG Win32Window::MsgButton(ULONG msg, ULONG ncx, ULONG ncy, ULONG clx, ULONG cly) 845 846 { 846 847 ULONG win32msg; 847 848 ULONG win32ncmsg; 848 849 849 dprintf(("MsgButton to (%d,%d)", x,y));850 dprintf(("MsgButton to (%d,%d)", ncx, ncy)); 850 851 switch(msg) { 851 852 case BUTTON_LEFTDOWN: … … 894 895 } 895 896 } 896 SendInternalMessageA(win32ncmsg, lastHitTestVal, MAKELONG( x,y)); //TODO:897 return SendInternalMessageA(win32msg, 0, MAKELONG( x,y));897 SendInternalMessageA(win32ncmsg, lastHitTestVal, MAKELONG(ncx, ncy)); //TODO: 898 return SendInternalMessageA(win32msg, 0, MAKELONG(clx, cly)); 898 899 } 899 900 //****************************************************************************** -
TabularUnified tags/trunk/src/user32/new/win32wnd.h ¶
r11019 r11124 1 /* $Id: win32wnd.h,v 1.2 1 1999-07-26 20:03:49 sandervlExp $ */1 /* $Id: win32wnd.h,v 1.22 1999-08-16 15:53:04 dengert Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 5 5 * 6 6 * Copyright 1998-1999 Sander van Leeuwen (sandervl@xs4all.nl) 7 * Copyright 1999 Daniela Engert (dani@ngrt.de) 7 8 * 8 9 * … … 22 23 class Win32Window; 23 24 24 #define OFFSET_WIN32WNDPTR 25 #define OFFSET_WIN32PM_MAGIC 26 27 #define WIN32PM_MAGIC 28 #define CheckMagicDword(a) 25 #define OFFSET_WIN32WNDPTR 0 26 #define OFFSET_WIN32PM_MAGIC 4 27 28 #define WIN32PM_MAGIC 0x12345678 29 #define CheckMagicDword(a) (a==WIN32PM_MAGIC) 29 30 30 31 typedef struct { 31 USHORTcb;32 33 ULONG win32CreateStruct;//or dialog create dword32 USHORT cb; 33 Win32Window *win32wnd; 34 ULONG win32CreateStruct; //or dialog create dword 34 35 } CUSTOMWNDDATA; 35 36 36 37 typedef struct 37 38 { 38 ULONGMsg;39 ULONGwParam;40 ULONGlParam;39 ULONG Msg; 40 ULONG wParam; 41 ULONG lParam; 41 42 } POSTMSG_PACKET; 42 43 43 #define WM_WIN32_POSTMESSAGEA 44 #define WM_WIN32_POSTMESSAGEW 45 46 #define MAX_WINDOW_NAMELENGTH 44 #define WM_WIN32_POSTMESSAGEA 0x4000 45 #define WM_WIN32_POSTMESSAGEW 0x4001 46 47 #define MAX_WINDOW_NAMELENGTH 256 47 48 48 49 class Win32Window : private GenericObject, private ChildWindow 49 50 { 50 51 public: 51 DWORDmagic;52 53 54 52 DWORD magic; 53 54 Win32Window(DWORD objType); 55 Win32Window(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode); 55 56 virtual ~Win32Window(); 56 57 57 58 virtual ULONG MsgCreate(HWND hwndOS2, ULONG initParam); 58 59 59 ULONG MsgQuit(); 60 ULONG MsgClose(); 60 61 ULONG MsgDestroy(); 61 62 63 64 65 62 ULONG MsgEnable(BOOL fEnable); 63 ULONG MsgShow(BOOL fShow); 64 ULONG MsgMove(ULONG x, ULONG y); 65 ULONG MsgHitTest(ULONG x, ULONG y); 66 ULONG MsgSize(ULONG width, ULONG height, BOOL fMinimize, BOOL fMaximize); 66 67 ULONG MsgActivate(BOOL fActivate, HWND hwnd); 67 68 69 70 71 72 ULONG MsgButton(ULONG msg, ULONG x, ULONGy);73 74 75 76 77 78 79 80 virtual 81 virtual 82 virtual 83 virtual 84 85 DWORD getStyle(){ return dwStyle; };86 DWORD getExStyle(){ return dwExStyle; };87 HWND getWindowHandle(){ return Win32Hwnd; };88 HWND getOS2WindowHandle(){ return OS2Hwnd; };89 HWND getOS2FrameWindowHandle(){ return OS2HwndFrame; };90 91 Win32Window *getParent() 92 68 ULONG MsgSetFocus(HWND hwnd); 69 ULONG MsgKillFocus(HWND hwnd); 70 ULONG MsgCommand(ULONG cmd, ULONG Id, HWND hwnd); 71 ULONG MsgSysCommand(ULONG win32sc, ULONG x, ULONG y); 72 ULONG MsgChar(ULONG cmd, ULONG repeatcnt, ULONG scancode, ULONG vkey, ULONG keyflags); 73 ULONG MsgButton(ULONG msg, ULONG ncx, ULONG ncy, ULONG clx, ULONG cly); 74 ULONG MsgMouseMove(ULONG keystate, ULONG x, ULONG y); 75 ULONG MsgPaint(ULONG tmp1, ULONG tmp2); 76 ULONG MsgEraseBackGround(ULONG hps); 77 ULONG MsgSetText(LPSTR lpsz, LONG cch); 78 ULONG MsgGetTextLength(); 79 char *MsgGetText(); 80 81 virtual LONG SetWindowLongA(int index, ULONG value); 82 virtual ULONG GetWindowLongA(int index); 83 virtual WORD SetWindowWord(int index, WORD value); 84 virtual WORD GetWindowWord(int index); 85 86 DWORD getStyle() { return dwStyle; }; 87 DWORD getExStyle() { return dwExStyle; }; 88 HWND getWindowHandle() { return Win32Hwnd; }; 89 HWND getOS2WindowHandle() { return OS2Hwnd; }; 90 HWND getOS2FrameWindowHandle() { return OS2HwndFrame; }; 91 BOOL isFrameWindow() { return OS2Hwnd != OS2HwndFrame; }; 92 Win32Window *getParent() { return (Win32Window *)ChildWindow::GetParent(); }; 93 void setParent(Win32Window *pwindow) { ChildWindow::SetParent((ChildWindow *)pwindow); }; 93 94 WNDPROC getWindowProc() { return win32wndproc; }; 94 95 void setWindowProc(WNDPROC newproc) { win32wndproc = newproc; }; 95 96 DWORD getWindowId() { return windowId; }; 96 97 void setWindowId(DWORD id) { windowId = id; }; 97 ULONG getWindowHeight(){ return rectClient.bottom - rectClient.top; };98 99 PRECT getClientRect(){ return &rectClient; };100 PRECT getWindowRect(){ return &rectWindow; };101 102 DWORD getFlags(){ return flags; };103 void setFlags(DWORD newflags){ flags = newflags; };104 105 106 107 108 HMENU GetMenu() 109 110 111 BOOLSetIcon(HICON hIcon);112 113 114 115 116 117 118 119 120 121 122 123 98 ULONG getWindowHeight() { return rectClient.bottom - rectClient.top; }; 99 BOOL isChild(); 100 PRECT getClientRect() { return &rectClient; }; 101 PRECT getWindowRect() { return &rectWindow; }; 102 103 DWORD getFlags() { return flags; }; 104 void setFlags(DWORD newflags) { flags = newflags; }; 105 106 HACCEL GetAccelTable() { return (HACCEL) acceltableResource; }; 107 BOOL SetAccelTable(ULONG hAccel); 108 109 HMENU GetMenu() { return (HMENU) menuResource; }; 110 BOOL SetMenu(ULONG hMenu); 111 112 BOOL SetIcon(HICON hIcon); 113 HICON GetIcon() { return (HICON) iconResource; }; 114 115 BOOL ShowWindow(ULONG nCmdShow); 116 BOOL SetWindowPos(HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags); 117 BOOL DestroyWindow(); 118 HWND SetActiveWindow(); 119 HWND GetParent(); 120 HWND SetParent(HWND hwndNewParent); 121 BOOL IsChild(HWND hwndParent); 122 HWND GetTopWindow(); 123 BOOL UpdateWindow(); 124 BOOL IsIconic(); 124 125 HWND GetWindow(UINT uCmd); 125 126 126 BOOL EnableWindow(BOOL fEnable); 127 BOOL CloseWindow(); 127 128 static HWND GetActiveWindow(); 128 129 130 131 132 133 134 135 136 129 BOOL IsWindow(); 130 BOOL IsWindowEnabled(); 131 BOOL IsWindowVisible(); 132 BOOL IsUnicode() { return isUnicode; }; 133 134 BOOL GetWindowRect(PRECT pRect); 135 int GetWindowTextLengthA(); 136 int GetWindowTextA(LPSTR lpsz, int cch); 137 BOOL SetWindowTextA(LPCSTR lpsz); 137 138 138 139 LRESULT SendMessageA(ULONG msg, WPARAM wParam, LPARAM lParam); … … 152 153 153 154 if(window) { 154 155 return window->getOS2WindowHandle(); 155 156 } 156 else return hwnd;//OS/2 window handle157 else return hwnd; //OS/2 window handle 157 158 } 158 159 … … 162 163 163 164 if(window) { 164 165 return window->getWindowHandle(); 165 166 } 166 else return hwnd;//OS/2 window handle167 else return hwnd; //OS/2 window handle 167 168 } 168 169 … … 173 174 LRESULT SendInternalMessageA(ULONG msg, WPARAM wParam, LPARAM lParam); 174 175 LRESULT SendInternalMessageW(ULONG msg, WPARAM wParam, LPARAM lParam); 175 176 177 HWNDOS2Hwnd;178 HWNDOS2HwndFrame;179 180 HWNDWin32Hwnd;181 182 183 intposx, posy, width, height;184 185 186 ULONG dwExStyle;//GWL_EXSTYLE187 ULONG dwStyle;//GWL_STYLE188 WNDPROC win32wndproc; 189 ULONG hInstance;//GWL_HINSTANCE176 void Init(); 177 178 HWND OS2Hwnd; 179 HWND OS2HwndFrame; 180 HWND OS2HwndMenu; 181 HWND Win32Hwnd; 182 BOOL isUnicode; 183 184 int posx, posy, width, height; 185 186 // values normally contained in the standard window words 187 ULONG dwExStyle; //GWL_EXSTYLE 188 ULONG dwStyle; //GWL_STYLE 189 WNDPROC win32wndproc; //GWL_WNDPROC 190 ULONG hInstance; //GWL_HINSTANCE 190 191 //Moved in ChildWindow class 191 ///// Win32Window *parent; 192 ULONG windowId;//GWL_ID193 ULONG userData;//GWL_USERDATA192 ///// Win32Window *parent; //GWL_HWNDPARENT 193 ULONG windowId; //GWL_ID 194 ULONG userData; //GWL_USERDATA 194 195 195 196 HWND hwndLinkAfter; 196 197 DWORD flags; 197 DWORD lastHitTestVal;//Last value returned by WM_NCHITTEST handler198 199 200 201 202 203 Win32Window *owner; 198 DWORD lastHitTestVal; //Last value returned by WM_NCHITTEST handler 199 200 BOOL isIcon; 201 BOOL fCreated; 202 BOOL fFirstShow; 203 204 Win32Window *owner; 204 205 205 206 Win32Resource *acceltableResource; … … 207 208 Win32Resource *iconResource; 208 209 209 210 211 212 213 214 ULONGnrUserWindowLong;215 216 217 210 char windowNameA[MAX_WINDOW_NAMELENGTH]; 211 WCHAR windowNameW[MAX_WINDOW_NAMELENGTH]; 212 ULONG wndNameLength; 213 214 ULONG *userWindowLong; 215 ULONG nrUserWindowLong; 216 217 RECT rectWindow; 218 RECT rectClient; 218 219 219 220 Win32WndClass *windowClass; … … 223 224 private: 224 225 #ifndef OS2_INCLUDED 225 226 227 228 229 226 BOOL CreateWindowExA(CREATESTRUCTA *lpCreateStruct, ATOM classAtom); 227 228 void GetMinMaxInfo(POINT *maxSize, POINT *maxPos, POINT *minTrack, POINT *maxTrack ); 229 230 LONG SendNCCalcSize(BOOL calcValidRect, 230 231 RECT *newWindowRect, RECT *oldWindowRect, 231 232 RECT *oldClientRect, WINDOWPOS *winpos, … … 234 235 LRESULT SendInternalMessage(ULONG msg, WPARAM wParam, LPARAM lParam) 235 236 { 236 237 238 elsereturn SendInternalMessageA(msg, wParam, lParam);237 if(isUnicode) 238 return SendInternalMessageW(msg, wParam, lParam); 239 else return SendInternalMessageA(msg, wParam, lParam); 239 240 } 240 241 #endif … … 242 243 243 244 244 #define BUTTON_LEFTDOWN 245 #define BUTTON_LEFTUP 246 #define BUTTON_LEFTDBLCLICK 247 #define BUTTON_RIGHTUP 248 #define BUTTON_RIGHTDOWN 249 #define BUTTON_RIGHTDBLCLICK 250 #define BUTTON_MIDDLEUP 251 #define BUTTON_MIDDLEDOWN 252 #define BUTTON_MIDDLEDBLCLICK 253 254 #define WMMOVE_LBUTTON 255 #define WMMOVE_MBUTTON 256 #define WMMOVE_RBUTTON 257 #define WMMOVE_CTRL 258 #define WMMOVE_SHIFT 259 260 261 #define CMD_MENU 262 #define CMD_CONTROL 263 #define CMD_ACCELERATOR 245 #define BUTTON_LEFTDOWN 0 246 #define BUTTON_LEFTUP 1 247 #define BUTTON_LEFTDBLCLICK 2 248 #define BUTTON_RIGHTUP 3 249 #define BUTTON_RIGHTDOWN 4 250 #define BUTTON_RIGHTDBLCLICK 5 251 #define BUTTON_MIDDLEUP 6 252 #define BUTTON_MIDDLEDOWN 7 253 #define BUTTON_MIDDLEDBLCLICK 8 254 255 #define WMMOVE_LBUTTON 1 256 #define WMMOVE_MBUTTON 2 257 #define WMMOVE_RBUTTON 4 258 #define WMMOVE_CTRL 8 259 #define WMMOVE_SHIFT 16 260 261 262 #define CMD_MENU 1 263 #define CMD_CONTROL 2 264 #define CMD_ACCELERATOR 3 264 265 265 266 #define WIN32SC_SIZE 0xf000 … … 280 281 #define WIN32SC_HOTKEY 0xf150 281 282 282 #define KEY_ALTDOWN 283 #define KEY_PREVDOWN 284 #define KEY_UP 285 #define KEY_DEADKEY 283 #define KEY_ALTDOWN 1 284 #define KEY_PREVDOWN 2 285 #define KEY_UP 4 286 #define KEY_DEADKEY 8 286 287 287 288 #endif //__cplusplus
Note:
See TracChangeset
for help on using the changeset viewer.