1 |
673 |
markom |
#ifndef _WINDOWS_H
|
2 |
|
|
#define _WINDOWS_H
|
3 |
|
|
/* windows.h*/
|
4 |
|
|
/*
|
5 |
|
|
* Copyright (c) 1999, 2000 Greg Haerr <greg@censoft.com>
|
6 |
|
|
*
|
7 |
|
|
* Microwindows Win32 API master public header file
|
8 |
|
|
*/
|
9 |
|
|
#ifdef __cplusplus
|
10 |
|
|
extern "C" {
|
11 |
|
|
#endif
|
12 |
|
|
|
13 |
|
|
#include "mwtypes.h"
|
14 |
|
|
#include "windef.h"
|
15 |
|
|
#include "wingdi.h"
|
16 |
|
|
#include "winfont.h"
|
17 |
|
|
#include "winkbd.h"
|
18 |
|
|
#include "winuser.h" /* now includes winctl.h for resource compiler*/
|
19 |
|
|
|
20 |
|
|
/* external routines*/
|
21 |
|
|
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
|
22 |
|
|
LPSTR lpCmdLine, int nShowCmd);
|
23 |
|
|
|
24 |
|
|
int MwUserInit(int ac, char **av);
|
25 |
|
|
|
26 |
|
|
/* Internal Microwindows non-win32 definitions*/
|
27 |
|
|
|
28 |
|
|
/* GDI Objects*/
|
29 |
|
|
|
30 |
|
|
typedef struct { /* GDI object hdr*/
|
31 |
|
|
int type; /* OBJ_xxx type*/
|
32 |
|
|
BOOL stockobj; /* TRUE if stock (unallocated) object*/
|
33 |
|
|
} MWGDIOBJHDR;
|
34 |
|
|
|
35 |
|
|
/* gdiobj*/
|
36 |
|
|
struct hgdiobj {
|
37 |
|
|
MWGDIOBJHDR hdr; /* all gdi object start with this hdr*/
|
38 |
|
|
/* additional data...*/ /* allocated per object type*/
|
39 |
|
|
};
|
40 |
|
|
|
41 |
|
|
typedef struct {
|
42 |
|
|
MWGDIOBJHDR hdr;
|
43 |
|
|
int style; /* pen style*/
|
44 |
|
|
COLORREF color; /* pen color*/
|
45 |
|
|
} MWPENOBJ;
|
46 |
|
|
|
47 |
|
|
typedef struct {
|
48 |
|
|
MWGDIOBJHDR hdr;
|
49 |
|
|
int style; /* brush style*/
|
50 |
|
|
COLORREF color; /* brush color*/
|
51 |
|
|
} MWBRUSHOBJ;
|
52 |
|
|
|
53 |
|
|
typedef struct {
|
54 |
|
|
MWGDIOBJHDR hdr;
|
55 |
|
|
PMWFONT pfont; /* allocated font*/
|
56 |
|
|
char name[32]; /* font name (stock objects only)*/
|
57 |
|
|
} MWFONTOBJ;
|
58 |
|
|
|
59 |
|
|
typedef struct {
|
60 |
|
|
MWGDIOBJHDR hdr;
|
61 |
|
|
int width; /* width*/
|
62 |
|
|
int height; /* height*/
|
63 |
|
|
int planes; /* # planes*/
|
64 |
|
|
int bpp; /* bits per pixel*/
|
65 |
|
|
int linelen; /* bytes per line*/
|
66 |
|
|
int size; /* allocated size in bytes*/
|
67 |
|
|
char bits[1]; /* beginning of bitmap*/
|
68 |
|
|
} MWBITMAPOBJ;
|
69 |
|
|
|
70 |
|
|
typedef struct {
|
71 |
|
|
MWGDIOBJHDR hdr;
|
72 |
|
|
MWCLIPREGION * rgn; /* clip region*/
|
73 |
|
|
} MWRGNOBJ;
|
74 |
|
|
|
75 |
|
|
/* device context*/
|
76 |
|
|
struct hdc {
|
77 |
|
|
struct _mwscreendevice *psd; /* screen or memory device*/
|
78 |
|
|
HWND hwnd; /* associated window*/
|
79 |
|
|
DWORD flags; /* clipping flags*/
|
80 |
|
|
int bkmode; /* background mode*/
|
81 |
|
|
UINT textalign; /* text alignment flags*/
|
82 |
|
|
MWCOLORVAL bkcolor; /* text background color*/
|
83 |
|
|
MWCOLORVAL textcolor; /* text color*/
|
84 |
|
|
MWBRUSHOBJ * brush; /* current brush*/
|
85 |
|
|
MWPENOBJ * pen; /* current pen*/
|
86 |
|
|
MWFONTOBJ * font; /* current font*/
|
87 |
|
|
MWBITMAPOBJ * bitmap; /* current bitmap (mem dc's only)*/
|
88 |
|
|
MWRGNOBJ * region; /* user specified clip region*/
|
89 |
|
|
int drawmode; /* rop2 drawing mode */
|
90 |
|
|
POINT pt; /* current pen pos in client coords*/
|
91 |
|
|
};
|
92 |
|
|
|
93 |
|
|
/* cursor*/
|
94 |
|
|
struct hcursor {
|
95 |
|
|
int usecount; /* use counter */
|
96 |
|
|
MWCURSOR cursor; /* software cursor definition*/
|
97 |
|
|
};
|
98 |
|
|
|
99 |
|
|
/* built-in scrollbars*/
|
100 |
|
|
typedef struct {
|
101 |
|
|
int minPos; /* min value of scroll range.*/
|
102 |
|
|
int maxPos; /* max value of scroll range.*/
|
103 |
|
|
int curPos; /* current scroll pos.*/
|
104 |
|
|
int pageStep; /* steps per page.*/
|
105 |
|
|
int barStart; /* start pixel of bar.*/
|
106 |
|
|
int barLen; /* length of bar.*/
|
107 |
|
|
int status; /* status of scroll bar.*/
|
108 |
|
|
RECT rc; /* screen coordinates position*/
|
109 |
|
|
} MWSCROLLBARINFO, *PMWSCROLLBARINFO;
|
110 |
|
|
|
111 |
|
|
/* window*/
|
112 |
|
|
struct hwnd {
|
113 |
|
|
RECT winrect; /* window rect in screen coords*/
|
114 |
|
|
RECT clirect; /* client rect in screen coords*/
|
115 |
|
|
RECT restorerc; /* restore rect from maximized*/
|
116 |
|
|
DWORD style; /* window style*/
|
117 |
|
|
DWORD exstyle; /* window extended style*/
|
118 |
|
|
PWNDCLASS pClass; /* window class*/
|
119 |
|
|
struct hwnd *parent; /* z-order parent window */
|
120 |
|
|
struct hwnd *owner; /* owner window*/
|
121 |
|
|
struct hwnd *children; /* first child window */
|
122 |
|
|
struct hwnd *siblings; /* next sibling window */
|
123 |
|
|
struct hwnd *next; /* next window in complete list */
|
124 |
|
|
struct hcursor *cursor; /* cursor for this window */
|
125 |
|
|
struct hdc * owndc; /* owndc if CS_OWNDC*/
|
126 |
|
|
int unmapcount; /* count of reasons not really mapped */
|
127 |
|
|
int id; /* window id */
|
128 |
|
|
CHAR szTitle[64]; /* window title*/
|
129 |
|
|
int gotPaintMsg; /* window had WM_PAINT PostMessage*/
|
130 |
|
|
int paintSerial; /* experimental serial # for alphblend*/
|
131 |
|
|
int paintNC; /* experimental NC paint handling*/
|
132 |
|
|
MWCLIPREGION * update; /* update region in screen coords*/
|
133 |
|
|
DWORD userdata; /* setwindowlong user data*/
|
134 |
|
|
DWORD userdata2; /* additional user data (will remove)*/
|
135 |
|
|
MWSCROLLBARINFO hscroll; /* NC scrollbars*/
|
136 |
|
|
MWSCROLLBARINFO vscroll;
|
137 |
|
|
int nextrabytes; /* # window extra bytes*/
|
138 |
|
|
char extrabytes[1]; /* window extra bytes - must be last*/
|
139 |
|
|
};
|
140 |
|
|
|
141 |
|
|
/* misc apis - will move to another header file*/
|
142 |
|
|
DWORD WINAPI GetTickCount(VOID);
|
143 |
|
|
VOID WINAPI Sleep(DWORD dwMilliseconds);
|
144 |
|
|
|
145 |
|
|
#ifdef __cplusplus
|
146 |
|
|
}
|
147 |
|
|
#endif
|
148 |
|
|
|
149 |
|
|
#endif /* _WINDOWS_H*/
|