- Timestamp:
- Jul 24, 1999, 4:01:45 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/makefile
r384 r385 1 # $Id: makefile,v 1.1 7 1999-07-24 12:40:20 cbratschiExp $1 # $Id: makefile,v 1.18 1999-07-24 14:01:44 sandervl Exp $ 2 2 3 3 # … … 83 83 84 84 msgbox.obj: msgbox.cpp 85 window.obj: window.cpp win32class.h win32wnd.h win32wndchild.h 85 window.obj: window.cpp win32class.h win32wnd.h win32wndchild.h oslibwin.h 86 86 windowmsg.obj: windowmsg.cpp win32class.h win32wnd.h win32wndchild.h 87 87 windlg.obj: windlg.cpp win32wnd.h win32dlg.h -
trunk/src/user32/new/oslibgdi.cpp
r342 r385 1 /* $Id: oslibgdi.cpp,v 1. 4 1999-07-20 07:42:35sandervl Exp $ */1 /* $Id: oslibgdi.cpp,v 1.5 1999-07-24 14:01:44 sandervl Exp $ */ 2 2 /* 3 3 * Window GDI wrapper functions for OS/2 … … 49 49 hwndParent = HWND_DESKTOP; 50 50 } 51 if(WinMapWindowPoints(hwndChild, hwndParent, (POINTL *)point, 1) != 0) {51 if(WinMapWindowPoints(hwndChild, hwndParent, (POINTL *)point, 1) != TRUE) { 52 52 dprintf(("MapOS2ToWin32Point:WinMapWindowPoint %x %x returned false", hwndParent, hwndChild)); 53 53 return FALSE; … … 55 55 WinQueryWindowRect(hwndParent, (PRECTL)&rectParent); 56 56 point->y = rectParent.yTop - point->y - 1; 57 return TRUE; 58 } 59 //****************************************************************************** 60 // MapOS2ToWin32Rect 61 // Map os/2 rectangle to screen coordinates and convert to win32 rect 62 // 63 // Parameters: 64 // hwndParent: Parent window handle 65 // hwndChild: Child window handle 66 // rectOS2: OS/2 child window RECTL 67 // rectWin32: Win32 Child window RECT (IN) 68 // 69 // Returns: 70 // TRUE: Success 71 // FALSE: Failures 72 //****************************************************************************** 73 BOOL MapOS2ToWin32Rectl(HWND hwndParent, HWND hwndChild, PRECTLOS2 rectOS2, PRECT rectWin32) 74 { 75 RECTLOS2 rectParent = {0}; 76 77 if(hwndParent == OSLIB_HWND_DESKTOP) { 78 hwndParent = HWND_DESKTOP; 79 } 80 if(WinMapWindowPoints(hwndChild, hwndParent, (PPOINTL)rectOS2, 2) != TRUE) { 81 dprintf(("MapOS2ToWin32Rect:WinMapWindowPoint %x %x returned false", hwndParent, hwndChild)); 82 return FALSE; 83 } 84 85 ULONG length = rectOS2->yTop - rectOS2->yBottom; 86 87 rectWin32->bottom = length - rectOS2->yBottom; 88 rectWin32->top = length - rectOS2->yTop; 89 rectWin32->left = rectOS2->xLeft; 90 rectWin32->right = rectOS2->xRight; 91 57 92 return TRUE; 58 93 } … … 134 169 //****************************************************************************** 135 170 //****************************************************************************** 171 BOOL OSLibWinInvalidateRect(HWND hwnd, PRECT pRect, BOOL fIncludeChildren) 172 { 173 RECTLOS2 rectl; 174 175 MapWin32ToOS2Rectl(pRect, &rectl); 176 return WinInvalidateRect(hwnd, (PRECTL)&rectl, fIncludeChildren); 177 } 178 //****************************************************************************** 179 //Returns rectangle in Win32 window coordinates 180 //****************************************************************************** 181 BOOL OSLibWinQueryUpdateRect(HWND hwnd, PRECT pRect) 182 { 183 BOOL rc; 184 RECTLOS2 rectl; 185 186 rc = WinQueryUpdateRect(hwnd, (PRECTL)&rectl); 187 if(rc) { 188 MapOS2ToWin32Rectl(&rectl, pRect); 189 } 190 else memset(pRect, 0, sizeof(RECT)); 191 return rc; 192 } 193 //****************************************************************************** 194 //****************************************************************************** 195 -
trunk/src/user32/new/oslibgdi.h
r342 r385 1 /* $Id: oslibgdi.h,v 1. 3 1999-07-20 07:42:35sandervl Exp $ */1 /* $Id: oslibgdi.h,v 1.4 1999-07-24 14:01:44 sandervl Exp $ */ 2 2 /* 3 3 * Window GDI wrapper functions for OS/2 … … 38 38 BOOL OSLibWinReleasePS(HDC hdc); 39 39 40 BOOL OSLibWinInvalidateRect(HWND hwnd, PRECT pRect, BOOL fIncludeChildren); //must be RECTL pointer! 41 BOOL OSLibWinQueryUpdateRect(HWND hwnd, PRECT pRect); 42 40 43 //****************************************************************************** 41 44 //Map win32 y coordinate (in window coordinates) to OS/2 y coord. (in window coordinates) … … 49 52 BOOL MapOS2ToWin32Point(HWND hwndParent, HWND hwndChild, OSLIBPOINT *point); 50 53 54 //map os/2 rectangle to screen coordinates and convert to win32 rect 55 BOOL MapOS2ToWin32Rectl(HWND hwndParent, HWND hwndChild, PRECTLOS2 rectOS2, PRECT rectWin32); 56 51 57 BOOL MapOS2ToWin32Rectl(PRECTLOS2 rectOS2, PRECT rectWin32); 52 58 BOOL MapWin32ToOS2Rectl(PRECT rectWin32, PRECTLOS2 rectOS2); -
trunk/src/user32/new/oslibwin.cpp
r345 r385 1 /* $Id: oslibwin.cpp,v 1.1 8 1999-07-20 15:46:53sandervl Exp $ */1 /* $Id: oslibwin.cpp,v 1.19 1999-07-24 14:01:44 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 183 183 //****************************************************************************** 184 184 //****************************************************************************** 185 BOOL OSLibWinInvalidateRect(HWND hwnd,POSRECTL pwrc,BOOL fIncludeChildren)186 {187 return WinInvalidateRect(hwnd,(PRECTL)pwrc,fIncludeChildren);188 }189 //******************************************************************************190 //******************************************************************************191 185 LONG OSLibWinQuerySysValue(HWND hwndDeskTop,LONG iSysValue) 192 186 { … … 260 254 } 261 255 //****************************************************************************** 262 //Returns rectangle in Win32 window coordinates 263 //****************************************************************************** 264 BOOL OSLibWinQueryUpdateRect(HWND hwnd, PVOID pRect) 265 { 266 BOOL rc; 256 //****************************************************************************** 257 BOOL OSLibWinQueryWindowRect(HWND hwnd, PRECT pRect, int RelativeTo) 258 { 259 BOOL rc; 267 260 RECTLOS2 rectl; 268 261 269 rc = WinQuery UpdateRect(hwnd, (PRECTL)&rectl);262 rc = WinQueryWindowRect(hwnd, (PRECTL)&rectl); 270 263 if(rc) { 271 MapOS2ToWin32Rectl(&rectl, (PRECT)pRect); 264 if(RelativeTo == RELATIVE_TO_SCREEN) { 265 MapOS2ToWin32Rectl(OSLIB_HWND_DESKTOP, hwnd, &rectl, pRect); 266 } 267 else MapOS2ToWin32Rectl(&rectl, pRect); 272 268 } 273 269 else memset(pRect, 0, sizeof(RECT)); -
trunk/src/user32/new/oslibwin.h
r345 r385 1 /* $Id: oslibwin.h,v 1.1 6 1999-07-20 15:46:53sandervl Exp $ */1 /* $Id: oslibwin.h,v 1.17 1999-07-24 14:01:44 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 38 38 BOOL OSLibWinSetFocus(HWND hwndDeskTop,HWND hwndNewFocus); 39 39 ULONG OSLibGetWindowHeight(HWND hwnd); //for point transformation 40 41 typedef struct _OSRECTL42 {43 LONG xLeft;44 LONG yBottom;45 LONG xRight;46 LONG yTop;47 } OSRECTL;48 49 typedef OSRECTL *POSRECTL;50 51 BOOL OSLibWinInvalidateRect(HWND hwnd,POSRECTL pwrc,BOOL fIncludeChildren); //must be RECTL pointer!52 40 53 41 //reserved deleted … … 182 170 183 171 BOOL OSLibWinDestroyWindow(HWND hwnd); 184 BOOL OSLibWinQueryUpdateRect(HWND hwnd, PVOID pRect); 172 185 173 BOOL OSLibWinIsIconic(HWND hwnd); 186 174 BOOL OSLibWinSetActiveWindow(HWND hwnd); … … 190 178 BOOL OSLibWinIsWindowVisible(HWND hwnd); 191 179 BOOL OSLibWinQueryActiveWindow(); 180 181 182 #define RELATIVE_TO_WINDOW 0 183 #define RELATIVE_TO_SCREEN 1 184 BOOL OSLibWinQueryWindowRect(HWND hwnd, PRECT pRect, int RelativeTo = RELATIVE_TO_WINDOW); 192 185 193 186 #define QWOS_NEXT 0 -
trunk/src/user32/new/user32.cpp
r330 r385 1 /* $Id: user32.cpp,v 1. 8 1999-07-18 17:12:02sandervl Exp $ */1 /* $Id: user32.cpp,v 1.9 1999-07-24 14:01:44 sandervl Exp $ */ 2 2 3 3 /* … … 79 79 //Coordinate transformation 80 80 81 inline void Win32ToOS2Rect(POSRECTL dest,PRECT source,ULONG windowH)82 {83 dest->xLeft = source->left;84 dest->xRight = source->right;85 dest->yTop = windowH-source->top;86 dest->yBottom = windowH-source->bottom;87 }88 89 inline void OS2ToWin32Rect(PRECT dest,POSRECTL source,ULONG windowH)90 {91 dest->left = source->xLeft;92 dest->right = source->xRight;93 dest->top = windowH-source->yTop;94 dest->bottom = windowH-source->yBottom;95 }96 97 81 inline void OS2ToWin32ScreenPos(POINT *dest,POINT *source) 98 82 { … … 279 263 280 264 return TRUE; 281 }282 //******************************************************************************283 //******************************************************************************284 BOOL WIN32API InvalidateRect(HWND hWnd, const RECT *lpRect, BOOL bErase)285 {286 #ifdef DEBUG287 if(lpRect)288 WriteLog("USER32: InvalidateRect for window %X (%d,%d)(%d,%d) %d\n", hWnd, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom, bErase);289 else WriteLog("USER32: InvalidateRect for window %X NULL, %d\n", hWnd, bErase);290 #endif291 292 //CB: bErase no quite the same293 hWnd = Win32Window::Win32ToOS2Handle(hWnd);294 if (lpRect)295 {296 OSRECTL rect;297 ULONG windowH;298 299 windowH = OSLibGetWindowHeight(hWnd);300 Win32ToOS2Rect(&rect,(PRECT)lpRect,windowH);301 return OSLibWinInvalidateRect(hWnd,&rect,bErase); //rect == RECTL302 } else return OSLibWinInvalidateRect(hWnd,NULL,bErase);303 265 } 304 266 //****************************************************************************** -
trunk/src/user32/new/win32wnd.cpp
r383 r385 1 /* $Id: win32wnd.cpp,v 1. 19 1999-07-24 12:39:53sandervl Exp $ */1 /* $Id: win32wnd.cpp,v 1.20 1999-07-24 14:01:45 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 708 708 return 0; //todo 709 709 } 710 return 0; 710 711 } 711 712 //****************************************************************************** … … 1409 1410 BOOL Win32Window::IsWindowEnabled() 1410 1411 { 1411 return OSLibWinIsWindowEnabled(OS2Hwnd);1412 return OSLibWinIsWindowEnabled(OS2Hwnd); 1412 1413 } 1413 1414 //****************************************************************************** … … 1415 1416 BOOL Win32Window::IsWindowVisible() 1416 1417 { 1417 return OSLibWinIsWindowVisible(OS2Hwnd);1418 return OSLibWinIsWindowVisible(OS2Hwnd); 1418 1419 } 1419 1420 //****************************************************************************** … … 1421 1422 BOOL Win32Window::GetWindowRect(PRECT pRect) 1422 1423 { 1423 // return OSLibWinIsWindowVisible(OS2Hwnd);1424 return OSLibWinQueryWindowRect(OS2Hwnd, pRect, RELATIVE_TO_SCREEN); 1424 1425 } 1425 1426 //****************************************************************************** … … 1427 1428 int Win32Window::GetWindowTextLengthA() 1428 1429 { 1429 return OSLibWinQueryWindowTextLength(OS2Hwnd);1430 return OSLibWinQueryWindowTextLength(OS2Hwnd); 1430 1431 } 1431 1432 //****************************************************************************** … … 1433 1434 int Win32Window::GetWindowTextA(LPSTR lpsz, int cch) 1434 1435 { 1435 return OSLibWinQueryWindowText(OS2Hwnd, cch, lpsz);1436 return OSLibWinQueryWindowText(OS2Hwnd, cch, lpsz); 1436 1437 } 1437 1438 //****************************************************************************** -
trunk/src/user32/new/window.cpp
r378 r385 1 /* $Id: window.cpp,v 1. 8 1999-07-23 19:09:25 cbratschiExp $ */1 /* $Id: window.cpp,v 1.9 1999-07-24 14:01:45 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 20 20 #include <win32wnd.h> 21 21 #include <oslibwin.h> 22 #include <oslibgdi.h> 22 23 #include "user32.h" 23 24 #include "icon.h" … … 588 589 //****************************************************************************** 589 590 //****************************************************************************** 590 BOOL WIN32API GetClientRect( HWND arg1, PRECT arg2) 591 { 592 #ifdef DEBUG 593 WriteLog("USER32: GetClientRect of %X\n", arg1); 594 #endif 595 arg1 = Win32Window::Win32ToOS2Handle(arg1); 596 return O32_GetClientRect(arg1, arg2); 591 BOOL WIN32API GetClientRect( HWND hwnd, PRECT pRect) 592 { 593 #ifdef DEBUG 594 WriteLog("USER32: GetClientRect of %X\n", hwnd); 595 #endif 596 hwnd = Win32Window::Win32ToOS2Handle(hwnd); 597 return OSLibWinQueryWindowRect(hwnd, pRect); 598 // return O32_GetClientRect(hwnd, arg2); 597 599 } 598 600 //****************************************************************************** … … 860 862 if (!lpRect) return FALSE; 861 863 862 return OSLibWinQueryUpdateRect(Win32Window::Win32ToOS2Handle(hwnd), (PVOID)&lpRect); 864 return OSLibWinQueryUpdateRect(Win32Window::Win32ToOS2Handle(hwnd), lpRect); 865 } 866 //****************************************************************************** 867 //****************************************************************************** 868 BOOL WIN32API InvalidateRect(HWND hWnd, const RECT *lpRect, BOOL bErase) 869 { 870 #ifdef DEBUG 871 if(lpRect) 872 WriteLog("USER32: InvalidateRect for window %X (%d,%d)(%d,%d) %d\n", hWnd, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom, bErase); 873 else WriteLog("USER32: InvalidateRect for window %X NULL, %d\n", hWnd, bErase); 874 #endif 875 876 //CB: bErase no quite the same 877 hWnd = Win32Window::Win32ToOS2Handle(hWnd); 878 if (lpRect) 879 { 880 return OSLibWinInvalidateRect(hWnd, (PRECT)lpRect, bErase); 881 } 882 else return OSLibWinInvalidateRect(hWnd,NULL,bErase); 863 883 } 864 884 //****************************************************************************** -
trunk/src/user32/new/wingdi.cpp
r378 r385 1 /* $Id: wingdi.cpp,v 1. 5 1999-07-23 19:09:26 cbratschiExp $ */1 /* $Id: wingdi.cpp,v 1.6 1999-07-24 14:01:45 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window graphics apis for OS/2 … … 17 17 #include <oslibgdi.h> 18 18 19 #define OPEN32_GDI 20 19 21 //****************************************************************************** 20 22 //TODO: Not complete … … 23 25 { 24 26 Win32Window *window; 27 HDC hdc; 25 28 26 29 window = Win32Window::GetWindowFromHandle(hwnd); … … 29 32 return 0; 30 33 } 31 dprintf(("BeginPaint %X\n", hwnd)); 32 returnO32_BeginPaint(window->getOS2WindowHandle(),lps);34 #ifdef OPEN32_GDI 35 hdc = O32_BeginPaint(window->getOS2WindowHandle(),lps); 33 36 //CB: conflict with Open32 mechanism 34 //lps->hdc = OSLibWinBeginPaint(window->getOS2WindowHandle(), &lps->rcPaint); 37 #else 38 hdc = OSLibWinBeginPaint(window->getOS2WindowHandle(), &lps->rcPaint); 39 lps->hdc = hdc; 40 #endif 41 dprintf(("BeginPaint %X returned %x\n", hwnd, hdc)); 42 return hdc; 35 43 36 return lps->hdc;44 // return lps->hdc; 37 45 } 38 46 //****************************************************************************** … … 41 49 { 42 50 dprintf(("EndPaint %x\n", hwnd)); 51 #ifdef OPEN32_GDI 43 52 return O32_EndPaint(hwnd,lps); 44 53 //CB: dito 45 //return OSLibWinEndPaint(lps->hdc); 54 #else 55 return OSLibWinEndPaint(lps->hdc); 56 #endif 46 57 } 47 58 //****************************************************************************** … … 58 69 } 59 70 dprintf(("GetDC %x", hwnd)); 71 #ifdef OPEN32_GDI 60 72 return O32_GetDC(window->getOS2WindowHandle()); 61 //return OSLibWinGetPS(window->getOS2WindowHandle()); 73 #else 74 return OSLibWinGetPS(window->getOS2WindowHandle()); 75 #endif 62 76 } 63 77 //****************************************************************************** … … 75 89 int WIN32API ReleaseDC(HWND hwnd, HDC hdc) 76 90 { 91 #ifdef OPEN32_GDI 77 92 return O32_ReleaseDC(hwnd,hdc); 78 //return OSLibWinReleasePS(hdc); 93 #else 94 return OSLibWinReleasePS(hdc); 95 #endif 79 96 } 80 97 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.