Changeset 2228 for trunk/src/user32/oslibgdi.cpp
- Timestamp:
- Dec 28, 1999, 6:04:24 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/oslibgdi.cpp
r2221 r2228 1 /* $Id: oslibgdi.cpp,v 1. 5 1999-12-27 22:53:52cbratschi Exp $ */1 /* $Id: oslibgdi.cpp,v 1.6 1999-12-28 17:04:23 cbratschi Exp $ */ 2 2 /* 3 3 * Window GDI wrapper functions for OS/2 … … 19 19 #include <oslibgdi.h> 20 20 #include <oslibwin.h> 21 #include "win32wbase.h" 21 22 22 23 //CB: new mapping infrastructure to avoid transformation bugs -> available soon 23 24 24 25 /* 25 All functionscan be used to transform from Win32 to OS/2 and vice versa26 All mapScreen/Window can be used to transform from Win32 to OS/2 and vice versa 26 27 First letter is lower case to avoid conflicts with Win32 API names 27 28 28 29 Single y mapping: 29 30 mapScreenY() 30 mapWindowY() 31 mapClientY() 32 mapChildY() 31 33 32 34 Single point mapping: 33 35 mapScreenPoint() 34 mapWindowPoint() 36 mapClientPoint() 37 mapChildPoint() 35 38 36 39 Single rect mapping: 37 40 mapScreenRect() 38 map WindowRect()41 mapClientRect() 39 42 40 43 Rect transformation: … … 43 46 */ 44 47 45 INT mapScreenY(INT y) 46 { 47 return WinQuerySysValue(HWND_DESKTOP,SV_CYSCREEN)-1-y; 48 } 49 //****************************************************************************** 50 //****************************************************************************** 51 INT mapScreenY(INT screenH,INT y) 52 { 53 return screenH-1-y; 54 } 55 48 INT mapScreenY(INT screenPosY) 49 { 50 return WinQuerySysValue(HWND_DESKTOP,SV_CYSCREEN)-1-screenPosY; 51 } 52 //****************************************************************************** 53 //****************************************************************************** 54 INT mapScreenY(INT screenH,INT screenPosY) 55 { 56 return screenH-1-screenPosY; 57 } 58 //****************************************************************************** 59 //****************************************************************************** 60 INT mapClientY(INT clientH,INT clientPosY) 61 { 62 return clientH-1-clientPosY; 63 } 64 //****************************************************************************** 65 //****************************************************************************** 66 INT mapClientY(HWND os2Client,INT clientPosY) 67 { 68 RECTL rect; 69 70 if (os2Client == OSLIB_HWND_DESKTOP) os2Client = HWND_DESKTOP; //client shouldn't be desktop 71 if (!WinQueryWindowRect(os2Client,&rect)) return 0; 72 return rect.yTop-1-clientPosY; 73 } 74 //****************************************************************************** 75 //****************************************************************************** 76 INT mapClientY(Win32BaseWindow *win32wnd,INT clientPosY) 77 { 78 return win32wnd->getWindowHeight()-1-clientPosY; 79 } 80 //****************************************************************************** 81 //****************************************************************************** 82 INT mapChildY(INT parentH,INT childY,INT childPosY) 83 { 84 return parentH-1-childY-childPosY; 85 } 86 //****************************************************************************** 87 //****************************************************************************** 88 INT mapChildY(HWND os2Parent,INT childY,INT childPosY) 89 { 90 RECTL rect; 91 92 if (os2Parent == OSLIB_HWND_DESKTOP) os2Parent = HWND_DESKTOP; 93 if (!WinQueryWindowRect(os2Parent,&rect)) return 0; 94 return rect.yTop-1-childY-childPosY; 95 } 96 //****************************************************************************** 97 //****************************************************************************** 98 INT mapChildY(HWND os2Parent,HWND os2Child,INT childPosY) 99 { 100 RECTL rect; 101 SWP swp; 102 103 if (os2Parent == OSLIB_HWND_DESKTOP) os2Parent = HWND_DESKTOP; 104 if (!WinQueryWindowRect(os2Parent,&rect)) return 0; 105 if (!WinQueryWindowPos(os2Child,&swp)) return 0; 106 return rect.yTop-1-swp.y-childPosY; 107 } 108 //****************************************************************************** 109 //****************************************************************************** 110 BOOL mapScreenPoint(OSLIBPOINT *screenPt) 111 { 112 if(!screenPt) return FALSE; 113 screenPt->y = WinQuerySysValue(HWND_DESKTOP,SV_CYSCREEN)-1-screenPt->y; 114 return TRUE; 115 } 116 //****************************************************************************** 117 //****************************************************************************** 118 INT mapScreenY(INT screenH,OSLIBPOINT *screenPt) 119 { 120 if (!screenPt) return FALSE; 121 screenPt->y = screenH-1-screenPt->y; 122 return TRUE; 123 } 124 125 //old mapping functions 56 126 57 127 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.