- Timestamp:
- Jun 10, 2001, 2:05:41 PM (24 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/gen_object.cpp
r5950 r5951 1 /* $Id: gen_object.cpp,v 1. 9 2001-06-10 09:19:57sandervl Exp $ */1 /* $Id: gen_object.cpp,v 1.10 2001-06-10 12:05:38 sandervl Exp $ */ 2 2 /* 3 3 * Generic Object Class for OS/2 … … 91 91 LONG GenericObject::addRef() 92 92 { 93 dprintf(("addRef %x -> refcount %x", this, refCount));93 //// dprintf(("addRef %x -> refcount %x", this, refCount)); 94 94 return InterlockedIncrement(&refCount); 95 95 } … … 99 99 LONG GenericObject::release() 100 100 { 101 dprintf(("release %x -> refcount %x", this, refCount));101 //// dprintf(("release %x -> refcount %x", this, refCount)); 102 102 #ifdef DEBUG 103 103 if(refCount-1 < 0) { -
trunk/src/user32/oslibwin.cpp
r5935 r5951 1 /* $Id: oslibwin.cpp,v 1.9 6 2001-06-09 14:50:19sandervl Exp $ */1 /* $Id: oslibwin.cpp,v 1.97 2001-06-10 12:05:38 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 52 52 //****************************************************************************** 53 53 //****************************************************************************** 54 HWND OSLibWinCreateWindow(HWND hwndParent,ULONG dwWinStyle, 54 HWND OSLibWinCreateWindow(HWND hwndParent,ULONG dwWinStyle, ULONG dwOSFrameStyle, 55 55 char *pszName, HWND Owner, ULONG fHWND_BOTTOM, 56 56 ULONG id, BOOL fTaskList,BOOL fShellPosition, … … 93 93 pszName, (dwWinStyle & ~WS_CLIPCHILDREN), 0, 0, 0, 0, 94 94 Owner, (fHWND_BOTTOM) ? HWND_BOTTOM : HWND_TOP, 95 id, NULL, NULL); 95 id, (PVOID)&FCData, NULL); 96 if(fOS2Look && *hwndFrame) { 97 FCData.flCreateFlags = dwOSFrameStyle; 98 WinCreateFrameControls(*hwndFrame, &FCData, NULL); 99 } 96 100 hwndClient = WinCreateWindow (*hwndFrame, WIN32_STDCLASS, 97 101 NULL, dwWinStyle | WS_VISIBLE, 0, 0, 0, 0, 98 102 *hwndFrame, HWND_TOP, FID_CLIENT, NULL, NULL); 103 99 104 return hwndClient; 100 105 } … … 102 107 //Note: Also check OSLibSetWindowStyle when changing this!! 103 108 //****************************************************************************** 104 BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle )109 BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle, ULONG *OSFrameStyle) 105 110 { 106 111 *OSWinStyle = 0; 112 *OSFrameStyle = 0; 107 113 108 114 /* Window styles */ 109 #if 0110 //Done explicitely in CreateWindowExA111 if(dwStyle & WS_MINIMIZE_W)112 *OSWinStyle |= WS_MINIMIZED;113 if(dwStyle & WS_VISIBLE_W)114 *OSWinStyle |= WS_VISIBLE;115 #endif116 115 if(dwStyle & WS_DISABLED_W) 117 116 *OSWinStyle |= WS_DISABLED; … … 120 119 if(dwStyle & WS_CLIPCHILDREN_W) 121 120 *OSWinStyle |= WS_CLIPCHILDREN; 122 #if 0 123 if(dwStyle & WS_MAXIMIZE_W) 124 *OSWinStyle |= WS_MAXIMIZED; 125 if(dwStyle & WS_GROUP_W) 126 *OSWinStyle |= WS_GROUP; 127 if(dwStyle & WS_TABSTOP_W) 128 *OSWinStyle |= WS_TABSTOP; 129 #endif 130 121 122 if(fOS2Look) { 123 if((dwStyle & WS_CAPTION_W) == WS_CAPTION_W) { 124 *OSFrameStyle = FCF_TITLEBAR; 125 if(dwStyle & WS_SYSMENU_W) 126 { 127 *OSFrameStyle |= FCF_SYSMENU; 128 } 129 if((dwStyle & WS_MINIMIZEBOX_W) || (dwStyle & WS_MAXIMIZEBOX_W)) { 130 *OSFrameStyle |= FCF_MINMAX; 131 } 132 } 133 } 131 134 return TRUE; 135 } 136 //****************************************************************************** 137 //****************************************************************************** 138 BOOL OSLibWinPositionFrameControls(HWND hwndFrame, RECTLOS2 *pRect) 139 { 140 SWP swp[3]; 141 HWND hwndControl; 142 int i = 0; 143 static int minmaxwidth = 0; 144 145 if(minmaxwidth == 0) { 146 minmaxwidth = WinQuerySysValue(HWND_DESKTOP, SV_CXMINMAXBUTTON); 147 } 148 149 hwndControl = WinWindowFromID(hwndFrame, FID_SYSMENU); 150 if(hwndControl) { 151 swp[i].hwnd = hwndControl; 152 swp[i].hwndInsertBehind = HWND_TOP; 153 swp[i].x = pRect->xLeft; 154 swp[i].y = pRect->yBottom; 155 swp[i].cx = minmaxwidth/2; 156 swp[i].cy = pRect->yTop - pRect->yBottom; 157 swp[i].fl = SWP_SIZE | SWP_MOVE | SWP_SHOW; 158 pRect->xLeft += swp[i].cx; 159 i++; 160 } 161 hwndControl = WinWindowFromID(hwndFrame, FID_TITLEBAR); 162 if(hwndControl) { 163 swp[i].hwnd = hwndControl; 164 swp[i].hwndInsertBehind = HWND_TOP; 165 swp[i].x = pRect->xLeft; 166 swp[i].y = pRect->yBottom; 167 swp[i].cx = pRect->xRight - pRect->xLeft; 168 if(WinWindowFromID(hwndFrame, FID_MINMAX)) { 169 swp[i].cx -= minmaxwidth - minmaxwidth/2; 170 } 171 swp[i].cy = pRect->yTop - pRect->yBottom; 172 swp[i].fl = SWP_SIZE | SWP_MOVE | SWP_SHOW; 173 pRect->xLeft += swp[i].cx; 174 i++; 175 } 176 hwndControl = WinWindowFromID(hwndFrame, FID_MINMAX); 177 if(hwndControl) { 178 swp[i].hwnd = hwndControl; 179 swp[i].hwndInsertBehind = HWND_TOP; 180 swp[i].x = pRect->xLeft; 181 swp[i].y = pRect->yBottom; 182 swp[i].cx = minmaxwidth + minmaxwidth/2; 183 swp[i].cy = pRect->yTop - pRect->yBottom; 184 swp[i].fl = SWP_SIZE | SWP_MOVE | SWP_SHOW; 185 pRect->xLeft += swp[i].cx; 186 i++; 187 } 188 return WinSetMultWindowPos(GetThreadHAB(), swp, i); 132 189 } 133 190 //****************************************************************************** … … 360 417 { 361 418 return WinSetWindowText(hwnd, lpsz); 419 } 420 //****************************************************************************** 421 //****************************************************************************** 422 BOOL OSLibWinSetTitleBarText(HWND hwnd, LPSTR lpsz) 423 { 424 return WinSetWindowText(WinWindowFromID(hwnd, FID_TITLEBAR), lpsz); 362 425 } 363 426 //****************************************************************************** … … 759 822 760 823 if(dwWinStyle != dwOldWinStyle) { 761 WinSetWindowULong(hwndClient, QWL_STYLE, dwWinStyle);824 WinSetWindowULong(hwndClient, QWL_STYLE, dwWinStyle); 762 825 } 763 826 … … 781 844 782 845 if(dwWinStyle != dwOldWinStyle) { 783 WinSetWindowULong(hwndFrame, QWL_STYLE, dwWinStyle);846 WinSetWindowULong(hwndFrame, QWL_STYLE, dwWinStyle); 784 847 } 785 848 } -
trunk/src/user32/oslibwin.h
r5721 r5951 1 /* $Id: oslibwin.h,v 1.5 5 2001-05-16 07:42:26sandervl Exp $ */1 /* $Id: oslibwin.h,v 1.56 2001-06-10 12:05:39 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 38 38 39 39 40 HWND OSLibWinCreateWindow(HWND hwndParent,ULONG dwWinStyle, 40 HWND OSLibWinCreateWindow(HWND hwndParent,ULONG dwWinStyle, ULONG dwOSFrameStyle, 41 41 char *pszName, HWND Owner, ULONG fBottom, 42 42 ULONG id, BOOL fTaskList,BOOL fShellPosition, 43 43 int classStyle, HWND *hwndFrame); 44 44 45 BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle );45 BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle, ULONG *OSFrameStyle); 46 46 void OSLibSetWindowStyle(HWND hwndFrame, HWND hwndClient, ULONG dwStyle, ULONG dwExStyle); 47 47 DWORD OSLibQueryWindowStyle(HWND hwnd); 48 49 BOOL OSLibWinPositionFrameControls(HWND hwndFrame, RECTLOS2 *pRect); 48 50 49 51 #define OSLIB_QWL_USER -4 … … 242 244 LONG OSLibWinQueryWindowText(HWND hwnd, LONG length, LPSTR lpsz); 243 245 BOOL OSLibWinSetWindowText(HWND hwnd, LPSTR lpsz); 246 BOOL OSLibWinSetTitleBarText(HWND hwnd, LPSTR lpsz); 244 247 BOOL OSLibWinFlashWindow(HWND hwnd, BOOL fFlash); 245 248 HWND OSLibWinWindowFromPoint(HWND hwnd, PVOID ppoint); -
trunk/src/user32/pmwindow.cpp
r5935 r5951 1 /* $Id: pmwindow.cpp,v 1.13 3 2001-06-09 14:50:19 sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.134 2001-06-10 12:05:39 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 41 41 #include "timer.h" 42 42 #include <codepage.h> 43 #include "syscolor.h" 44 #include "options.h" 45 43 46 44 47 #define DBG_LOCALLOG DBG_pmwindow … … 55 58 ULONG ScreenHeight = 0; 56 59 ULONG ScreenBitsPerPel = 0; 60 BOOL fOS2Look = FALSE; 57 61 58 62 static PFNWP pfnFrameWndProc = NULL; … … 144 148 DevQueryCaps(hdc, CAPS_COLOR_BITCOUNT, 1, (PLONG)&ScreenBitsPerPel); 145 149 DevCloseDC(hdc); 150 151 fOS2Look = PROFILE_GetOdinIniBool(ODINSYSTEM_SECTION, "OS2Look", FALSE); 152 if(fOS2Look) { 153 SYSCOLOR_Init(FALSE); //use OS/2 colors 154 } 146 155 147 156 dprintf(("InitPM: Desktop (%d,%d) bpp %d", ScreenWidth, ScreenHeight, ScreenBitsPerPel)); … … 807 816 { 808 817 WinSendMsg(hwnd, WM_ACTIVATE, (MPARAM)TRUE, (MPARAM)hwnd); 818 if(fOS2Look) { 819 WinSendDlgItemMsg(hwnd, FID_TITLEBAR, TBM_SETHILITE, MPFROMSHORT(TRUE), 0); 820 } 809 821 } 810 822 } … … 816 828 { 817 829 WinSendMsg(hwnd, WM_ACTIVATE, (MPARAM)FALSE, (MPARAM)hwnd); 830 if(fOS2Look) { 831 WinSendDlgItemMsg(hwnd, FID_TITLEBAR, TBM_SETHILITE, MPFROMSHORT(FALSE), 0); 832 } 818 833 } 819 834 } … … 958 973 { 959 974 WinSendMsg(hwnd, WM_ACTIVATE, (MPARAM)TRUE, (MPARAM)hwnd); 975 if(fOS2Look) { 976 WinSendDlgItemMsg(hwnd, FID_TITLEBAR, TBM_SETHILITE, MPFROMSHORT(TRUE), 0); 977 } 960 978 } 961 979 } … … 967 985 { 968 986 WinSendMsg(hwnd, WM_ACTIVATE, (MPARAM)FALSE, (MPARAM)hwnd); 987 if(fOS2Look) { 988 WinSendDlgItemMsg(hwnd, FID_TITLEBAR, TBM_SETHILITE, MPFROMSHORT(FALSE), 0); 989 } 969 990 } 970 991 } … … 1113 1134 { 1114 1135 WinSendMsg(WinWindowFromID(hwnd,FID_CLIENT),WM_ACTIVATE,mp1,mp2); 1136 if(fOS2Look) { 1137 WinSendDlgItemMsg(hwnd, FID_TITLEBAR, TBM_SETHILITE, mp1, 0); 1138 } 1115 1139 WinSetWindowUShort(hwnd,QWS_FLAGS,mp1 ? (flags | FF_ACTIVE):(flags & ~FF_ACTIVE)); 1116 1140 … … 1237 1261 dprintf(("PMFRAME:WM_UPDATEFRAME %x", win32wnd->getWindowHandle())); 1238 1262 goto RunDefFrameWndProc; 1263 1264 case WM_TRACKFRAME: 1265 if(fOS2Look) {//sent by titlebar control 1266 FrameTrackFrame(win32wnd, TF_MOVE); 1267 } 1268 rc = 0; 1269 break; 1239 1270 1240 1271 default: -
trunk/src/user32/pmwindow.h
r5935 r5951 1 /* $Id: pmwindow.h,v 1.1 0 2001-06-09 14:50:19 sandervl Exp $ */1 /* $Id: pmwindow.h,v 1.11 2001-06-10 12:05:39 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 22 22 extern ULONG ScreenHeight; 23 23 extern ULONG ScreenBitsPerPel; 24 extern BOOL fOS2Look; 24 25 25 26 #define TFOS_LEFT 0x0001 -
trunk/src/user32/syscolor.cpp
r5406 r5951 1 /* $Id: syscolor.cpp,v 1.2 6 2001-03-30 22:08:19 sandervl Exp $ */1 /* $Id: syscolor.cpp,v 1.27 2001-06-10 12:05:39 sandervl Exp $ */ 2 2 3 3 /* … … 175 175 //****************************************************************************** 176 176 //****************************************************************************** 177 void SYSCOLOR_Init( void)177 void SYSCOLOR_Init(int fOverride) 178 178 { 179 179 INT x; 180 180 181 USEWINCOLORS = PROFILE_GetOdinIniBool(ODINCOLORS,"UseWinColors",TRUE); 181 if(fOverride == -1) { 182 USEWINCOLORS = PROFILE_GetOdinIniBool(ODINCOLORS,"UseWinColors",TRUE); 183 } 184 else USEWINCOLORS = fOverride; 182 185 183 186 SYSCOLOR_Load(); -
trunk/src/user32/syscolor.h
r4674 r5951 1 /* $Id: syscolor.h,v 1.1 3 2000-11-22 13:44:50 sandervl Exp $ */1 /* $Id: syscolor.h,v 1.14 2001-06-10 12:05:40 sandervl Exp $ */ 2 2 3 3 /* … … 15 15 HBRUSH WIN32API OS2GetSysColorBrush(int nIndex); 16 16 17 extern void SYSCOLOR_Init( void);17 extern void SYSCOLOR_Init(int fOverride = -1); 18 18 extern void SYSCOLOR_Save(void); 19 19 -
trunk/src/user32/user32.cpp
r5751 r5951 1 /* $Id: user32.cpp,v 1.9 8 2001-05-19 11:16:01sandervl Exp $ */1 /* $Id: user32.cpp,v 1.99 2001-06-10 12:05:40 sandervl Exp $ */ 2 2 3 3 /* … … 425 425 426 426 case SM_CYCAPTION: 427 rc = 19; 428 //rc = OSLibWinQuerySysValue(SVOS_CYTITLEBAR); 427 if(fOS2Look) { 428 rc = OSLibWinQuerySysValue(SVOS_CYTITLEBAR); 429 } 430 else rc = 19; 429 431 break; 430 432 … … 442 444 case SM_CXMENUSIZE: 443 445 case SM_CYMENUSIZE: 444 rc = 19; 446 if(fOS2Look) { 447 rc = OSLibWinQuerySysValue(SVOS_CYMENU); 448 } 449 else rc = 19; 445 450 break; 446 451 -
trunk/src/user32/win32wbase.cpp
r5950 r5951 1 /* $Id: win32wbase.cpp,v 1.26 1 2001-06-10 09:19:58sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.262 2001-06-10 12:05:40 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 469 469 teb->o.odin.newWindow = (ULONG)this; 470 470 471 DWORD dwOSWinStyle ;472 473 OSLibWinConvertStyle(dwStyle,dwExStyle,&dwOSWinStyle );471 DWORD dwOSWinStyle, dwOSFrameStyle; 472 473 OSLibWinConvertStyle(dwStyle,dwExStyle,&dwOSWinStyle, &dwOSFrameStyle); 474 474 475 475 OS2Hwnd = OSLibWinCreateWindow((getParent()) ? getParent()->getOS2WindowHandle() : OSLIB_HWND_DESKTOP, 476 dwOSWinStyle, (char *)windowNameA,476 dwOSWinStyle, dwOSFrameStyle, (char *)windowNameA, 477 477 (owner) ? owner->getOS2WindowHandle() : ((getParent()) ? getParent()->getOS2WindowHandle() : OSLIB_HWND_DESKTOP), 478 478 (hwndLinkAfter == HWND_BOTTOM) ? TRUE : FALSE, … … 582 582 windowNameA[0] = 0; 583 583 } 584 } 585 if(fOS2Look) { 586 OSLibWinSetTitleBarText(OS2HwndFrame, windowNameA); 584 587 } 585 588 } … … 1202 1205 } 1203 1206 #endif 1207 if(fOS2Look && ((dwStyle & WS_CAPTION) == WS_CAPTION)) 1208 { 1209 RECT rect = {0}; 1210 int height = getWindowHeight(); 1211 RECTLOS2 rectOS2; 1212 1213 AdjustRectOuter(&rect, FALSE); 1214 1215 rect.left = -rect.left; 1216 rect.top = rect.bottom - rect.top; 1217 rect.right = rectWindow.right - rectWindow.left - rect.right; 1218 1219 rectOS2.xLeft = rect.left; 1220 rectOS2.xRight = rect.right; 1221 rectOS2.yBottom = height - rect.top; 1222 rectOS2.yTop = height - rect.bottom; 1223 OSLibWinPositionFrameControls(getOS2FrameWindowHandle(), &rectOS2); 1224 } 1204 1225 return rc; 1205 1226 } … … 1423 1444 if(hTaskList) { 1424 1445 OSLibWinChangeTaskList(hTaskList, OS2HwndFrame, getWindowNameA(), (getStyle() & WS_VISIBLE) ? 1 : 0); 1446 if(fOS2Look) { 1447 OSLibWinSetTitleBarText(OS2HwndFrame, getWindowNameA()); 1448 } 1425 1449 } 1426 1450 } … … 1913 1937 if(hTaskList) { 1914 1938 OSLibWinChangeTaskList(hTaskList, OS2HwndFrame, getWindowNameA(), (getStyle() & WS_VISIBLE) ? 1 : 0); 1939 if(fOS2Look) { 1940 OSLibWinSetTitleBarText(OS2HwndFrame, getWindowNameA()); 1941 } 1915 1942 } 1916 1943 } … … 2766 2793 } 2767 2794 else { 2795 if(newparent) RELEASE_WNDOBJ(newparent); 2796 2768 2797 setParent(windowDesktop); 2798 windowDesktop->addRef(); 2769 2799 windowDesktop->addChild(this); 2770 2800 OSLibWinSetParent(getOS2FrameWindowHandle(), OSLIB_HWND_DESKTOP); … … 3651 3681 if(HwGetWindowHandleData(hwnd, (DWORD *)&window) == TRUE) { 3652 3682 if(window) { 3653 dprintf(("addRef %x; refcount %d", hwnd, window->getRefCount()+1));3683 //// dprintf(("addRef %x; refcount %d", hwnd, window->getRefCount()+1)); 3654 3684 window->addRef(); 3655 3685 } -
trunk/src/user32/win32wbasenonclient.cpp
r5935 r5951 1 /* $Id: win32wbasenonclient.cpp,v 1.3 1 2001-06-09 14:50:22sandervl Exp $ */1 /* $Id: win32wbasenonclient.cpp,v 1.32 2001-06-10 12:05:41 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (non-client methods) … … 527 527 //Check context help 528 528 if (dwExStyle & WS_EX_CONTEXTHELP) 529 rect.right -= GetSystemMetrics(SM_CXSIZE) + 1;529 rect.right -= GetSystemMetrics(SM_CXSIZE) + 1; 530 530 if (pt.x > rect.right) return HTHELP; 531 531 … … 533 533 /* In win95 there is automatically a Maximize button when there is a minimize one*/ 534 534 if ((dwStyle & WS_MAXIMIZEBOX)|| (dwStyle & WS_MINIMIZEBOX)) 535 rect.right -= GetSystemMetrics(SM_CXSIZE) + 1;535 rect.right -= GetSystemMetrics(SM_CXSIZE) + 1; 536 536 if (pt.x > rect.right) return HTMAXBUTTON; 537 537 … … 539 539 /* In win95 there is automatically a Maximize button when there is a Maximize one*/ 540 540 if ((dwStyle & WS_MINIMIZEBOX)||(dwStyle & WS_MAXIMIZEBOX)) 541 rect.right -= GetSystemMetrics(SM_CXSIZE) + 1;541 rect.right -= GetSystemMetrics(SM_CXSIZE) + 1; 542 542 543 543 if (pt.x > rect.right) return HTMINBUTTON; … … 887 887 HDC memDC; 888 888 HBITMAP memBmp,oldBmp; 889 890 if(fOS2Look) return; 889 891 890 892 memDC = CreateCompatibleDC(hdc);
Note:
See TracChangeset
for help on using the changeset viewer.