- Timestamp:
- Aug 28, 1999, 7:24:45 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/pmwindow.cpp
r715 r728 1 /* $Id: pmwindow.cpp,v 1.2 2 1999-08-27 17:50:56dengert Exp $ */1 /* $Id: pmwindow.cpp,v 1.23 1999-08-28 17:24:45 dengert Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 212 212 ULONG parentHeight = 0; 213 213 HWND hParent = NULLHANDLE, hFrame = NULLHANDLE; 214 LONG yDelta = pswp->cy - pswpo->cy; 215 ULONG classStyle; 214 216 215 217 dprintf(("OS2: WM_WINDOWPOSCHANGED %x %x (%d,%d) (%d,%d)", hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); … … 234 236 wp.hwndInsertAfter = wndAfter->getWindowHandle(); 235 237 } 238 classStyle = win32wnd->getClass()->getStyle(); 239 // if (yDelta != 0) 240 if ((yDelta != 0) && ((classStyle & CS_VREDRAW_W) || 241 ((classStyle & CS_HREDRAW_W) && (pswp->cx != pswpo->cx)))) 242 { 243 HENUM henum = WinBeginEnumWindows(pswp->hwnd); 244 SWP swp[10]; 245 int i = 0; 246 HWND hwnd; 247 248 dprintf(("move children")); 249 while ((hwnd = WinGetNextWindow(henum)) != NULLHANDLE) 250 { 251 #if 0 252 /* Do not move MDI clients. MDI clients are a special case, 253 * even though they are bottom aligned they are always supposed 254 * to be the same size as their parent. This code is an 255 * optimization and will not work correctly if the this 256 * assumption is incorrect. 257 */ 258 WinBase *pBase = (WinBase *)WinQueryDAXData( hwnd ); 259 if ( pBase && pBase->typeOf() == mdiClient ) 260 { 261 continue; 262 } 263 #endif 264 // We don't know how many children we have so we'll move ten 265 // at a time. Not very nice, I know. 266 WinQueryWindowPos(hwnd, &(swp[i])); 267 268 // The SWP flags are all set but PM will ignore any 269 // superflous ones, so keep them as they contain useful 270 // minimise and maximise flags. 271 swp[i].y += yDelta; 272 273 if (i == 9) 274 { 275 WinSetMultWindowPos(GetThreadHAB(), swp, 10); 276 i = 0; 277 } 278 else 279 { 280 i++; 281 } 282 } 283 284 WinEndEnumWindows(henum); 285 286 // Any remaining windows? 287 if (i) 288 WinSetMultWindowPos(GetThreadHAB(), swp, i); 289 } 236 290 win32wnd->MsgPosChanged((LPARAM)&wp); 291 237 292 break; 238 293 } … … 240 295 case WM_ERASEBACKGROUND: 241 296 { 242 return (MRESULT) FALSE;297 break; 243 298 } 244 299 case WM_SIZE: 245 300 { 246 SWP swp;247 248 rc = WinQueryWindowPos(hwnd, &swp);249 if(rc == FALSE) {250 dprintf(("WM_SIZE: WinQueryWindowPos failed!"));251 break;252 }253 dprintf(("OS2: WM_SIZE %x %x (%d,%d) (%d,%d) (%d,%d)", hwnd, swp.fl, swp.x, swp.y, swp.cx, swp.cy, SHORT1FROMMP(mp2), SHORT2FROMMP(mp2)));254 #if 0255 if(win32wnd->MsgSize(SHORT1FROMMP(mp2), SHORT2FROMMP(mp2),256 (swp.fl & SWP_MINIMIZE) != 0,257 (swp.fl & SWP_MAXIMIZE) != 0))258 {259 goto RunDefWndProc;260 }261 #endif262 301 break; 263 302 } -
trunk/src/user32/new/win32class.cpp
r724 r728 1 /* $Id: win32class.cpp,v 1. 8 1999-08-28 14:09:30 sandervlExp $ */1 /* $Id: win32class.cpp,v 1.9 1999-08-28 17:24:45 dengert Exp $ */ 2 2 /* 3 3 * Win32 Window Class Managment Code for OS/2 … … 80 80 nrExtraClassWords = wndclass->cbClsExtra; 81 81 nrExtraWindowWords = wndclass->cbWndExtra; 82 backgroundBrush = wndclass->hbrBackground; //TODO: fErase of PAINSTRUCT in WM_PAINT if == NULL82 backgroundBrush = wndclass->hbrBackground; 83 83 hCursor = wndclass->hCursor; 84 84 hIcon = wndclass->hIcon; … … 137 137 138 138 if(wndclass == NULL) { 139 140 139 leaveMutex(OBJTYPE_CLASS); 140 return(NULL); 141 141 } 142 142 … … 144 144 //CB: read comment below! 145 145 if(stricmp(wndclass->classNameA, id) == 0 && wndclass->hInstance == hInstance) { 146 146 leaveMutex(OBJTYPE_CLASS); 147 147 return(wndclass); 148 148 } … … 151 151 while(wndclass != NULL) { 152 152 if(stricmp(wndclass->classNameA, id) == 0 && wndclass->hInstance == hInstance) { 153 153 leaveMutex(OBJTYPE_CLASS); 154 154 return(wndclass); 155 155 } … … 162 162 //CB: need more code to compare instance; convert 0 to exe module handle 163 163 if(wndclass->classAtom == (DWORD)id /*&& wndclass->hInstance == hInstance*/) { 164 164 leaveMutex(OBJTYPE_CLASS); 165 165 return(wndclass); 166 166 } … … 169 169 while(wndclass != NULL) { 170 170 if(wndclass->classAtom == (DWORD)id/* && wndclass->hInstance == hInstance*/) { 171 172 171 leaveMutex(OBJTYPE_CLASS); 172 return(wndclass); 173 173 } 174 174 wndclass = (Win32WndClass *)wndclass->GetNext(); -
trunk/src/user32/new/win32class.h
r724 r728 1 /* $Id: win32class.h,v 1. 5 1999-08-28 14:09:30 sandervlExp $ */1 /* $Id: win32class.h,v 1.6 1999-08-28 17:24:45 dengert Exp $ */ 2 2 /* 3 3 * Win32 Window Class Managment Code for OS/2 … … 15 15 { 16 16 public: 17 17 Win32WndClass(WNDCLASSEXA *wndclass, BOOL isUnicode = FALSE); 18 18 ~Win32WndClass(); 19 19 20 21 ULONG getClassLongW(int index)22 { 23 return getClassLongA(index, TRUE); 24 25 20 ULONG getClassLongA(int index, BOOL isUnicode = FALSE); 21 ULONG getClassLongW(int index) 22 { 23 return getClassLongA(index, TRUE); 24 }; 25 WORD getClassWord(int index); 26 26 27 28 ULONG setClassLongW(int index, LONG lNewVal)29 30 31 32 27 ULONG setClassLongA(int index, LONG lNewVal, BOOL isUnicode = FALSE); 28 ULONG setClassLongW(int index, LONG lNewVal) 29 { 30 return setClassLongA(index, lNewVal, TRUE); 31 } 32 WORD setClassWord(int index, WORD wNewVal); 33 33 34 ATOM getAtom() 35 36 34 ATOM getAtom() { return (ATOM) classAtom; }; 35 BOOL getClassInfo(WNDCLASSEXA *wndclass); 36 BOOL getClassInfo(WNDCLASSEXW *wndclass); 37 37 38 39 38 ULONG getClassName(LPSTR lpszClassName, ULONG cchClassName); 39 ULONG getClassName(LPWSTR lpszClassName, ULONG cchClassName); 40 40 41 WNDPROC getWindowProc() 42 LPSTR getMenuNameA(){ return menuNameA; };43 DWORD getExtraWndWords(){ return nrExtraWindowWords; };41 WNDPROC getWindowProc() { return windowProc; }; 42 LPSTR getMenuNameA() { return menuNameA; }; 43 DWORD getExtraWndWords() { return nrExtraWindowWords; }; 44 44 45 45 HICON getIcon() { return hIcon; }; 46 46 47 47 HBRUSH getBackgroundBrush() { return backgroundBrush; }; 48 ULONG getStyle() { return windowStyle; }; 48 49 49 50 void setMenuName(LPSTR newMenuName); 50 51 51 52 53 52 void IncreaseWindowCount() { cWindows++; }; 53 void DecreaseWindowCount() { cWindows--; }; 54 DWORD GetWindowCount() { return cWindows; }; 54 55 55 56 BOOL hasClassName(LPSTR classname, BOOL fUnicode = 0); 56 57 static void 57 58 static void UnregisterClassA(HINSTANCE hinst, LPSTR id); 58 59 59 60 static Win32WndClass *FindClass(HINSTANCE hinst, LPSTR id); … … 63 64 64 65 //Standard class words/longs 65 ULONG nrExtraClassWords;//GCL_CBCLSEXTRA66 ULONG nrExtraWindowWords;//GCL_CBWNDEXTRA67 HBRUSH backgroundBrush;//GCL_HBRBACKGROUND68 HCURSOR hCursor;//GCL_HCURSOR69 HICON hIcon;//GCL_HICON70 HINSTANCE hInstance;//GCL_HMODULE71 PCHAR menuNameA;//GCL_MENUNAME72 WCHAR *menuNameW; 73 ULONG windowStyle;//GCL_STYLE74 WNDPROC windowProc; 75 ULONG classAtom; 66 ULONG nrExtraClassWords; //GCL_CBCLSEXTRA 67 ULONG nrExtraWindowWords; //GCL_CBWNDEXTRA 68 HBRUSH backgroundBrush; //GCL_HBRBACKGROUND 69 HCURSOR hCursor; //GCL_HCURSOR 70 HICON hIcon; //GCL_HICON 71 HINSTANCE hInstance; //GCL_HMODULE 72 PCHAR menuNameA; //GCL_MENUNAME 73 WCHAR *menuNameW; //GCL_MENUNAME 74 ULONG windowStyle; //GCL_STYLE 75 WNDPROC windowProc; //GCL_WNDPROC 76 ULONG classAtom; //GCW_ATOM 76 77 77 78 PCHAR classNameA; 78 79 WCHAR *classNameW; 79 HICON 80 HICON hIconSm; 80 81 81 82 //User data class words/longs 82 ULONG 83 ULONG *userClassLong; 83 84 84 85 //nr of windows created with this class 85 86 ULONG cWindows; 86 87 87 88 static GenericObject *wndclasses; 88 89 }; -
trunk/src/user32/new/win32wnd.cpp
r724 r728 1 /* $Id: win32wnd.cpp,v 1.3 2 1999-08-28 14:09:30 sandervlExp $ */1 /* $Id: win32wnd.cpp,v 1.33 1999-08-28 17:24:45 dengert Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 972 972 ULONG Win32Window::MsgEraseBackGround(HDC hdc) 973 973 { 974 if(isIcon) { 975 return SendInternalMessageA(WM_ICONERASEBKGND, hdc, 0); 976 } 977 else return SendInternalMessageA(WM_ERASEBKGND, hdc, 0); 974 ULONG rc; 975 HDC hdcErase = hdc; 976 977 if (hdcErase == 0) 978 hdcErase = O32_GetDC(OS2Hwnd); 979 980 if(isIcon) 981 rc = SendInternalMessageA(WM_ICONERASEBKGND, hdcErase, 0); 982 else 983 rc = SendInternalMessageA(WM_ERASEBKGND, hdcErase, 0); 984 if (hdc == 0) 985 O32_ReleaseDC(OS2Hwnd, hdcErase); 986 return (rc); 978 987 } 979 988 //****************************************************************************** … … 1658 1667 if(OSLibWinQueryUpdateRect(OS2Hwnd, &rect)) 1659 1668 {//update region not empty 1660 SendInternalMessageA((isIcon) ? WM_PAINTICON : WM_PAINT, 0, 0); 1669 HDC hdc; 1670 1671 hdc = O32_GetDC(OS2Hwnd); 1672 if (isIcon) 1673 { 1674 SendInternalMessageA(WM_ICONERASEBKGND, (WPARAM)hdc, 0); 1675 SendInternalMessageA(WM_PAINTICON, 0, 0); 1676 } else 1677 { 1678 SendInternalMessageA(WM_ERASEBKGND, (WPARAM)hdc, 0); 1679 SendInternalMessageA(WM_PAINT, 0, 0); 1680 } 1681 O32_ReleaseDC(OS2Hwnd, hdc); 1661 1682 } 1662 1683 return TRUE;
Note:
See TracChangeset
for help on using the changeset viewer.