source: trunk/src/user32/oslibwin.h@ 5685

Last change on this file since 5685 was 5685, checked in by sandervl, 24 years ago

client/frame rewrite

File size: 11.1 KB
Line 
1/* $Id: oslibwin.h,v 1.54 2001-05-11 08:39:43 sandervl Exp $ */
2/*
3 * Window API wrappers for OS/2
4 *
5 *
6 * Copyright 1999 Sander van Leeuwen (sandervl@xs4all.nl)
7 * Copyright 1999 Daniela Engert (dani@ngrt.de)
8 *
9 *
10 * Project Odin Software License can be found in LICENSE.TXT
11 *
12 */
13#ifndef __OSLIBWIN_H__
14#define __OSLIBWIN_H__
15#include <oslibgdi.h>
16
17#ifndef WIN_INCLUDED
18typedef struct _SWP /* swp */
19{
20 ULONG fl;
21 LONG cy;
22 LONG cx;
23 LONG y;
24 LONG x;
25 HWND hwndInsertBehind;
26 HWND hwnd;
27 ULONG ulReserved1;
28 ULONG ulReserved2;
29} SWP, *PSWP;
30#endif
31
32//SvL: Must be the same as HWND_DESKTOP/OBJECT in pmwin.h!
33#define OSLIB_HWND_DESKTOP 1
34#define OSLIB_HWND_OBJECT 2
35
36BOOL OSLibWinSetParent(HWND hwnd, HWND hwndParent, ULONG fRedraw = TRUE);
37BOOL OSLibWinSetOwner(HWND hwnd, HWND hwndOwner);
38
39
40HWND OSLibWinCreateWindow(HWND hwndParent,ULONG dwWinStyle,
41 char *pszName, HWND Owner, ULONG fBottom,
42 ULONG id, BOOL fTaskList,BOOL fShellPosition,
43 int classStyle, HWND *hwndFrame);
44
45BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle);
46void OSLibSetWindowStyle(HWND hwndFrame, HWND hwndClient, ULONG dwStyle, ULONG dwExStyle);
47DWORD OSLibQueryWindowStyle(HWND hwnd);
48
49#define OSLIB_QWL_USER -4
50
51BOOL OSLibWinSetWindowULong(HWND hwnd, ULONG offset, ULONG value);
52ULONG OSLibWinGetWindowULong(HWND hwnd, ULONG offset);
53BOOL OSLibSetWindowID(HWND hwnd, ULONG value);
54
55#define WAOS_WARNING 0
56#define WAOS_NOTE 1
57#define WAOS_ERROR 2
58#define WAOS_CWINALARMS 13 /* count of valid alarms 53304*/
59
60BOOL OSLibWinAlarm(HWND hwndDeskTop,ULONG flStyle);
61ULONG OSLibDosBeep(ULONG freg,ULONG dur);
62HWND OSLibWinQueryFocus(HWND hwndDeskTop);
63
64#define OSLIB_FID_SYSMENU 0x8002
65#define OSLIB_FID_TITLEBAR 0x8003
66#define OSLIB_FID_MINMAX 0x8004
67#define OSLIB_FID_MENU 0x8005
68#define OSLIB_FID_VERTSCROLL 0x8006
69#define OSLIB_FID_HORZSCROLL 0x8007
70#define OSLIB_FID_CLIENT 0x8008
71
72HWND OSLibWinWindowFromID(HWND hwndParent,ULONG id);
73BOOL OSLibWinSetFocus(HWND hwndDeskTop,HWND hwndNewFocus, BOOL activate);
74ULONG OSLibGetWindowHeight(HWND hwnd); //for point transformation
75
76extern ULONG ScreenHeight, ScreenWidth;
77inline ULONG OSLibQueryScreenHeight(void) { return (ScreenHeight); }
78inline ULONG OSLibQueryScreenWidth(void) { return (ScreenWidth); }
79
80//reserved deleted
81
82#define SVOS_SWAPBUTTON 0
83#define SVOS_DBLCLKTIME 1
84#define SVOS_CXDBLCLK 2
85#define SVOS_CYDBLCLK 3
86#define SVOS_CXSIZEBORDER 4
87#define SVOS_CYSIZEBORDER 5
88#define SVOS_ALARM 6
89#define SVOS_CURSORRATE 9
90#define SVOS_FIRSTSCROLLRATE 10
91#define SVOS_SCROLLRATE 11
92#define SVOS_NUMBEREDLISTS 12
93#define SVOS_WARNINGFREQ 13
94#define SVOS_NOTEFREQ 14
95#define SVOS_ERRORFREQ 15
96#define SVOS_WARNINGDURATION 16
97#define SVOS_NOTEDURATION 17
98#define SVOS_ERRORDURATION 18
99#define SVOS_CXSCREEN 20
100#define SVOS_CYSCREEN 21
101#define SVOS_CXVSCROLL 22
102#define SVOS_CYHSCROLL 23
103#define SVOS_CYVSCROLLARROW 24
104#define SVOS_CXHSCROLLARROW 25
105#define SVOS_CXBORDER 26
106#define SVOS_CYBORDER 27
107#define SVOS_CXDLGFRAME 28
108#define SVOS_CYDLGFRAME 29
109#define SVOS_CYTITLEBAR 30
110#define SVOS_CYVSLIDER 31
111#define SVOS_CXHSLIDER 32
112#define SVOS_CXMINMAXBUTTON 33
113#define SVOS_CYMINMAXBUTTON 34
114#define SVOS_CYMENU 35
115#define SVOS_CXFULLSCREEN 36
116#define SVOS_CYFULLSCREEN 37
117#define SVOS_CXICON 38
118#define SVOS_CYICON 39
119#define SVOS_CXPOINTER 40
120#define SVOS_CYPOINTER 41
121#define SVOS_DEBUG 42
122#define SVOS_CMOUSEBUTTONS 43
123#define SVOS_CPOINTERBUTTONS 43
124#define SVOS_POINTERLEVEL 44
125#define SVOS_CURSORLEVEL 45
126#define SVOS_TRACKRECTLEVEL 46
127#define SVOS_CTIMERS 47
128#define SVOS_MOUSEPRESENT 48
129#define SVOS_CXBYTEALIGN 49
130#define SVOS_CXALIGN 49
131#define SVOS_CYBYTEALIGN 50
132#define SVOS_CYALIGN 50
133
134/* The following value enables any greater value to be set by WinSetSysValue. */
135/* This is to enable the setting of SV_EXTRAKEYBEEP by applications. */
136
137#define SVOS_NOTRESERVED 56
138#define SVOS_EXTRAKEYBEEP 57
139
140/* The following system value controls whether PM controls the keyboard */
141/* lights for light key keystrokes (else applications will) */
142#define SVOS_SETLIGHTS 58
143#define SVOS_INSERTMODE 59
144
145#define SVOS_MENUROLLDOWNDELAY 64
146#define SVOS_MENUROLLUPDELAY 65
147#define SVOS_ALTMNEMONIC 66
148#define SVOS_TASKLISTMOUSEACCESS 67
149#define SVOS_CXICONTEXTWIDTH 68
150#define SVOS_CICONTEXTLINES 69
151#define SVOS_CHORDTIME 70
152#define SVOS_CXCHORD 71
153#define SVOS_CYCHORD 72
154#define SVOS_CXMOTIONSTART 73
155#define SVOS_CYMOTIONSTART 74
156#define SVOS_BEGINDRAG 75
157#define SVOS_ENDDRAG 76
158#define SVOS_SINGLESELECT 77
159#define SVOS_OPEN 78
160#define SVOS_CONTEXTMENU 79
161#define SVOS_CONTEXTHELP 80
162#define SVOS_TEXTEDIT 81
163#define SVOS_BEGINSELECT 82
164#define SVOS_ENDSELECT 83
165#define SVOS_BEGINDRAGKB 84
166#define SVOS_ENDDRAGKB 85
167#define SVOS_SELECTKB 86
168#define SVOS_OPENKB 87
169#define SVOS_CONTEXTMENUKB 88
170#define SVOS_CONTEXTHELPKB 89
171#define SVOS_TEXTEDITKB 90
172#define SVOS_BEGINSELECTKB 91
173#define SVOS_ENDSELECTKB 92
174#define SVOS_ANIMATION 93
175#define SVOS_ANIMATIONSPEED 94
176#define SVOS_MONOICONS 95
177#define SVOS_KBDALTERED 96
178#define SVOS_PRINTSCREEN 97
179#define SVOS_LOCKSTARTINPUT 98
180#define SVOS_CSYSVALUES 108
181
182LONG OSLibWinQuerySysValue(LONG iSysValue);
183ULONG OSLibWinQueryDlgItemText(HWND hwndDlg,ULONG idItem,LONG cchBufferMax,char* pchBuffer);
184BOOL OSLibWinSetDlgItemText(HWND hwndDlg,ULONG idItem,char* pszText);
185BOOL OSLibWinQueryPointerPos(PPOINT pptlPoint); //pptlPoint == POINTL pointer!
186BOOL OSLibWinSetPointerPos(int x, int y);
187
188#define SWPOS_SIZE 0x0001
189#define SWPOS_MOVE 0x0002
190#define SWPOS_ZORDER 0x0004
191#define SWPOS_SHOW 0x0008
192#define SWPOS_HIDE 0x0010
193#define SWPOS_NOREDRAW 0x0020
194#define SWPOS_NOADJUST 0x0040
195#define SWPOS_ACTIVATE 0x0080
196#define SWPOS_DEACTIVATE 0x0100
197#define SWPOS_EXTSTATECHANGE 0x0200
198#define SWPOS_MINIMIZE 0x0400
199#define SWPOS_MAXIMIZE 0x0800
200#define SWPOS_RESTORE 0x1000
201#define SWPOS_FOCUSACTIVATE 0x2000
202#define SWPOS_FOCUSDEACTIVATE 0x4000
203#define SWPOS_NOAUTOCLOSE 0x8000 /* Valid in PROGDETAILS struct only */
204
205#define HWNDOS_TOP (HWND)3
206#define HWNDOS_BOTTOM (HWND)4
207
208BOOL OSLibWinSetMultWindowPos(struct _SWP *pswp, ULONG num);
209BOOL OSLibWinShowWindow(HWND hwnd, ULONG fl);
210
211BOOL OSLibWinDestroyWindow(HWND hwnd);
212
213BOOL OSLibWinIsIconic(HWND hwnd);
214BOOL OSLibWinIsChild (HWND hwnd, HWND hwndOf);
215BOOL OSLibWinSetActiveWindow(HWND hwnd);
216BOOL OSLibWinSetFocus(HWND hwnd);
217BOOL OSLibWinEnableWindow(HWND hwnd, BOOL fEnable);
218BOOL OSLibWinIsWindowEnabled(HWND hwnd);
219BOOL OSLibWinIsWindowVisible(HWND hwnd);
220HWND OSLibWinQueryActiveWindow();
221
222
223#define RELATIVE_TO_WINDOW 0
224#define RELATIVE_TO_SCREEN 1
225BOOL OSLibWinQueryWindowRect(Win32BaseWindow *window, PRECT pRect, int RelativeTo = RELATIVE_TO_WINDOW);
226BOOL OSLibWinCalcFrameRect(HWND hwnd, RECT *pRect, BOOL fClient);
227BOOL OSLibGetMinMaxInfo(HWND hwndFrame, MINMAXINFO *pMinMax);
228
229#define QWOS_NEXT 0
230#define QWOS_PREV 1
231#define QWOS_TOP 2
232#define QWOS_BOTTOM 3
233#define QWOS_OWNER 4
234#define QWOS_PARENT 5
235#define QWOS_NEXTTOP 6
236#define QWOS_PREVTOP 7
237#define QWOS_FRAMEOWNER 8
238
239HWND OSLibWinQueryWindow(HWND hwnd, ULONG lCode);
240
241LONG OSLibWinQueryWindowTextLength(HWND hwnd);
242LONG OSLibWinQueryWindowText(HWND hwnd, LONG length, LPSTR lpsz);
243BOOL OSLibWinSetWindowText(HWND hwnd, LPSTR lpsz);
244BOOL OSLibWinFlashWindow(HWND hwnd, BOOL fFlash);
245HWND OSLibWinWindowFromPoint(HWND hwnd, PVOID ppoint);
246BOOL OSLibWinMinimizeWindow(HWND hwnd);
247
248BOOL OSLibWinGetBorderSize(HWND hwnd, OSLIBPOINT *pointl);
249BOOL OSLibWinSetIcon(HWND hwnd, HANDLE hIcon);
250
251BOOL OSLibWinQueryWindowPos (HWND hwnd, PSWP pswp);
252void OSLibMapSWPtoWINDOWPOS(PSWP pswp, PWINDOWPOS pwpos, PSWP pswpOld,
253 int parentHeight, HWND hwnd);
254void OSLibMapWINDOWPOStoSWP(struct tagWINDOWPOS *pwpos, PSWP pswp, PSWP pswpOld,
255 int parentHeight, HWND hFrame);
256
257void OSLibWinSetClientPos(HWND hwnd, int x, int y, int cx, int cy, int parentHeight);
258
259HWND OSLibWinBeginEnumWindows(HWND hwnd);
260HWND OSLibWinGetNextWindow(HWND hwndEnum);
261HWND OSLibWinQueryClientWindow(HWND hwndFrame);
262BOOL OSLibWinEndEnumWindows(HWND hwndEnum);
263BOOL OSLibWinQueryWindowProcess(HWND hwnd, ULONG *pid, ULONG *tid);
264BOOL OSLibWinMapWindowPoints (HWND hwndFrom, HWND hwndTo, OSLIBPOINT *pptl, ULONG num);
265
266HWND OSLibWinObjectWindowFromID(HWND hwndOwner, ULONG ID);
267
268HWND OSLibWinQueryObjectWindow(VOID);
269
270PVOID OSLibWinSubclassWindow(HWND hwnd,PVOID newWndProc);
271
272BOOL OSLibSetWindowRestoreRect(HWND hwnd, PRECT pRect);
273BOOL OSLibSetWindowMinPos(HWND hwnd, ULONG x, ULONG y);
274
275BOOL OSLibWinGetKeyboardStateTable(unsigned char * PMKeyState);
276BOOL OSLibWinSetKeyboardStateTable(unsigned char * PMKeyState);
277
278#define HTOS_NORMAL 0
279#define HTOS_TRANSPARENT (-1)
280#define HTOS_DISCARD (-2)
281#define HTOS_ERROR (-3)
282
283BOOL OSLibWinEnableWindowUpdate(HWND hwnd,BOOL fEnable);
284ULONG OSLibWinGetLastError();
285
286void OSLibWinShowTaskList(HWND hwndFrame);
287
288void OSLibWinSetVisibleRegionNotify(HWND hwnd, BOOL fNotify);
289
290HWND OSLibWinQueryCapture();
291BOOL OSLibWinSetCapture(HWND hwnd);
292
293BOOL OSLibWinRemoveFromTasklist(HANDLE hTaskList);
294HANDLE OSLibWinAddToTaskList(HWND hwndFrame, char *title, BOOL fVisible);
295BOOL OSLibWinChangeTaskList(HANDLE hTaskList, HWND hwndFrame, char *title, BOOL fVisible);
296
297inline ULONG GetScreenHeight()
298{
299 return ScreenHeight;
300}
301
302inline ULONG GetScreenWidth()
303{
304 return ScreenWidth;
305}
306
307ULONG OSLibGetScreenHeight();
308ULONG OSLibGetScreenWidth();
309
310BOOL OSLibWinLockWindowUpdate(HWND hwnd);
311BOOL OSLibWinGetMaxPosition(HWND hwndOS2, RECT *rect);
312
313BOOL OSLibWinShowPointer(BOOL fShow);
314
315#endif //__OSLIBWIN_H__
Note: See TracBrowser for help on using the repository browser.