author | Claus Gittinger <cg@exept.de> |
Fri, 11 Sep 1998 15:59:46 +0200 | |
changeset 2329 | 73bb4001db25 |
parent 2328 | 478ec9b5cbe1 |
child 2331 | 71a2798c7413 |
permissions | -rw-r--r-- |
1127 | 1 |
" |
2 |
COPYRIGHT (c) 1996 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
2232 | 13 |
'From Smalltalk/X, Version:3.4.8 on 23-jul-1998 at 12:28:43' ! |
14 |
||
1127 | 15 |
DeviceWorkstation subclass:#WinWorkstation |
2232 | 16 |
instanceVariableNames:'blackpixel whitepixel listOfFonts rootWin rootDC buttonsPressed |
17 |
eventTrace eventBuffer usingSystemPalette inRecursiveDispatch |
|
18 |
dispatchingExpose' |
|
19 |
classVariableNames:'BeepFrequency BeepDuration NativeWindows NativeWindowClassTable |
|
2151 | 20 |
StandardColorValues' |
1127 | 21 |
poolDictionaries:'' |
2232 | 22 |
category:'Interface-Graphics' |
23 |
! |
|
24 |
||
25 |
!WinWorkstation primitiveDefinitions! |
|
1127 | 26 |
%{ |
2232 | 27 |
#define COUNT_RESOURCES |
28 |
#define COUNT_BMP_RESOURCES |
|
29 |
#define ADJUSTWINDOW |
|
30 |
#define ALWAYSTRUECOLOR |
|
31 |
#define WIN32THREADS |
|
32 |
/*#define DEBUGMASK*/ |
|
33 |
||
1127 | 34 |
# undef INT |
35 |
# define INT WIN_INT |
|
36 |
# undef Array |
|
37 |
# define Array WIN_Array |
|
38 |
# undef Number |
|
39 |
# define Number WIN_Number |
|
40 |
# undef Method |
|
41 |
# define Method WIN_Method |
|
42 |
# undef Point |
|
43 |
# define Point WIN_Point |
|
44 |
# undef Rectangle |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
45 |
/*# define Rectangle WIN_Rectangle*/ |
1127 | 46 |
# undef True |
47 |
# define True WIN_True |
|
48 |
# undef False |
|
49 |
# define False WIN_False |
|
50 |
# undef Block |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
51 |
# define Block WIN_Block |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
52 |
# undef Context |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
53 |
# define Context WIN_Context |
1127 | 54 |
|
55 |
# undef xxCONTEXT |
|
56 |
# define xxCONTEXT WIN_CONTEXT |
|
57 |
# undef _xxCONTEXT |
|
58 |
# define _xxCONTEXT _WIN_CONTEXT |
|
59 |
||
2232 | 60 |
|
2328 | 61 |
#include <stdio.h> |
1127 | 62 |
/* #include <malloc.h> */ |
63 |
/* #include <math.h> */ |
|
64 |
/* #include <string.h> */ |
|
65 |
||
2151 | 66 |
/*#include <stdarg.h> */ |
2328 | 67 |
|
2151 | 68 |
#ifdef __BORLANDC__ |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
69 |
# define NOATOM |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
70 |
# define NOGDICAPMASKS |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
71 |
# define NOMETAFILE |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
72 |
# define NOMINMAX |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
73 |
# define NOOPENFILE |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
74 |
# define NOSOUND |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
75 |
# define NOWH |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
76 |
# define NOCOMM |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
77 |
# define NOKANJI |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
78 |
# define NOCRYPT |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
79 |
# define NOMCX |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
80 |
# define WIN32_LEAN_AND_MEAN |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
81 |
# include <windows.h> |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
82 |
# include <sys\timeb.h> |
2151 | 83 |
#else |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
84 |
# define _USERENTRY /**/ |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
85 |
# define NOATOM |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
86 |
# define NOGDICAPMASKS |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
87 |
# define NOMETAFILE |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
88 |
# define NOMINMAX |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
89 |
# define NOOPENFILE |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
90 |
# define NOSOUND |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
91 |
# define NOWH |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
92 |
# define NOCOMM |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
93 |
# define NOKANJI |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
94 |
# define NOCRYPT |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
95 |
# define NOMCX |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
96 |
# define WIN32_LEAN_AND_MEAN |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
97 |
# include <windows.h> |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
98 |
# include <sys\timeb.h> |
2151 | 99 |
#endif |
100 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
101 |
#include <process.h> |
1127 | 102 |
|
103 |
# ifdef __DEF_Array |
|
104 |
# undef Array |
|
105 |
# define Array __DEF_Array |
|
106 |
# endif |
|
107 |
# ifdef __DEF_Number |
|
108 |
# undef Number |
|
109 |
# define Number __DEF_Number |
|
110 |
# endif |
|
111 |
# ifdef __DEF_Method |
|
112 |
# undef Method |
|
113 |
# define Method __DEF_Method |
|
114 |
# endif |
|
115 |
# ifdef __DEF_Point |
|
116 |
# undef Point |
|
117 |
# define Point __DEF_Point |
|
118 |
# endif |
|
119 |
# ifdef __DEF_Block |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
120 |
# undef Block |
1127 | 121 |
# define Block __DEF_Block |
122 |
# endif |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
123 |
# ifdef __DEF_Context |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
124 |
# undef Context |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
125 |
# define Context __DEF_Context |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
126 |
# endif |
1912 | 127 |
# undef INT |
128 |
# define INT int |
|
1127 | 129 |
|
130 |
/* |
|
131 |
* some defines - tired of typing ... |
|
132 |
*/ |
|
133 |
#define _HANDLEVal(o) (HANDLE)(__MKCP(o)) |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
134 |
#define _HBITMAPVAL(o) (HBITMAP)(__MKCP(o)) |
1127 | 135 |
#define _HWNDVal(o) (HWND)(__MKCP(o)) |
136 |
#define _HPALETTEVal(o) (HPALETTE)(__MKCP(o)) |
|
137 |
#define _HCURSORVal(o) (HCURSOR)(__MKCP(o)) |
|
138 |
#define _HGDIOBJVal(o) (HGDIOBJ)(__MKCP(o)) |
|
139 |
#define _LOGPALETTEVal(o) (LOGPALETTE *)(__MKCP(o)) |
|
140 |
#define _COLORREFVal(o) (COLORREF)(__MKCP(o)) |
|
141 |
||
142 |
#define _GCDATA(o) ((struct gcData *)(__MKCP(o))) |
|
143 |
||
144 |
#define __rootDC (HDC)(__MKCP(__INST(rootDC))) |
|
145 |
#define ISCONNECTED (__INST(rootDC) != nil) |
|
146 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
147 |
struct gcData { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
148 |
HWND hWnd; |
2232 | 149 |
HBITMAP hBitmap; |
150 |
HBITMAP savehBitmap; |
|
151 |
int clipping; |
|
152 |
int clipX; |
|
153 |
int clipY; |
|
154 |
int clipW; |
|
155 |
int clipH; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
156 |
int clipByChild; |
2232 | 157 |
HDC _hDC; |
2151 | 158 |
HBITMAP hMask; |
2327 | 159 |
int maskOrgX; |
160 |
int maskOrgY; |
|
2151 | 161 |
int bitmapColorBitCount; |
1127 | 162 |
int lineWidth; |
163 |
int lineStyle; |
|
164 |
int joinStyle; |
|
165 |
int capStyle; |
|
166 |
int fontAscent; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
167 |
int rop2; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
168 |
int bitbltrop2; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
169 |
COLORREF fgColor; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
170 |
COLORREF bgColor; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
171 |
HFONT hFont; |
1127 | 172 |
}; |
173 |
||
174 |
/* |
|
175 |
* some synthetic values |
|
176 |
*/ |
|
2151 | 177 |
/***************************************************************** |
178 |
* EVENT DEFINITIONS |
|
179 |
*****************************************************************/ |
|
180 |
||
181 |
/* Input Event Masks. Used as event-mask window attribute and as arguments |
|
182 |
to Grab requests. Not to be confused with event names. */ |
|
183 |
||
184 |
#define NoEventMask 0L |
|
185 |
#define KeyPressMask (1L<<0) |
|
186 |
#define KeyReleaseMask (1L<<1) |
|
187 |
#define ButtonPressMask (1L<<2) |
|
188 |
#define ButtonReleaseMask (1L<<3) |
|
189 |
#define EnterWindowMask (1L<<4) |
|
190 |
#define LeaveWindowMask (1L<<5) |
|
191 |
#define PointerMotionMask (1L<<6) |
|
192 |
#define PointerMotionHintMask (1L<<7) |
|
193 |
#define Button1MotionMask (1L<<8) |
|
194 |
#define Button2MotionMask (1L<<9) |
|
195 |
#define Button3MotionMask (1L<<10) |
|
196 |
#define Button4MotionMask (1L<<11) |
|
197 |
#define Button5MotionMask (1L<<12) |
|
198 |
#define ButtonMotionMask (1L<<13) |
|
199 |
#define KeymapStateMask (1L<<14) |
|
200 |
#define ExposureMask (1L<<15) |
|
201 |
#define VisibilityChangeMask (1L<<16) |
|
202 |
#define StructureNotifyMask (1L<<17) |
|
203 |
#define ResizeRedirectMask (1L<<18) |
|
204 |
#define SubstructureNotifyMask (1L<<19) |
|
205 |
#define SubstructureRedirectMask (1L<<20) |
|
206 |
#define FocusChangeMask (1L<<21) |
|
207 |
#define PropertyChangeMask (1L<<22) |
|
208 |
#define ColormapChangeMask (1L<<23) |
|
209 |
#define OwnerGrabButtonMask (1L<<24) |
|
210 |
||
211 |
/* Event names. Used in "type" field in XEvent structures. Not to be |
|
212 |
confused with event masks above. They start from 2 because 0 and 1 |
|
213 |
are reserved in the protocol for errors and replies. */ |
|
214 |
||
215 |
#define KeyPress 2 |
|
216 |
#define KeyRelease 3 |
|
217 |
#define ButtonPress 4 |
|
218 |
#define ButtonRelease 5 |
|
219 |
#define MotionNotify 6 |
|
220 |
#define EnterNotify 7 |
|
221 |
#define LeaveNotify 8 |
|
222 |
#define FocusIn 9 |
|
223 |
#define FocusOut 10 |
|
224 |
#define KeymapNotify 11 |
|
225 |
#define Expose 12 |
|
226 |
#define GraphicsExpose 13 |
|
227 |
#define NoExpose 14 |
|
228 |
#define VisibilityNotify 15 |
|
229 |
#define CreateNotify 16 |
|
230 |
#define DestroyNotify 17 |
|
231 |
#define UnmapNotify 18 |
|
232 |
#define MapNotify 19 |
|
233 |
#define MapRequest 20 |
|
234 |
#define ReparentNotify 21 |
|
235 |
#define ConfigureNotify 22 |
|
236 |
#define ConfigureRequest 23 |
|
237 |
#define GravityNotify 24 |
|
238 |
#define ResizeRequest 25 |
|
239 |
#define CirculateNotify 26 |
|
240 |
#define CirculateRequest 27 |
|
241 |
#define PropertyNotify 28 |
|
242 |
#define SelectionClear 29 |
|
243 |
#define SelectionRequest 30 |
|
244 |
#define SelectionNotify 31 |
|
245 |
#define ColormapNotify 32 |
|
246 |
#define ClientMessage 33 |
|
247 |
#define MappingNotify 34 |
|
248 |
#define LASTEvent 35 /* must be bigger than any event # */ |
|
249 |
||
250 |
/*# define Button1MotionMask 1 |
|
1127 | 251 |
# define Button2MotionMask 2 |
252 |
# define Button3MotionMask 4 |
|
253 |
||
254 |
# define Button1Mask Button1MotionMask |
|
255 |
# define Button2Mask Button2MotionMask |
|
2151 | 256 |
# define Button3Mask Button3MotionMask*/ |
257 |
||
258 |
/* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer, |
|
259 |
state in various key-, mouse-, and button-related events. */ |
|
260 |
||
261 |
#define ShiftMask (1<<0) |
|
262 |
#define LockMask (1<<1) |
|
263 |
#define ControlMask (1<<2) |
|
264 |
#define Mod1Mask (1<<3) |
|
265 |
#define Mod2Mask (1<<4) |
|
266 |
#define Mod3Mask (1<<5) |
|
267 |
#define Mod4Mask (1<<6) |
|
268 |
#define Mod5Mask (1<<7) |
|
269 |
||
270 |
/* modifier names. Used to build a SetModifierMapping request or |
|
271 |
to read a GetModifierMapping request. These correspond to the |
|
272 |
masks defined above. */ |
|
273 |
#define ShiftMapIndex 0 |
|
274 |
#define LockMapIndex 1 |
|
275 |
#define ControlMapIndex 2 |
|
276 |
#define Mod1MapIndex 3 |
|
277 |
#define Mod2MapIndex 4 |
|
278 |
#define Mod3MapIndex 5 |
|
279 |
#define Mod4MapIndex 6 |
|
280 |
#define Mod5MapIndex 7 |
|
281 |
||
282 |
||
283 |
/* button masks. Used in same manner as Key masks above. Not to be confused |
|
284 |
with button names below. */ |
|
285 |
||
286 |
# define Button1Mask Button1MotionMask |
|
287 |
# define Button2Mask Button2MotionMask |
|
1127 | 288 |
# define Button3Mask Button3MotionMask |
2151 | 289 |
# define Button4Mask Button4MotionMask |
290 |
# define Button5Mask Button5MotionMask |
|
291 |
||
292 |
#define AnyModifier (1<<15) /* used in GrabButton, GrabKey */ |
|
293 |
||
294 |
||
295 |
/* button names. Used as arguments to GrabButton and as detail in ButtonPress |
|
296 |
and ButtonRelease events. Not to be confused with button masks above. |
|
297 |
Note that 0 is already defined above as "AnyButton". */ |
|
298 |
||
299 |
#define Button1 1 |
|
300 |
#define Button2 2 |
|
301 |
#define Button3 3 |
|
302 |
#define Button4 4 |
|
303 |
#define Button5 5 |
|
304 |
||
305 |
/*# define ControlMask 8 |
|
306 |
# define ShiftMask 16*/ |
|
307 |
# define LeftAltMask Mod1Mask |
|
308 |
# define RightAltMask Mod2Mask |
|
309 |
# define TRANSLATED_KEY Mod5Mask |
|
310 |
||
311 |
#define WIN32PADDING 32 |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
312 |
/* |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
313 |
* synthetic events |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
314 |
*/ |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
315 |
#define __WM_MOUSEENTER 0x10001 |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
316 |
#define __WM_MOUSELEAVE 0x10002 |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
317 |
#define __WM_GEXPOSE 0x10003 |
2232 | 318 |
#define __WM_NOGEXPOSE 0x10004 |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
319 |
|
1920 | 320 |
static int AltMask = RightAltMask; |
321 |
static int MetaMask = LeftAltMask; |
|
1127 | 322 |
|
323 |
# define WhitePixel RGB(0xFF, 0xFF, 0xFF) |
|
324 |
# define BlackPixel RGB(0, 0, 0) |
|
325 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
326 |
/*#undef DEBUG*/ |
1127 | 327 |
#ifdef DEBUG |
2232 | 328 |
# define PRINTF(x) { printf x;} |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
329 |
# define CPRINTF(x) { if (__debug__) printf x;} |
2253 | 330 |
# define RESPRINTF(x) /*{ if (__debug__) printf x;}*/ |
331 |
# define RES1PRINTF(x) /*{ if (__debug__) printf x;}*/ |
|
332 |
# define RES_BMP_PRINTF(x) /*{ if (__debug__) printf x;}*/ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
333 |
# define TH_DPRINTF(x) /*{ if (__debug__) printf x;}*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
334 |
# define POSTPRINTF(x) { if (__debug__) printf x;} |
1920 | 335 |
# define DPRINTF(x) { if (__debug__) printf x;} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
336 |
# define DDPRINTF(x) /*{ if (__debug__) printf x;}*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
337 |
# define EVENT_PRINTF(x) /*{ if (__debug__) printf x;}*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
338 |
# define EVENT_PRINTF2(x) /*{ if (__debug__) printf x;}*/ |
1705 | 339 |
# define EVENT_PRINTF3(x) /* */ |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
340 |
# define UNHANDLED_EVENT_PRINTF(x) { if (__debug__) printf x;} |
1127 | 341 |
#else |
2151 | 342 |
# define PRINTF(x) /* */ |
2232 | 343 |
# define CPRINTF(x) /* */ |
344 |
# define RES_BMP_PRINTF(x) /**/ |
|
345 |
# define RESPRINTF(x) /* */ |
|
346 |
# define RES1PRINTF(x) /* */ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
347 |
# define TH_DPRINTF(x) /* */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
348 |
# define POSTDPRINTF(x) /* */ |
1127 | 349 |
# define DPRINTF(x) /* */ |
350 |
# define DDPRINTF(x) /* */ |
|
351 |
# define EVENT_PRINTF(x) /* */ |
|
352 |
# define EVENT_PRINTF2(x) /* */ |
|
1705 | 353 |
# define EVENT_PRINTF3(x) /* */ |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
354 |
# define UNHANDLED_EVENT_PRINTF(x) /* */ |
1127 | 355 |
#endif |
356 |
||
357 |
# define BR_SOLID 0 |
|
358 |
# define BR_PATTERN 1 |
|
359 |
||
360 |
# define LINE_SOLID 0 |
|
361 |
# define LINE_DASH 1 |
|
362 |
# define LINE_DDASH 2 |
|
363 |
||
1685 | 364 |
#ifdef KEEP_STD_CURSORS |
1127 | 365 |
# define _C_ARROW 1 |
366 |
# define _C_CROSS 2 |
|
367 |
# define _C_IBEAM 3 |
|
368 |
# define _C_ICON 4 |
|
369 |
# define _C_NO 5 |
|
370 |
# define _C_SIZE 6 |
|
371 |
# define _C_SIZEALL 7 |
|
372 |
# define _C_SIZENESW 8 |
|
373 |
# define _C_SIZENS 9 |
|
374 |
# define _C_SIZENWSE 10 |
|
375 |
# define _C_UPARROW 11 |
|
376 |
# define _C_WAIT 12 |
|
377 |
||
1685 | 378 |
static HCURSOR H_C_ARROW = (HCURSOR)0; |
379 |
static HCURSOR H_C_CROSS = (HCURSOR)0; |
|
380 |
static HCURSOR H_C_IBEAM = (HCURSOR)0; |
|
381 |
static HCURSOR H_C_ICON = (HCURSOR)0; |
|
382 |
static HCURSOR H_C_NO = (HCURSOR)0; |
|
383 |
static HCURSOR H_C_SIZE = (HCURSOR)0; |
|
384 |
static HCURSOR H_C_SIZEALL = (HCURSOR)0; |
|
385 |
static HCURSOR H_C_SIZENESW = (HCURSOR)0; |
|
386 |
static HCURSOR H_C_SIZENS = (HCURSOR)0; |
|
387 |
static HCURSOR H_C_SIZENWSE = (HCURSOR)0; |
|
388 |
static HCURSOR H_C_UPARROW = (HCURSOR)0; |
|
389 |
static HCURSOR H_C_WAIT = (HCURSOR)0; |
|
390 |
#endif /* KEEP_STD_CURSORS */ |
|
1127 | 391 |
|
2232 | 392 |
static int c_count; |
1127 | 393 |
static int evRootX, evRootY; |
2151 | 394 |
static int multiClickState; |
395 |
static UINT lastMSGTime; |
|
396 |
static UINT multiClickTime; |
|
397 |
static UINT nextMultiClickTime; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
398 |
static int destroyWin; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
399 |
static int __modifiers; |
2151 | 400 |
static HDC tmpDC; |
2232 | 401 |
static int __isWinNT; |
402 |
static int __logPixelSY; |
|
2325 | 403 |
static struct gcData *lastGcData; |
404 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
405 |
#define WM_THREADCREATEWINDOW WM_USER + 0x101 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
406 |
#define WM_THREADDESTROYWINDOW WM_USER + 0x102 |
2232 | 407 |
#define WM_THREADSETFOCUS WM_USER + 0x103 |
408 |
#define WM_THREADSETCAPTURE WM_USER + 0x104 |
|
2247 | 409 |
#define WM_THREADSETCURSOR WM_USER + 0x105 |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
410 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
411 |
#define THREADINPUTEVENTNAME "InputEvents" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
412 |
#define THREADEVENTNAME "CreateEvents" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
413 |
#define THREADMUTEXNAME "MutexToProtectEvents" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
414 |
#define isInputEvent() ((int)eventQueueHead) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
415 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
416 |
typedef int (*intf)(int); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
417 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
418 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
419 |
* keep the windows cursor and others local in the HWND struct. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
420 |
*/ |
2151 | 421 |
#define LI_TOPWIN 0x0001 |
422 |
#define LI_INPUTWIN 0x0002 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
423 |
typedef struct |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
424 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
425 |
HCURSOR hCursor; |
2232 | 426 |
int bgBrush; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
427 |
int flag; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
428 |
int minWidth; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
429 |
int maxWidth; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
430 |
int minHeight; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
431 |
int maxHeight; |
2151 | 432 |
int eventMask; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
433 |
} localWindowInfo; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
434 |
typedef localWindowInfo *plocalWindowInfo; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
435 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
436 |
#define N_WINDOW_PRIVATE (sizeof(plocalWindowInfo)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
437 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
438 |
#define GETLOCALWINDOWINFOPTR(__hWnd__) \ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
439 |
((localWindowInfo*)GetWindowLong(__hWnd__, 0)) |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
440 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
441 |
#define SETLOCALWINDOWINFOPTR(__hWnd__,__ptr__) \ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
442 |
SetWindowLong(__hWnd__, 0 , (DWORD)__ptr__) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
443 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
444 |
#define SetWindow_Cursor(__hWnd__, __hCurs__) \ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
445 |
(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor = __hCurs__) : 0) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
446 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
447 |
#define GetWindow_Cursor(__hWnd__) \ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
448 |
(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor : 0) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
449 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
450 |
#define SetWindow_bgBrush(__hWnd__, __bgBrush__) \ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
451 |
(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->bgBrush = __bgBrush__) : 0) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
452 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
453 |
#define GetWindow_bgBrush(__hWnd__) \ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
454 |
(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->bgBrush : 0) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
455 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
456 |
#define GetWindow_paintInfoPtr(__hWnd__) \ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
457 |
(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->paintInfo) : 0) |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
458 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
459 |
#define GetWindow_sizeInfoPtr(__hWnd__) \ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
460 |
(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->sizeInfo) : 0) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
461 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
462 |
#define SetWindow_Flag(__hWnd__, __flag__) \ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
463 |
(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->flag = __flag__) : 0) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
464 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
465 |
#define GetWindow_Flag(__hWnd__) \ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
466 |
(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->flag : 0) |
1127 | 467 |
|
2151 | 468 |
#define GetWindow_eventMask(__hWnd__) \ |
469 |
(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->eventMask) : 0) |
|
470 |
||
1127 | 471 |
struct queuedEvent { |
472 |
struct queuedEvent *ev_next; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
473 |
int count; |
2232 | 474 |
int ev_flag; |
1127 | 475 |
HWND ev_hWnd; |
476 |
UINT ev_message; |
|
477 |
UINT ev_wParam; |
|
478 |
int ev_arg1; |
|
479 |
int ev_arg2; |
|
480 |
int ev_arg3; |
|
481 |
int ev_arg4; |
|
482 |
}; |
|
483 |
||
484 |
#define ev_x ev_arg1 |
|
485 |
#define ev_y ev_arg2 |
|
486 |
#define ev_w ev_arg3 |
|
487 |
#define ev_h ev_arg4 |
|
488 |
||
489 |
#define ev_keyCode ev_wParam |
|
490 |
#define ev_scanCode ev_arg3 |
|
491 |
#define ev_modifiers ev_arg4 |
|
492 |
||
2232 | 493 |
#define EV_CHUNK_CNT 10000 |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
494 |
#define EV_CHUNK_SZ (EV_CHUNK_CNT*sizeof(struct queuedEvent)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
495 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
496 |
#define BITBLT_COPY SRCCOPY |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
497 |
#define BITBLT_COPYINVERTED NOTSRCCOPY |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
498 |
#define BITBLT_XOR SRCINVERT |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
499 |
#define BITBLT_AND SRCAND |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
500 |
#define BITBLT_OR SRCPAINT |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
501 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
502 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
503 |
%} |
2232 | 504 |
! ! |
505 |
||
506 |
!WinWorkstation primitiveVariables! |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
507 |
%{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
508 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
509 |
static int firstInstance = 1; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
510 |
static char *app_name = "ST/X"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
511 |
static char *app_nameroot = "ST/X:Root"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
512 |
static int __debug__ = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
513 |
static int __depth; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
514 |
static HWND __rootWin = NULL; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
515 |
static HWND __rootWinSpezial = NULL; |
2232 | 516 |
static HDESK __rootDesk; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
517 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
518 |
#define CAPTURE_NONE 0 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
519 |
#define CAPTURE_EXPLICIT 1 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
520 |
#define CAPTURE_IMPLICIT 2 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
521 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
522 |
static int currentCapture = CAPTURE_NONE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
523 |
static int lastNCMouseX, lastNCMouseY; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
524 |
static int lastMoveX, lastMoveY, lastSizeWidth, lastSizeHeight; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
525 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
526 |
static HANDLE currentPointerView = (HANDLE)0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
527 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
528 |
/* MessageDispatchThread */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
529 |
static char *_thread_windowName; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
530 |
static char *_thread_className; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
531 |
static int _thread_winStyleBits; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
532 |
static int _thread_winStyleBitsEx; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
533 |
static HANDLE _thread_parentHandle; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
534 |
static int _thread_x; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
535 |
static int _thread_y; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
536 |
static int _thread_dx; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
537 |
static int _thread_dy; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
538 |
static localWindowInfo *_thread_local; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
539 |
static HANDLE _thread_newWinHandle; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
540 |
static DWORD _masterThreadId; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
541 |
static HANDLE _masterThread; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
542 |
static DWORD _dispatchThreadId; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
543 |
static BOOL bdispatchThreadState; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
544 |
static int lockcount; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
545 |
static HANDLE hdispatchMutex; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
546 |
static HANDLE hCreateEvent; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
547 |
static HANDLE hInputEvent; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
548 |
|
2232 | 549 |
static int __cnt_bmpdc; |
550 |
static int __cnt_gcData; |
|
551 |
static int __cnt_createWindows; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
552 |
static int __cnt_bitmap; |
2232 | 553 |
static int __cnt_cur; |
554 |
static int __cnt_font; |
|
1127 | 555 |
struct queuedEvent *eventFreeList = (struct queuedEvent *)0; |
556 |
struct queuedEvent *eventQueueHead = (struct queuedEvent *)0; |
|
557 |
struct queuedEvent *eventQueueTail = (struct queuedEvent *)0; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
558 |
static int eventsendcount = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
559 |
static int eventempfcount = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
560 |
%} |
2232 | 561 |
! ! |
562 |
||
563 |
!WinWorkstation primitiveFunctions! |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
564 |
%{ |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
565 |
|
2253 | 566 |
#ifdef xxWIN32THREADS |
2232 | 567 |
extern void __suspendAktThread(); |
568 |
extern void __resumeAktThread(); |
|
569 |
#endif |
|
1127 | 570 |
|
1705 | 571 |
__debugEvent__() {} |
2151 | 572 |
#ifdef DEBUGMASK |
573 |
printMask(int mask) |
|
574 |
{ |
|
575 |
if (mask & KeyPressMask) printf("KeyPressMask\n"); |
|
576 |
if (mask & KeyReleaseMask) printf("KeyReleaseMask\n"); |
|
577 |
if (mask & ButtonPressMask) printf("ButtonPressMask\n"); |
|
578 |
if (mask & ButtonReleaseMask) printf("ButtonReleaseMask\n"); |
|
579 |
if (mask & ButtonMotionMask) printf("ButtonMotionMask\n"); |
|
580 |
if (mask & PointerMotionMask) printf("PointerMotionMask\n"); |
|
581 |
if (mask & ExposureMask) printf("ExposureMask\n"); |
|
582 |
if (mask & FocusChangeMask) printf("FocusChangeMask\n"); |
|
583 |
if (mask & EnterWindowMask) printf("EnterWindowMask\n"); |
|
584 |
if (mask & LeaveWindowMask) printf("LeaveWindowMask\n"); |
|
585 |
if (mask & KeymapStateMask) printf("KeymapStateMask\n"); |
|
586 |
if (mask & VisibilityChangeMask)printf("VisibilityChangeMask\n"); |
|
587 |
if (mask & StructureNotifyMask) printf("StructureNotifyMask\n"); |
|
588 |
if (mask & ResizeRedirectMask) printf("ResizeRedirectMask\n"); |
|
589 |
if (mask & PropertyChangeMask) printf("PropertyChangeMask\n"); |
|
590 |
if (mask & ColormapChangeMask) printf("ColormapChangeMask\n"); |
|
591 |
} |
|
592 |
#endif |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
593 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
594 |
static int |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
595 |
st2RGB(int color,struct gcData *gcData) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
596 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
597 |
int ir,ig,ib; |
2151 | 598 |
if (gcData) |
599 |
{ |
|
600 |
if (gcData->bitmapColorBitCount == 1) |
|
601 |
{ |
|
602 |
if (color) |
|
603 |
return WhitePixel; |
|
604 |
else |
|
605 |
return BlackPixel; |
|
606 |
} |
|
607 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
608 |
if (__depth < 15) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
609 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
610 |
return 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
611 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
612 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
613 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
614 |
if ((__depth == 16) || (__depth == 15)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
615 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
616 |
ib = (color & 0x1f) << 3; |
2232 | 617 |
ig = ((color >> 5) & 0x3f) << 2; |
618 |
ir = ((color >> 11) & 0x1f) << 3; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
619 |
ir |= 7; |
2232 | 620 |
ig |= 3; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
621 |
ib |= 7; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
622 |
return RGB(ir,ig,ib); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
623 |
} |
2325 | 624 |
return (color & 0xffffff); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
625 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
626 |
} |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
627 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
628 |
static int |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
629 |
RGB2st(int r,int g,int b) |
1127 | 630 |
{ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
631 |
int ir,ig,ib,id; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
632 |
if (__depth < 15) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
633 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
634 |
id = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
635 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
636 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
637 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
638 |
if ((__depth == 16) || (__depth == 15)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
639 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
640 |
ir = (r >> 11) & 0x1f; |
2232 | 641 |
ig = (g >> 10) & 0x3f; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
642 |
ib = (b >> 11) & 0x1f; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
643 |
|
2232 | 644 |
id = ( ir << 11 ) | ( ig << 5 ) | ib; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
645 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
646 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
647 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
648 |
ir = (r >> 8) & 0xff; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
649 |
ig = (g >> 8) & 0xff; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
650 |
ib = (b >> 8) & 0xff; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
651 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
652 |
id = RGB( ir, ig, ib); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
653 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
654 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
655 |
return id; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
656 |
} |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
657 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
658 |
static int |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
659 |
DelObject(HANDLE o) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
660 |
{ |
2151 | 661 |
int r = DeleteObject(o); |
662 |
if (r == 0) |
|
663 |
printf("ERROR in DelObjectect\n"); |
|
664 |
return r; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
665 |
} |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
666 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
667 |
static struct gcData * |
2327 | 668 |
newGcData() { |
2232 | 669 |
struct gcData *gcData = (struct gcData *)malloc(sizeof(struct gcData)); |
2327 | 670 |
|
2232 | 671 |
if (! gcData) { |
672 |
return 0; |
|
673 |
} |
|
2327 | 674 |
memset(gcData, 0, sizeof(struct gcData)); |
2264 | 675 |
gcData->fgColor = 0xffffff; |
2232 | 676 |
gcData->clipping = FALSE; |
677 |
gcData->clipByChild = TRUE; |
|
678 |
gcData->bitbltrop2 = BITBLT_COPY; |
|
679 |
gcData->lineWidth = 1; |
|
680 |
gcData->lineStyle = PS_SOLID; |
|
681 |
gcData->joinStyle = PS_JOIN_MITER; |
|
682 |
gcData->capStyle = PS_ENDCAP_FLAT; |
|
2327 | 683 |
/* gcData->brushOrgX = gcData->brushOrgY = 0; - not needed - memset does it */ |
2232 | 684 |
return gcData; |
685 |
} |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
686 |
|
2325 | 687 |
static void |
688 |
__releaseDC(struct gcData *gcData) |
|
689 |
{ |
|
690 |
} |
|
691 |
||
692 |
static void |
|
693 |
_releaseDC(struct gcData *gcData) |
|
694 |
{ |
|
2327 | 695 |
if (gcData->hWnd) { |
696 |
if (gcData->_hDC) { |
|
697 |
ReleaseDC(gcData->hWnd,gcData->_hDC); |
|
698 |
} |
|
699 |
} else if (gcData->hBitmap) { |
|
700 |
SelectObject(gcData->_hDC,gcData->savehBitmap); |
|
701 |
DeleteDC(gcData->_hDC); |
|
702 |
} |
|
703 |
gcData->_hDC = 0; |
|
2325 | 704 |
} |
705 |
||
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
706 |
static HDC |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
707 |
_getDC(struct gcData *gcData) |
2232 | 708 |
{ |
2325 | 709 |
#if 0 |
2327 | 710 |
if (lastGcData) { |
711 |
if (lastGcData == gcData) { |
|
712 |
//printf("."); |
|
713 |
return gcData->_hDC; |
|
714 |
} |
|
715 |
__releaseDC(lastGcData); |
|
716 |
} |
|
2325 | 717 |
#endif |
2327 | 718 |
|
719 |
if (gcData->hWnd != 0) { |
|
720 |
if (__isWinNT && (gcData->hWnd == __rootWin)) { |
|
721 |
gcData->_hDC = GetDCEx(gcData->hWnd,0,DCX_WINDOW); |
|
722 |
//gcData->_hDC = GetDC(gcData->hWnd); |
|
723 |
} else { |
|
724 |
if (gcData->clipByChild) { |
|
725 |
//gcData->_hDC = GetDCEx(gcData->hWnd,0,DCX_CLIPCHILDREN); |
|
726 |
gcData->_hDC = GetDC(gcData->hWnd); |
|
727 |
} else |
|
728 |
gcData->_hDC = GetDCEx(gcData->hWnd,0,DCX_PARENTCLIP); |
|
729 |
} |
|
730 |
} else if (gcData->hBitmap) { |
|
731 |
gcData->_hDC = CreateCompatibleDC(tmpDC); |
|
732 |
gcData->savehBitmap = SelectObject(gcData->_hDC,gcData->hBitmap); |
|
733 |
} |
|
734 |
if (gcData->_hDC) { |
|
735 |
SetTextColor(gcData->_hDC, gcData->bgColor); |
|
736 |
SetBkColor(gcData->_hDC, gcData->fgColor); |
|
737 |
if (gcData->rop2) |
|
738 |
SetROP2(gcData->_hDC, gcData->rop2); |
|
739 |
if (gcData->clipping) { |
|
740 |
HRGN region = CreateRectRgn( gcData->clipX,gcData->clipY, |
|
741 |
gcData->clipX + gcData->clipW, |
|
742 |
gcData->clipY + gcData->clipH ); |
|
743 |
if( region == NULL ) { |
|
744 |
DPRINTF((" clipping region creation failed!\n")); |
|
745 |
} else { |
|
746 |
if (SelectClipRgn(gcData->_hDC, region) == ERROR ) { |
|
747 |
DPRINTF((" clipping region release unsuccessful\n" )); |
|
748 |
} |
|
749 |
/*printf("%x c\n",hDC);*/ |
|
750 |
DelObject(region); |
|
751 |
} |
|
752 |
} |
|
753 |
} |
|
754 |
lastGcData = gcData; |
|
755 |
return gcData->_hDC; |
|
2232 | 756 |
} |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
757 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
758 |
static HBRUSH |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
759 |
GcDataGetBrush(HDC hDC,struct gcData *gcData) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
760 |
{ |
2232 | 761 |
HBRUSH hBrush = 0; |
2327 | 762 |
|
763 |
if (gcData->hMask) { |
|
764 |
hBrush = CreatePatternBrush(gcData->hMask); |
|
765 |
RESPRINTF(("CreatePatternBrush %x\n",gcData->hMask)); |
|
766 |
} else { |
|
767 |
hBrush = CreateSolidBrush(gcData->fgColor); |
|
768 |
RESPRINTF(("CreateSolidBrush %x\n",gcData->fgColor)); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
769 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
770 |
return hBrush; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
771 |
} |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
772 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
773 |
static HPEN |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
774 |
GcDataGetPen(HDC hDC,struct gcData *gcData) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
775 |
{ |
2232 | 776 |
HPEN hPen = 0; |
2151 | 777 |
LOGBRUSH Brush; |
778 |
||
2327 | 779 |
if (gcData->hMask) { |
780 |
Brush.lbStyle = BS_PATTERN; |
|
781 |
Brush.lbHatch = (DWORD)gcData->hMask; |
|
782 |
Brush.lbColor = gcData->fgColor; |
|
783 |
hPen = ExtCreatePen(PS_GEOMETRIC | gcData->capStyle | gcData->joinStyle | gcData->lineStyle, |
|
784 |
gcData->lineWidth, |
|
785 |
&Brush, |
|
786 |
0,0); |
|
787 |
SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0); |
|
788 |
RESPRINTF(("ExtCreatePen %s %d %x %x\n",(gcData->lineStyle == PS_SOLID) ? "SOLID " : "DASHED", |
|
789 |
gcData->lineWidth, |
|
790 |
gcData->fgColor,gcData->hMask)); |
|
791 |
} |
|
792 |
if (! hPen) { |
|
793 |
if (gcData->lineStyle == PS_SOLID) |
|
794 |
hPen = CreatePen(gcData->lineStyle, |
|
795 |
gcData->lineWidth, |
|
796 |
gcData->fgColor); |
|
797 |
else |
|
798 |
hPen = CreatePen(PS_DOT, |
|
799 |
0, |
|
800 |
0); |
|
801 |
||
802 |
RESPRINTF(("CreatePen %s %d %x\n",(gcData->lineStyle == PS_SOLID) ? "SOLID " : "DASHED", |
|
803 |
gcData->lineWidth, |
|
804 |
gcData->fgColor)); |
|
2151 | 805 |
} |
806 |
return hPen; |
|
1127 | 807 |
} |
808 |
||
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
809 |
static int |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
810 |
lockEvent() |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
811 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
812 |
DWORD dwWaitResult; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
813 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
814 |
/* Request ownership of mutex. */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
815 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
816 |
dwWaitResult = WaitForSingleObject( |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
817 |
hdispatchMutex, /* handle of mutex */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
818 |
5000L); /* time-out interval */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
819 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
820 |
lockcount++; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
821 |
if (lockcount != 1) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
822 |
{ |
2232 | 823 |
printf("WINWORKSTATION:lockcount != 1 :=%d\n",lockcount); |
824 |
lockcount = 1; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
825 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
826 |
switch (dwWaitResult) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
827 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
828 |
// The thread got mutex ownership. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
829 |
case WAIT_OBJECT_0: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
830 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
831 |
// Cannot get mutex ownership due to time-out. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
832 |
case WAIT_TIMEOUT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
833 |
printf("lockEvent fail\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
834 |
return FALSE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
835 |
// Got ownership of the abandoned mutex object. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
836 |
default: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
837 |
return FALSE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
838 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
839 |
return TRUE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
840 |
} |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
841 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
842 |
static void |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
843 |
unlockEvent() |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
844 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
845 |
if (lockcount != 1) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
846 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
847 |
printf("lockcount != 1 :=%d\n",lockcount); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
848 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
849 |
lockcount--; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
850 |
/* Release ownership of the mutex object. */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
851 |
if (! ReleaseMutex(hdispatchMutex)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
852 |
/* Deal with error. */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
853 |
printf("unlock Error\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
854 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
855 |
} |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
856 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
857 |
static int |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
858 |
initqueue() |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
859 |
{ |
2232 | 860 |
struct queuedEvent *bulk; |
861 |
int i = 0; |
|
862 |
bulk = (struct queuedEvent *) malloc(EV_CHUNK_SZ); |
|
863 |
if (bulk == 0) |
|
864 |
{ |
|
865 |
printf("no memory for dispatchqueue\n"); |
|
866 |
return 0; |
|
867 |
} |
|
868 |
for (i=1; i<EV_CHUNK_CNT; i++) { |
|
2244 | 869 |
bulk[i-1].ev_next = &(bulk[i]); |
2232 | 870 |
} |
871 |
bulk[EV_CHUNK_CNT-1].ev_next = (struct queuedEvent *)0; |
|
872 |
eventFreeList = bulk; |
|
873 |
return 1; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
874 |
} |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
875 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
876 |
static void |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
877 |
enqEvent(int flag,HWND hWnd, UINT message, UINT wParam,int arg1,int arg2,int arg3,int arg4) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
878 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
879 |
struct queuedEvent *ev = 0; |
2232 | 880 |
int repeatCount = 0; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
881 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
882 |
TH_DPRINTF(("TEW\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
883 |
if (lockEvent()) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
884 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
885 |
TH_DPRINTF(("TEF\n")); |
2232 | 886 |
again: |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
887 |
ev = eventFreeList; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
888 |
if (ev) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
889 |
eventFreeList = ev->ev_next; |
2244 | 890 |
ev->ev_next = (struct queuedEvent *)0; |
891 |
||
892 |
ev->count = eventsendcount++; |
|
893 |
ev->ev_flag = flag; |
|
894 |
ev->ev_hWnd = hWnd; |
|
895 |
ev->ev_message = message; |
|
896 |
ev->ev_wParam = wParam; |
|
897 |
ev->ev_arg1 = arg1; |
|
898 |
ev->ev_arg2 = arg2; |
|
899 |
ev->ev_arg3 = arg3; |
|
900 |
ev->ev_arg4 = arg4; |
|
901 |
||
902 |
if (eventQueueTail) { |
|
903 |
eventQueueTail->ev_next = ev; |
|
904 |
} else { |
|
905 |
eventQueueHead = ev; |
|
906 |
} |
|
907 |
eventQueueTail = ev; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
908 |
} else { |
2244 | 909 |
unlockEvent(); |
2253 | 910 |
SetEvent(hInputEvent); |
2260 | 911 |
printf("winthread wait\n"); |
2244 | 912 |
if (repeatCount++ < 10) |
913 |
{ |
|
914 |
Sleep(20); |
|
915 |
if (lockEvent()) |
|
916 |
{ |
|
917 |
goto again; |
|
918 |
} |
|
919 |
} |
|
2260 | 920 |
printf("winthread throw away\n"); |
2244 | 921 |
/* throw away sorry */ |
922 |
return; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
923 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
924 |
unlockEvent(); |
2253 | 925 |
SetEvent(hInputEvent); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
926 |
/*SetThreadPriority(_masterThread,THREAD_PRIORITY_HIGHEST);*/ |
2253 | 927 |
//Sleep(0); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
928 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
929 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
930 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
931 |
static |
2232 | 932 |
deqEvent(struct queuedEvent *ret_ev,HWND hWnd,int mask) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
933 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
934 |
struct queuedEvent *ev = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
935 |
|
2232 | 936 |
if (mask != ~0) |
937 |
{ |
|
2240 | 938 |
PRINTF(("deqEvent mask:%x\n",mask)); |
2232 | 939 |
} |
940 |
if (hWnd) |
|
941 |
{ |
|
2240 | 942 |
PRINTF(("deqEvent hWnd:%x\n",hWnd)); |
2232 | 943 |
} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
944 |
if (lockEvent()) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
945 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
946 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
947 |
while (TRUE) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
948 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
949 |
TH_DPRINTF(("TDEQ\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
950 |
ev = eventQueueHead; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
951 |
if (ev) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
952 |
{ |
1127 | 953 |
eventQueueHead = ev->ev_next; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
954 |
if (! eventQueueHead) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
955 |
{ |
1127 | 956 |
eventQueueTail = (struct queuedEvent *)0; |
957 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
958 |
if (eventempfcount != ev->count) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
959 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
960 |
printf("eventcount error %d <-> %d\n",eventempfcount,ev->count); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
961 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
962 |
eventempfcount++; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
963 |
if (ev->ev_message == WM_DESTROY) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
964 |
{ |
2260 | 965 |
if (ev->ev_arg2) |
966 |
{ |
|
2297
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
967 |
free((char*)ev->ev_arg2); |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
968 |
} |
2260 | 969 |
#ifdef TOPWINDOWCLASS |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
970 |
if (ev->ev_arg1) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
971 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
972 |
if (UnregisterClass((char*)ev->ev_arg1,(HANDLE) __getHInstance())) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
973 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
974 |
/*printf("UnregisterClass %s ok.\n",(char*)ev->ev_arg1);*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
975 |
free((char*)ev->ev_arg1); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
976 |
ev->ev_arg1 = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
977 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
978 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
979 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
980 |
/* noch einmal in die queue */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
981 |
if (ev->ev_arg2++ < 100) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
982 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
983 |
ev->ev_next = (struct queuedEvent *)0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
984 |
ev->count = eventsendcount++; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
985 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
986 |
if (eventQueueTail) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
987 |
eventQueueTail->ev_next = ev; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
988 |
} else { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
989 |
eventQueueHead = ev; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
990 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
991 |
eventQueueTail = ev; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
992 |
if (ev->ev_arg2 > 98) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
993 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
994 |
printf("UnregisterClass %s failed. Wait 1 sec.\n",(char*)ev->ev_arg1); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
995 |
unlockEvent(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
996 |
sleep(1); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
997 |
lockEvent(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
998 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
999 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1000 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1001 |
unlockEvent(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1002 |
sleep(0); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1003 |
lockEvent(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1004 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1005 |
continue; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1006 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1007 |
else /* fail evtl. später ändern und in st verzögert aufrufen */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1008 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1009 |
printf("UnregisterClass %s failed.\n",(char*)ev->ev_arg1); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1010 |
free((char*)ev->ev_arg1); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1011 |
ev->ev_arg1 = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1012 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1013 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1014 |
} |
2260 | 1015 |
#endif |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1016 |
} |
2232 | 1017 |
break; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1018 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1019 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1020 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1021 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1022 |
} |
2232 | 1023 |
if (ev) |
1024 |
{ |
|
1025 |
*ret_ev = *ev; |
|
1026 |
ev->ev_next = eventFreeList; |
|
1027 |
eventFreeList = ev; |
|
1028 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1029 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1030 |
unlockEvent(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1031 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1032 |
/*if (!ev) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1033 |
SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_NORMAL);*/ |
2232 | 1034 |
return (ev != 0); |
1127 | 1035 |
} |
1036 |
||
1037 |
static |
|
1038 |
getModifiers() |
|
1039 |
{ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1040 |
int modifiers = 0; |
1127 | 1041 |
if (GetKeyState(VK_SHIFT) & 0x8000) |
1042 |
modifiers |= ShiftMask; |
|
1043 |
if (GetKeyState(VK_CONTROL) & 0x8000) |
|
1044 |
modifiers |= ControlMask; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1045 |
#if 0 |
1127 | 1046 |
if (GetKeyState(VK_RMENU) & 0x8000) |
1047 |
modifiers |= RightAltMask; |
|
1048 |
if (GetKeyState(VK_LMENU) & 0x8000) |
|
1049 |
modifiers |= LeftAltMask; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1050 |
#else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1051 |
if (GetKeyState(VK_MENU) & 0x8000) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1052 |
modifiers |= LeftAltMask; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1053 |
#endif |
1127 | 1054 |
if (GetKeyState(VK_LBUTTON) & 0x8000) |
1055 |
modifiers |= Button1Mask; |
|
1056 |
if (GetKeyState(VK_MBUTTON) & 0x8000) |
|
1057 |
modifiers |= Button2Mask; |
|
1058 |
if (GetKeyState(VK_RBUTTON) & 0x8000) |
|
1059 |
modifiers |= Button3Mask; |
|
1060 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1061 |
__modifiers = modifiers; |
1127 | 1062 |
return modifiers; |
1063 |
} |
|
1064 |
||
1065 |
static |
|
1066 |
winEventProcessing(hWnd, message, wParam, lParam, pDefault) |
|
1067 |
HWND hWnd; /* window handle */ |
|
1068 |
UINT message; /* type of message */ |
|
1069 |
UINT wParam; /* additional information */ |
|
1070 |
LONG lParam; /* additional information */ |
|
1071 |
int *pDefault; |
|
1072 |
{ |
|
1073 |
LPMINMAXINFO lpmmi; |
|
1074 |
WINDOWPOS *posStruct; |
|
1723 | 1075 |
RECT rct; |
1076 |
RECT upd; |
|
1127 | 1077 |
int modifiers; |
1078 |
int x, y, w, h; |
|
1723 | 1079 |
int isNative = 0; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1080 |
PAINTSTRUCT ps; |
1127 | 1081 |
|
1082 |
/* |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1083 |
EVENT_PRINTF(("winEvent hWin=0x%x message=0x%x wP=0x%x lP=0x%x\n", |
1127 | 1084 |
hWnd, message, wParam, lParam)); |
1085 |
*/ |
|
1086 |
||
1087 |
||
1088 |
/* |
|
1089 |
* messages which are enqueued to be handled by the view thread |
|
1090 |
*/ |
|
1091 |
switch (message) { |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1092 |
case WM_CREATE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1093 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1094 |
CREATESTRUCT *lpcs = (LPCREATESTRUCT) lParam; // structure with creation data |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1095 |
SETLOCALWINDOWINFOPTR(hWnd,lpcs->lpCreateParams); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1096 |
if (GETLOCALWINDOWINFOPTR(hWnd) != lpcs->lpCreateParams) |
2232 | 1097 |
PRINTF(("SETLOCALWINDOWINFOPTR ERROR\n")); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1098 |
*pDefault = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1099 |
#ifdef COUNT_RESOURCES |
2232 | 1100 |
__cnt_createWindows++; |
1101 |
RESPRINTF(("CreateWindows %d\n",__cnt_createWindows)); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1102 |
#endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1103 |
DPRINTF(("WM_CREATE\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1104 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1105 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1106 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1107 |
case WM_CLOSE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1108 |
DPRINTF(("WM_CLOSE\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1109 |
if (!destroyWin) |
2232 | 1110 |
enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1111 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1112 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1113 |
destroyWin = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1114 |
if (!DestroyWindow(hWnd)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1115 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1116 |
DPRINTF(("DestroyWindow ERROR\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1117 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1118 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1119 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1120 |
*pDefault = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1121 |
return 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1122 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1123 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1124 |
case WM_DESTROY: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1125 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1126 |
char *n = 0; |
2297
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
1127 |
char *l; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1128 |
DPRINTF(("WM_DESTROY\n")); |
2297
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
1129 |
l = (char *)GETLOCALWINDOWINFOPTR(hWnd); |
2260 | 1130 |
#ifdef TOPWINDOWCLASS |
1131 |
if (l) |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1132 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1133 |
if (GETLOCALWINDOWINFOPTR(hWnd)->flag & LI_TOPWIN) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1134 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1135 |
n = (char*)malloc(200); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1136 |
GetClassName(hWnd,n,200); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1137 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1138 |
/* free all resources */ |
2232 | 1139 |
/*if (GetWindow_bgBrush(hWnd)) |
1140 |
DelObject(GetWindow_bgBrush(hWnd));*/ |
|
2260 | 1141 |
//free(GETLOCALWINDOWINFOPTR(hWnd)); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1142 |
} |
2260 | 1143 |
#endif |
1144 |
SETLOCALWINDOWINFOPTR(hWnd,0); |
|
1145 |
enqEvent(0,hWnd, message, wParam, (int)n, (int)l, 0, 0); |
|
1146 |
#ifdef COUNT_RESOURCES |
|
1147 |
__cnt_createWindows--; |
|
1148 |
RESPRINTF(("DestroyWindows %d\n",__cnt_createWindows)); |
|
1149 |
#endif |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1150 |
*pDefault = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1151 |
return 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1152 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1153 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1154 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1155 |
case WM_GETMINMAXINFO: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1156 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1157 |
lpmmi = (LPMINMAXINFO) lParam; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1158 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1159 |
DPRINTF(("WM_GETMINMAXINFO handle=%x got min: %d/%d\n", |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1160 |
hWnd, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1161 |
lpmmi->ptMinTrackSize.x, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1162 |
lpmmi->ptMinTrackSize.y)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1163 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1164 |
if (GETLOCALWINDOWINFOPTR(hWnd) && |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1165 |
GETLOCALWINDOWINFOPTR(hWnd)->minWidth && |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1166 |
GETLOCALWINDOWINFOPTR(hWnd)->maxWidth |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1167 |
) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1168 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1169 |
lpmmi->ptMaxSize.x = GETLOCALWINDOWINFOPTR(hWnd)->maxWidth; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1170 |
lpmmi->ptMaxSize.y = GETLOCALWINDOWINFOPTR(hWnd)->maxHeight; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1171 |
lpmmi->ptMaxTrackSize.x = GETLOCALWINDOWINFOPTR(hWnd)->maxWidth; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1172 |
lpmmi->ptMaxTrackSize.y = GETLOCALWINDOWINFOPTR(hWnd)->maxHeight; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1173 |
lpmmi->ptMinTrackSize.x = GETLOCALWINDOWINFOPTR(hWnd)->minWidth; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1174 |
lpmmi->ptMinTrackSize.y = GETLOCALWINDOWINFOPTR(hWnd)->minHeight; |
2151 | 1175 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1176 |
DPRINTF(("WM_GETMINMAXINFO handle=%x return min: %d/%d max: %d/%d\n", |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1177 |
hWnd, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1178 |
GETLOCALWINDOWINFOPTR(hWnd)->minWidth, GETLOCALWINDOWINFOPTR(hWnd)->minHeight, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1179 |
GETLOCALWINDOWINFOPTR(hWnd)->maxWidth, GETLOCALWINDOWINFOPTR(hWnd)->maxHeight)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1180 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1181 |
*pDefault = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1182 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1183 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1184 |
|
1127 | 1185 |
case WM_SETCURSOR: |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1186 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1187 |
HCURSOR curs; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1188 |
int hitCode; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1189 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1190 |
hitCode = LOWORD(lParam); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1191 |
if (hitCode != HTCLIENT) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1192 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1193 |
* not in client area ... |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1194 |
*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1195 |
return 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1196 |
} |
2240 | 1197 |
DDPRINTF(("WM_SETCURSOR\n")); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1198 |
curs = GetWindow_Cursor(hWnd); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1199 |
if (curs) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1200 |
SetCursor(curs); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1201 |
*pDefault = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1202 |
return 1; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1203 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1204 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1205 |
} |
1127 | 1206 |
return 0; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1207 |
|
1127 | 1208 |
case WM_WINDOWPOSCHANGED: |
1723 | 1209 |
/* |
1210 |
* ignore child window messages ... |
|
1211 |
*/ |
|
1212 |
if (GetParent(hWnd)) { |
|
1213 |
break; |
|
1214 |
} |
|
1215 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1216 |
GetClientRect(hWnd, &rct); |
1127 | 1217 |
EVENT_PRINTF(("WM_WINDOWPOSCHANGED\n")); |
2232 | 1218 |
enqEvent(0,hWnd, message, wParam, |
1127 | 1219 |
rct.left, rct.top, |
2151 | 1220 |
rct.right-rct.left, |
1221 |
rct.bottom-rct.top); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1222 |
return 0; |
2260 | 1223 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1224 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1225 |
case WM_ERASEBKGND: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1226 |
EVENT_PRINTF(("WM_ERASEBKGND\n")); |
1723 | 1227 |
if (isNative) { |
1228 |
*pDefault = 1; |
|
1229 |
return 0; |
|
1230 |
} |
|
2151 | 1231 |
*pDefault = 0; |
1723 | 1232 |
return 1; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1233 |
|
1127 | 1234 |
case WM_PAINT: |
1235 |
EVENT_PRINTF(("WM_PAINT\n")); |
|
1723 | 1236 |
if (isNative) { |
1237 |
*pDefault = 1; |
|
1238 |
return 0; |
|
1239 |
} |
|
2253 | 1240 |
if (((GetWindow_Flag(hWnd) & LI_INPUTWIN) == 0) && (__rootWinSpezial != hWnd)) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1241 |
{ |
2253 | 1242 |
if (GetUpdateRect(hWnd, &upd, FALSE)) |
2232 | 1243 |
{ |
2260 | 1244 |
if (GetWindow_eventMask(hWnd) & ExposureMask) |
1245 |
enqEvent(ExposureMask,hWnd, message, wParam, upd.left, upd.top, upd.right, upd.bottom); |
|
2232 | 1246 |
} |
1127 | 1247 |
} |
2260 | 1248 |
else |
2253 | 1249 |
pDefault = 0; |
1127 | 1250 |
return 0; |
1251 |
break; |
|
1252 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1253 |
case WM_SIZE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1254 |
EVENT_PRINTF(("WM_SIZE\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1255 |
switch(wParam) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1256 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1257 |
case SIZE_RESTORED: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1258 |
case SIZE_MAXIMIZED: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1259 |
GetClientRect(hWnd, (LPRECT) &upd); |
2151 | 1260 |
if (GetWindow_eventMask(hWnd) & ExposureMask) |
2232 | 1261 |
enqEvent(ExposureMask,hWnd, WM_PAINT, wParam, upd.left, upd.top, upd.right, upd.bottom); |
1262 |
DPRINTF(("WM_SIZE %x w %d h %d\n",hWnd,LOWORD(lParam),HIWORD(lParam))); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1263 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1264 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1265 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1266 |
|
1127 | 1267 |
case WM_SHOWWINDOW: |
1268 |
EVENT_PRINTF(("WM_SHOWWINDOW\n")); |
|
2232 | 1269 |
enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0); |
1723 | 1270 |
if (isNative) { |
1271 |
*pDefault = 1; |
|
1272 |
return 0; |
|
1273 |
} |
|
2260 | 1274 |
break; |
2253 | 1275 |
//*pDefault = 0; |
1276 |
//return 0; |
|
1127 | 1277 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1278 |
case WM_MOUSEACTIVATE : |
1127 | 1279 |
EVENT_PRINTF2(("WM_MOUSEACTIVATE h=%x\n", hWnd)); |
1280 |
*pDefault = 0; |
|
2253 | 1281 |
if ((__rootWinSpezial == hWnd) || (GetActiveWindow() && (LOWORD(lParam) == HTCLIENT)) |
1282 |
/*((GETLOCALWINDOWINFOPTR(hWnd)->flag & LI_TOPWIN) == 0) */ |
|
2247 | 1283 |
) |
1284 |
return MA_NOACTIVATE; |
|
2232 | 1285 |
else |
1286 |
{ |
|
1287 |
return MA_ACTIVATE; |
|
1288 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1289 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1290 |
|
2260 | 1291 |
case WM_NCHITTEST: |
2253 | 1292 |
EVENT_PRINTF(("WM_NCHITTEST\n")); |
2260 | 1293 |
if (hWnd == __rootWinSpezial) |
1294 |
{ |
|
2253 | 1295 |
*pDefault = 0; |
2260 | 1296 |
return HTCLIENT; |
1297 |
} |
|
2253 | 1298 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1299 |
|
2253 | 1300 |
case WM_NCACTIVATE: |
1301 |
EVENT_PRINTF(("WM_NCACTIVATE\n")); |
|
1302 |
break; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1303 |
|
1127 | 1304 |
case WM_ACTIVATE: |
2232 | 1305 |
CPRINTF(("WM_ACTIVATE %s h=%x\n", |
1127 | 1306 |
LOWORD(wParam) ? "active" : "inactive", |
1307 |
hWnd)); |
|
2260 | 1308 |
#if 1 |
1309 |
//enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0); |
|
1127 | 1310 |
switch (LOWORD(wParam)) { |
1311 |
case WA_INACTIVE: |
|
1312 |
EVENT_PRINTF2(("WM_ACTIVATE inactive h=%x\n", hWnd)); |
|
1313 |
break; |
|
1314 |
case WA_ACTIVE: |
|
1315 |
EVENT_PRINTF2(("WM_ACTIVATE active h=%x\n", hWnd)); |
|
2244 | 1316 |
if (currentCapture == CAPTURE_NONE) |
1317 |
{ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1318 |
POINT p; |
2232 | 1319 |
HWND hWndChild,hWndTemp; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1320 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1321 |
p.x = evRootX; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1322 |
p.y = evRootY; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1323 |
ScreenToClient(hWnd, &p); |
2244 | 1324 |
hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p); |
1325 |
do |
|
1326 |
{ |
|
1327 |
hWndTemp = hWndChild; |
|
1328 |
hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT); |
|
1329 |
} while ((hWndChild) && (hWndChild != hWndTemp)); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1330 |
/*printf("WM_ACTIVATE active h=%x p=%d.%d in %x\n", hWnd,p.x,p.y,hWndChild);*/ |
2232 | 1331 |
if (hWndChild /*&& (hWndChild != hWnd)*/) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1332 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1333 |
modifiers = getModifiers(); |
2232 | 1334 |
if (hWndChild != currentPointerView) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1335 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1336 |
if (currentPointerView) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1337 |
{ |
2325 | 1338 |
if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask) |
2232 | 1339 |
enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1340 |
currentPointerView = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1341 |
} |
2232 | 1342 |
if (GetWindow_eventMask(hWndChild) & EnterWindowMask) |
1343 |
enqEvent(EnterWindowMask,hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers); |
|
1344 |
//SetFocus(hWndChild); |
|
1345 |
currentPointerView = hWndChild; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1346 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1347 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1348 |
} |
1127 | 1349 |
break; |
1350 |
case WA_CLICKACTIVE: |
|
1351 |
EVENT_PRINTF2(("WM_ACTIVATE clkactive h=%x\n", hWnd)); |
|
1352 |
break; |
|
1353 |
default: |
|
1354 |
EVENT_PRINTF2(("WM_ACTIVATE ? h=%x\n", hWnd)); |
|
1355 |
break; |
|
1356 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1357 |
if (isNative) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1358 |
*pDefault = 1; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1359 |
return 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1360 |
} |
2232 | 1361 |
*pDefault = 0; |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1362 |
return 0; |
2253 | 1363 |
#endif |
2260 | 1364 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1365 |
|
1127 | 1366 |
case WM_SYSCHAR: |
1367 |
EVENT_PRINTF2(("WM_SYSCHAR h=%x %x\n", hWnd, wParam)); |
|
1368 |
goto commonChar; |
|
1369 |
||
1370 |
case WM_CHAR: |
|
1371 |
EVENT_PRINTF2(("WM_CHAR h=%x %x\n", hWnd, wParam)); |
|
1372 |
commonChar: |
|
1723 | 1373 |
if (isNative) { |
1374 |
*pDefault = 1; |
|
1375 |
return 0; |
|
1376 |
} |
|
1127 | 1377 |
modifiers = getModifiers(); |
1378 |
{ |
|
1379 |
POINT p; |
|
1380 |
||
1381 |
p.x = evRootX; |
|
1382 |
p.y = evRootY; |
|
1383 |
ScreenToClient(hWnd, &p); |
|
1384 |
x = p.x; |
|
1385 |
y = p.y; |
|
1386 |
} |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1387 |
if (currentPointerView) { |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1388 |
int evMask = GetWindow_eventMask(currentPointerView); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1389 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1390 |
if (evMask & KeyPressMask) |
2232 | 1391 |
enqEvent(KeyPressMask,currentPointerView, WM_KEYDOWN, wParam, x, y, lParam, modifiers | TRANSLATED_KEY); |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1392 |
if (evMask & KeyReleaseMask) |
2232 | 1393 |
enqEvent(KeyReleaseMask,currentPointerView, WM_KEYUP, wParam, x, y, lParam, modifiers | TRANSLATED_KEY); |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1394 |
} else { |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1395 |
int evMask = GetWindow_eventMask(hWnd); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1396 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1397 |
if (evMask & KeyPressMask) |
2232 | 1398 |
enqEvent(KeyPressMask,hWnd, WM_KEYDOWN, wParam, x, y, lParam, modifiers | TRANSLATED_KEY); |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1399 |
if (evMask & KeyReleaseMask) |
2232 | 1400 |
enqEvent(KeyReleaseMask,hWnd, WM_KEYUP, wParam, x, y, lParam, modifiers | TRANSLATED_KEY); |
1401 |
} |
|
1127 | 1402 |
*pDefault = 0; |
1403 |
return 0; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1404 |
|
2151 | 1405 |
case WM_KEYUP: |
1406 |
EVENT_PRINTF2(("WM_KEYUP h=%x %x\n", hWnd, wParam)); |
|
1407 |
goto commonKeyUp; |
|
1408 |
||
1127 | 1409 |
case WM_SYSKEYUP: |
1410 |
EVENT_PRINTF2(("WM_SYSKEYUP %x\n, wParam")); |
|
2151 | 1411 |
commonKeyUp: |
1412 |
if (isNative) { |
|
1413 |
*pDefault = 1; |
|
1414 |
return 0; |
|
1415 |
} |
|
1416 |
modifiers = getModifiers(); |
|
1417 |
{ |
|
1418 |
POINT p; |
|
1419 |
||
1420 |
p.x = evRootX; |
|
1421 |
p.y = evRootY; |
|
1422 |
ScreenToClient(hWnd, &p); |
|
1423 |
x = p.x; |
|
1424 |
y = p.y; |
|
1425 |
} |
|
1426 |
||
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1427 |
if (currentPointerView) { |
2232 | 1428 |
if (GetWindow_eventMask(currentPointerView) & KeyReleaseMask) |
1429 |
enqEvent(KeyReleaseMask,currentPointerView, message, wParam, x, y, lParam, modifiers); |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1430 |
} else { |
2232 | 1431 |
if (GetWindow_eventMask(hWnd) & KeyReleaseMask) |
1432 |
enqEvent(KeyReleaseMask,hWnd, message, wParam, x, y, lParam, modifiers); |
|
1433 |
} |
|
2151 | 1434 |
*pDefault = 0; |
1435 |
return 0; |
|
1127 | 1436 |
|
1437 |
case WM_SYSKEYDOWN: |
|
1438 |
EVENT_PRINTF2(("WM_SYSKEYDOWN %x\n, wParam")); |
|
1439 |
goto commonKey; |
|
1440 |
||
1441 |
case WM_KEYDOWN: |
|
1442 |
EVENT_PRINTF2(("WM_KEYDOWN h=%x %x\n", hWnd, wParam)); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1443 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1444 |
/* while debugging ... */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1445 |
if (wParam == VK_ESCAPE) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1446 |
ReleaseCapture(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1447 |
currentCapture = CAPTURE_NONE; |
2244 | 1448 |
CPRINTF(("ReleaseCapture <ESC>\n")); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1449 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1450 |
|
1127 | 1451 |
commonKey: |
1723 | 1452 |
if (isNative) { |
1453 |
*pDefault = 1; |
|
1454 |
return 0; |
|
1455 |
} |
|
1127 | 1456 |
modifiers = getModifiers(); |
1457 |
{ |
|
1458 |
POINT p; |
|
1459 |
||
1460 |
p.x = evRootX; |
|
1461 |
p.y = evRootY; |
|
1462 |
ScreenToClient(hWnd, &p); |
|
1463 |
x = p.x; |
|
1464 |
y = p.y; |
|
1465 |
} |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1466 |
if (currentPointerView) { |
2232 | 1467 |
if (GetWindow_eventMask(currentPointerView) & KeyPressMask) |
1468 |
enqEvent(KeyPressMask,currentPointerView, message, wParam, x, y, lParam, modifiers); |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1469 |
} else { |
2232 | 1470 |
if (GetWindow_eventMask(hWnd) & KeyPressMask) |
1471 |
enqEvent(KeyPressMask,hWnd, message, wParam, x, y, lParam, modifiers); |
|
1472 |
} |
|
1127 | 1473 |
*pDefault = 0; |
1474 |
return 0; |
|
1475 |
||
1476 |
case WM_MOUSEMOVE: |
|
1705 | 1477 |
EVENT_PRINTF3(("WM_MOUSEMOVE h=%x\n", hWnd)); |
1723 | 1478 |
if (isNative) { |
1479 |
*pDefault = 1; |
|
1480 |
return 0; |
|
1481 |
} |
|
1482 |
||
1127 | 1483 |
{ |
1484 |
short x, y; |
|
1485 |
||
2232 | 1486 |
x = (int)(short)LOWORD(lParam); |
1487 |
y = (int)(short)HIWORD(lParam); |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1488 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1489 |
modifiers = getModifiers(); |
1723 | 1490 |
|
2232 | 1491 |
if (currentCapture == CAPTURE_NONE) |
2244 | 1492 |
{ |
1493 |
if (hWnd != currentPointerView) { |
|
1494 |
if (currentPointerView) { |
|
2325 | 1495 |
if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask) |
2244 | 1496 |
enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers); |
1497 |
currentPointerView = 0; |
|
1498 |
} |
|
1499 |
if (GetWindow_eventMask(hWnd) & EnterWindowMask) |
|
1500 |
enqEvent(EnterWindowMask,hWnd, __WM_MOUSEENTER, 0, x, y, 0, modifiers); |
|
1501 |
currentPointerView = hWnd; |
|
1502 |
} |
|
1503 |
CPRINTF(("MouseMove %x\n",currentPointerView)); |
|
1504 |
} |
|
1505 |
else |
|
1506 |
{ |
|
1507 |
CPRINTF(("MouseMove Capture %x\n",currentPointerView)); |
|
1508 |
} |
|
2232 | 1509 |
if ( (GetWindow_eventMask(currentPointerView) & PointerMotionMask) |
2151 | 1510 |
|| (modifiers & (Button1Mask|Button2Mask|Button3Mask)) |
1511 |
) |
|
2232 | 1512 |
enqEvent(PointerMotionMask,currentPointerView, message, wParam, x, y, 0, modifiers); |
1127 | 1513 |
} |
1514 |
*pDefault = 0; |
|
1515 |
return 0; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1516 |
|
2151 | 1517 |
case WM_LBUTTONUP: |
1518 |
case WM_MBUTTONUP: |
|
1519 |
case WM_RBUTTONUP: |
|
1520 |
if (isNative) { |
|
1521 |
*pDefault = 1; |
|
1522 |
return 0; |
|
1523 |
} |
|
1524 |
||
1525 |
if (currentCapture == CAPTURE_IMPLICIT) { |
|
1526 |
currentCapture = CAPTURE_NONE; |
|
1527 |
ReleaseCapture(); |
|
2244 | 1528 |
CPRINTF(("ReleaseCapture <BUTTONUP>\n")); |
2151 | 1529 |
} |
1530 |
modifiers = getModifiers(); |
|
1531 |
EVENT_PRINTF3(("WM_BUTTONUP h=%x pos=%d/%d\n", |
|
2232 | 1532 |
hWnd, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam))); |
2151 | 1533 |
|
1534 |
||
1535 |
if (GetWindow_eventMask(hWnd) & ButtonReleaseMask) |
|
2232 | 1536 |
enqEvent(ButtonReleaseMask,hWnd, message, wParam, (int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam), |
2151 | 1537 |
wParam,modifiers); |
1538 |
*pDefault = 0; |
|
1539 |
break; |
|
1540 |
||
1127 | 1541 |
case WM_LBUTTONDOWN: |
1542 |
case WM_MBUTTONDOWN: |
|
1543 |
case WM_RBUTTONDOWN: |
|
1723 | 1544 |
if (isNative) { |
1545 |
*pDefault = 1; |
|
1546 |
return 0; |
|
1547 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1548 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1549 |
if (currentCapture == CAPTURE_NONE) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1550 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1551 |
currentCapture = CAPTURE_IMPLICIT; |
2232 | 1552 |
//SetFocus(hWnd); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1553 |
SetCapture(hWnd); |
2244 | 1554 |
CPRINTF(("SetCapture <BUTTONDOWN>%x\n",hWnd)); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1555 |
} |
1127 | 1556 |
goto commonButton; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1557 |
|
1127 | 1558 |
case WM_LBUTTONDBLCLK: |
1559 |
case WM_MBUTTONDBLCLK: |
|
1560 |
case WM_RBUTTONDBLCLK: |
|
1723 | 1561 |
if (isNative) { |
1562 |
*pDefault = 1; |
|
1563 |
return 0; |
|
1564 |
} |
|
1127 | 1565 |
commonButton: |
1566 |
modifiers = getModifiers(); |
|
2151 | 1567 |
EVENT_PRINTF3(("WM_BUTTONDOWN h=%x pos=%d/%d\n", |
1127 | 1568 |
hWnd, LOWORD(lParam), HIWORD(lParam))); |
1723 | 1569 |
|
2151 | 1570 |
|
1571 |
if (GetWindow_eventMask(hWnd) & ButtonPressMask) |
|
2232 | 1572 |
enqEvent(ButtonPressMask,hWnd, message, wParam, (int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam), |
2151 | 1573 |
wParam,modifiers); |
1127 | 1574 |
*pDefault = 0; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1575 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1576 |
|
2232 | 1577 |
case WM_CAPTURECHANGED: |
1578 |
CPRINTF(("WM_CAPTURECHANGED %x to %x\n",hWnd,lParam)); |
|
1579 |
break; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1580 |
|
1127 | 1581 |
case WM_KILLFOCUS: |
2232 | 1582 |
CPRINTF(("WM_KILLFOCUS\n")); |
1583 |
//enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0); |
|
1723 | 1584 |
if (isNative) { |
1585 |
*pDefault = 1; |
|
1586 |
return 0; |
|
1587 |
} |
|
2232 | 1588 |
*pDefault = 0; |
1589 |
return 0; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1590 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1591 |
|
1127 | 1592 |
case WM_SETFOCUS: |
2232 | 1593 |
CPRINTF(("WM_SETFOCUS %x\n",hWnd)); |
1594 |
#if 0 |
|
1595 |
//enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0); |
|
1596 |
{ |
|
1597 |
POINT p; |
|
1598 |
HWND hWndChild,hWndTemp; |
|
1599 |
||
2244 | 1600 |
p.x = evRootX; |
1601 |
p.y = evRootY; |
|
1602 |
ScreenToClient(hWnd, &p); |
|
1603 |
hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p); |
|
1604 |
do |
|
1605 |
{ |
|
1606 |
hWndTemp = hWndChild; |
|
1607 |
hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT); |
|
1608 |
} while ((hWndChild) && (hWndChild != hWndTemp)); |
|
2232 | 1609 |
/*printf("WM_ACTIVATE active h=%x p=%d.%d in %x\n", hWnd,p.x,p.y,hWndChild);*/ |
1610 |
if (hWndChild /*&& (hWndChild != hWnd)*/) |
|
1611 |
{ |
|
1612 |
modifiers = getModifiers(); |
|
1613 |
if (hWndChild != currentPointerView) |
|
1614 |
{ |
|
1615 |
if (currentPointerView) |
|
1616 |
{ |
|
2325 | 1617 |
if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask) |
2232 | 1618 |
enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers); |
1619 |
currentPointerView = 0; |
|
1620 |
} |
|
1621 |
if (GetWindow_eventMask(hWndChild) & EnterWindowMask) |
|
1622 |
enqEvent(EnterWindowMask,hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers); |
|
1623 |
//SetFocus(hWndChild); |
|
1624 |
currentPointerView = hWndChild; |
|
1625 |
} |
|
1626 |
} |
|
1627 |
} |
|
2253 | 1628 |
#endif |
1723 | 1629 |
if (isNative) { |
1630 |
*pDefault = 1; |
|
1631 |
return 0; |
|
1632 |
} |
|
2232 | 1633 |
*pDefault = 0; |
2253 | 1634 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1635 |
|
1723 | 1636 |
case WM_STYLECHANGING: |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1637 |
UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGING\n")); |
1723 | 1638 |
break; |
1639 |
||
1640 |
case WM_STYLECHANGED: |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1641 |
UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGED\n")); |
1723 | 1642 |
break; |
1643 |
||
1127 | 1644 |
case WM_GETTEXT: |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1645 |
/*EVENT_PRINTF(("WM_GETTEXT %x\n", message));*/ |
1127 | 1646 |
break; |
1647 |
||
1648 |
case WM_GETTEXTLENGTH: |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1649 |
EVENT_PRINTF(("WM_GETTEXTLENGTH %x\n", message)); |
1127 | 1650 |
break; |
1651 |
||
1652 |
case WM_NCCREATE: |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1653 |
EVENT_PRINTF(("WM_NCCREATE %x\n", message)); |
1127 | 1654 |
break; |
1655 |
||
1656 |
case WM_NCMOUSEMOVE: |
|
1723 | 1657 |
{ |
1658 |
short x, y; |
|
1659 |
||
2232 | 1660 |
x = (int)(short)LOWORD(lParam); |
1661 |
y = (int)(short)HIWORD(lParam); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1662 |
EVENT_PRINTF(("WM_NCMOUSEMOVE %d/%d\n", x, y)); |
1723 | 1663 |
lastNCMouseX = x; |
1664 |
lastNCMouseY = y; |
|
2325 | 1665 |
|
1666 |
modifiers = getModifiers(); |
|
1667 |
||
1668 |
if (currentCapture == CAPTURE_NONE) |
|
1669 |
{ |
|
1670 |
if (hWnd != currentPointerView) { |
|
1671 |
if (currentPointerView) { |
|
1672 |
if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask) |
|
1673 |
enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers); |
|
1674 |
currentPointerView = 0; |
|
1675 |
} |
|
1676 |
} |
|
1677 |
} |
|
1678 |
} |
|
1679 |
*pDefault = 0; |
|
1680 |
return 0; |
|
1127 | 1681 |
break; |
1682 |
||
1683 |
case WM_PARENTNOTIFY: |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1684 |
EVENT_PRINTF2(("WM_PARENTNOTIFY h=%x hChild=%x %d\n", |
1127 | 1685 |
hWnd, lParam, LOWORD(wParam))); |
1686 |
break; |
|
1687 |
||
1688 |
case WM_NCLBUTTONDOWN: |
|
1689 |
EVENT_PRINTF(("WM_NCLBUTTONDOWN\n")); |
|
1723 | 1690 |
{ |
1691 |
short x, y; |
|
1692 |
||
2232 | 1693 |
x = (int)(short)LOWORD(lParam); |
1694 |
y = (int)(short)HIWORD(lParam); |
|
1723 | 1695 |
lastNCMouseX = x; |
1696 |
lastNCMouseY = y; |
|
1697 |
} |
|
1698 |
break; |
|
1699 |
||
1700 |
case WM_NCLBUTTONUP: |
|
1701 |
EVENT_PRINTF(("WM_NCLBUTTONUP\n")); |
|
1702 |
break; |
|
1703 |
||
1704 |
case WM_NCRBUTTONDOWN: |
|
1705 |
EVENT_PRINTF(("WM_NCRBUTTONDOWN\n")); |
|
1706 |
break; |
|
1707 |
||
1708 |
case WM_NCRBUTTONUP: |
|
1709 |
EVENT_PRINTF(("WM_NCRBUTTONUP\n")); |
|
1710 |
break; |
|
1711 |
||
1712 |
case WM_NCMBUTTONDOWN: |
|
1713 |
EVENT_PRINTF(("WM_NCMBUTTONDOWN\n")); |
|
1714 |
break; |
|
1715 |
||
1716 |
case WM_NCMBUTTONUP: |
|
1717 |
EVENT_PRINTF(("WM_NCMBUTTONUP\n")); |
|
1127 | 1718 |
break; |
1719 |
||
1720 |
case WM_SETTEXT: |
|
1721 |
EVENT_PRINTF(("WM_SETTEXT\n")); |
|
1722 |
break; |
|
1723 |
||
1724 |
case 0x88: |
|
1725 |
EVENT_PRINTF(("0x88 (undoc)\n")); |
|
1726 |
break; |
|
1727 |
||
1728 |
case WM_NCCALCSIZE: |
|
1729 |
EVENT_PRINTF(("WM_NCCALCSIZE\n")); |
|
1730 |
break; |
|
1731 |
||
1732 |
case WM_NCPAINT: |
|
1705 | 1733 |
EVENT_PRINTF3(("WM_NCPAINT\n")); |
1127 | 1734 |
break; |
1735 |
||
1736 |
case WM_SYSCOMMAND: |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1737 |
switch (wParam & ~0x000F) { |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1738 |
case SC_CLOSE: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1739 |
EVENT_PRINTF2(("WM_SYSCOMMAND SC_CLOSE\n")); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1740 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1741 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1742 |
case SC_MOVE: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1743 |
EVENT_PRINTF2(("WM_SYSCOMMAND SC_MOVE\n")); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1744 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1745 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1746 |
case SC_RESTORE: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1747 |
EVENT_PRINTF2(("WM_SYSCOMMAND SC_RESTORE\n")); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1748 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1749 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1750 |
case SC_SIZE: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1751 |
EVENT_PRINTF2(("WM_SYSCOMMAND SC_SIZE\n")); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1752 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1753 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1754 |
default: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1755 |
EVENT_PRINTF2(("WM_SYSCOMMAND %x\n", wParam)); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1756 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1757 |
} |
1127 | 1758 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1759 |
|
1127 | 1760 |
case WM_INITMENU: |
1761 |
EVENT_PRINTF(("WM_INITMENU\n")); |
|
1762 |
break; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1763 |
|
1127 | 1764 |
case WM_INITMENUPOPUP: |
1765 |
EVENT_PRINTF(("WM_INITMENUPOPUP\n")); |
|
1766 |
break; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1767 |
|
1127 | 1768 |
case WM_ENTERIDLE: |
1769 |
EVENT_PRINTF(("WM_ENTERIDLE\n")); |
|
1770 |
break; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1771 |
|
1127 | 1772 |
case WM_ENTERMENULOOP: |
1773 |
EVENT_PRINTF(("WM_ENTERMENULOOP\n")); |
|
1774 |
break; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1775 |
|
1127 | 1776 |
case WM_EXITMENULOOP: |
1777 |
EVENT_PRINTF(("WM_EXITMENULOOP\n")); |
|
1778 |
break; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1779 |
|
1127 | 1780 |
case WM_MENUSELECT: |
1781 |
EVENT_PRINTF(("WM_MENUSELECT\n")); |
|
1782 |
break; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1783 |
|
1127 | 1784 |
case WM_QUIT: |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1785 |
UNHANDLED_EVENT_PRINTF(("WM_QUIT\n")); |
1127 | 1786 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1787 |
|
1127 | 1788 |
case WM_NCDESTROY: |
1789 |
EVENT_PRINTF(("WM_NCDESTROY\n")); |
|
1790 |
break; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1791 |
|
1127 | 1792 |
case WM_QUERYNEWPALETTE: |
1793 |
EVENT_PRINTF(("WM_QUERYNEWPALETTE\n")); |
|
1794 |
break; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1795 |
|
1127 | 1796 |
case WM_PALETTECHANGED: |
1797 |
EVENT_PRINTF(("WM_PALETTECHANGED\n")); |
|
1798 |
break; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1799 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1800 |
case WM_ACTIVATEAPP: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1801 |
EVENT_PRINTF2(("WM_ACTIVATEAPP %s\n", wParam ? "active" : "inactive")); |
1723 | 1802 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1803 |
|
1127 | 1804 |
case WM_SYSDEADCHAR: |
1805 |
EVENT_PRINTF2(("WM_SYSDEADCHAR %x\n, wParam")); |
|
1806 |
break; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1807 |
|
1127 | 1808 |
case WM_DEADCHAR: |
1809 |
EVENT_PRINTF2(("WM_DEADCHAR %x\n, wParam")); |
|
1810 |
break; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1811 |
|
1127 | 1812 |
case WM_PAINTICON: |
1813 |
EVENT_PRINTF(("WM_PAINTICON\n")); |
|
1814 |
break; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1815 |
|
1127 | 1816 |
case WM_ICONERASEBKGND: |
1817 |
EVENT_PRINTF(("WM_ICONERASEBKGND\n")); |
|
1818 |
break; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1819 |
|
1127 | 1820 |
case WM_WINDOWPOSCHANGING: |
1821 |
EVENT_PRINTF(("WM_WINDOWPOSCHANGING\n")); |
|
1822 |
break; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1823 |
|
1127 | 1824 |
case WM_QUERYOPEN: |
1825 |
EVENT_PRINTF(("WM_QUERYOPEN\n")); |
|
1826 |
break; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1827 |
|
1127 | 1828 |
case WM_QUERYENDSESSION: |
1829 |
EVENT_PRINTF(("WM_QUERYENDSESSION\n")); |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1830 |
enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0); |
1127 | 1831 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1832 |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1833 |
case WM_FONTCHANGE: |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1834 |
UNHANDLED_EVENT_PRINTF(("WM_FONTCHANGE\n")); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1835 |
enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0); |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1836 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1837 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1838 |
case WM_SYSCOLORCHANGE: |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1839 |
EVENT_PRINTF(("WM_SYSCOLORCHANGE\n")); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1840 |
enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1841 |
break; |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1842 |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1843 |
case WM_MOVING: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1844 |
EVENT_PRINTF(("WM_MOVING\n")); |
1705 | 1845 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1846 |
|
1705 | 1847 |
case WM_SIZING: |
1848 |
EVENT_PRINTF(("WM_SIZING\n")); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1849 |
/*__debugEvent__();*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1850 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1851 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1852 |
case WM_EXITSIZEMOVE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1853 |
EVENT_PRINTF(("WM_EXITSIZEMOVE\n")); |
1705 | 1854 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1855 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1856 |
case WM_ENTERSIZEMOVE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1857 |
EVENT_PRINTF(("WM_ENTERSIZEMOVE\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1858 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1859 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1860 |
case WM_MOVE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1861 |
EVENT_PRINTF(("WM_MOVE\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1862 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1863 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1864 |
case WM_POWER: |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1865 |
UNHANDLED_EVENT_PRINTF(("WM_POWER\n")); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1866 |
enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1867 |
break; |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1868 |
|
1127 | 1869 |
default: |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1870 |
UNHANDLED_EVENT_PRINTF(("WinWorkstat [info]: unhandled msg = %x\n", message)); |
1127 | 1871 |
break; |
1872 |
} |
|
1873 |
return 0; |
|
1874 |
} |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1875 |
|
2151 | 1876 |
LONG APIENTRY |
1877 |
MainWndProc(HWND hWnd,UINT message,UINT wParam,LONG lParam); |
|
1878 |
||
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1879 |
static void _USERENTRY |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
1880 |
dispatchThread(void *arg) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1881 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1882 |
static int th_calls; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1883 |
RECT rect; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1884 |
MSG msg; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1885 |
localWindowInfo *li; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1886 |
_dispatchThreadId = GetCurrentThreadId(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1887 |
TH_DPRINTF(("TS %d\n", th_calls++)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1888 |
PeekMessage(&msg,NULL,0,0,PM_NOREMOVE); /* must be */ |
2232 | 1889 |
#ifndef WIN32THREADS |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1890 |
AttachThreadInput(_dispatchThreadId,_masterThreadId,TRUE); |
2232 | 1891 |
#endif |
2151 | 1892 |
/*SetThreadPriority(_masterThread,THREAD_PRIORITY_HIGHEST); |
1893 |
SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_ABOVE_NORMAL);*/ |
|
1894 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1895 |
GetWindowRect(GetDesktopWindow(), &rect); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1896 |
/* allocate localMemory for Window */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1897 |
li = (localWindowInfo*)malloc(sizeof(localWindowInfo)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1898 |
if (li) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1899 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1900 |
memset(li,0,sizeof(*_thread_local)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1901 |
} |
2232 | 1902 |
|
2253 | 1903 |
__rootWinSpezial = CreateWindowEx( WS_EX_TOOLWINDOW|WS_EX_TRANSPARENT,app_nameroot,app_nameroot, |
2260 | 1904 |
WS_POPUP|WS_DISABLED, |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1905 |
0,0, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1906 |
rect.right-rect.left,rect.bottom-rect.top, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1907 |
0,0,(HANDLE) __getHInstance(),li); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1908 |
|
2151 | 1909 |
/*printf("__rootWinSpezial %x\n",__rootWinSpezial);*/ |
2253 | 1910 |
//ShowWindow(__rootWinSpezial,SW_SHOWNOACTIVATE); |
2232 | 1911 |
SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1912 |
SetEvent(hCreateEvent); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1913 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1914 |
while (bdispatchThreadState) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1915 |
{ |
2325 | 1916 |
HANDLE dummy; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1917 |
TH_DPRINTF(("TG %d\n", th_calls++)); |
2325 | 1918 |
if (currentPointerView) |
1919 |
{ |
|
1920 |
while (PeekMessage(&msg,0,0,0,PM_NOREMOVE) == 0) |
|
1921 |
{ |
|
1922 |
if (MsgWaitForMultipleObjects(0,&dummy,FALSE,200,QS_ALLINPUT) == WAIT_TIMEOUT) |
|
1923 |
{ |
|
1924 |
POINT point; |
|
1925 |
if (GetCursorPos(&point)) |
|
1926 |
{ |
|
1927 |
HWND hWnd = WindowFromPoint(point); |
|
1928 |
if (hWnd) |
|
1929 |
{ |
|
1930 |
if (GetWindowThreadProcessId(hWnd,0) != GetCurrentThreadId()) |
|
1931 |
{ |
|
1932 |
if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask) |
|
1933 |
enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers()); |
|
1934 |
currentPointerView = 0; |
|
1935 |
break; |
|
1936 |
} |
|
1937 |
} |
|
1938 |
} |
|
1939 |
} |
|
1940 |
} |
|
1941 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1942 |
GetMessage(&msg, NULL, 0, 0); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1943 |
TH_DPRINTF(("TD %d\n", th_calls++)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1944 |
destroyWin = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1945 |
if (msg.message == WM_THREADDESTROYWINDOW) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1946 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1947 |
destroyWin = TRUE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1948 |
msg.message = WM_CLOSE; |
2232 | 1949 |
CPRINTF(("thread WM_THREADDESTROYWINDOW %x\n",msg.hwnd)); |
1950 |
} |
|
1951 |
else if (msg.message == WM_THREADSETFOCUS) |
|
1952 |
{ |
|
2253 | 1953 |
#ifdef xxWIN32THREADS |
2232 | 1954 |
if (msg.lParam) |
1955 |
{ |
|
1956 |
if (AttachThreadInput(_dispatchThreadId,msg.lParam,TRUE) == FALSE) |
|
2240 | 1957 |
PRINTF(("SetFocus AttachThreadInput error %d\n",GetLastError())); |
2232 | 1958 |
} |
1959 |
#endif |
|
1960 |
CPRINTF(("threadSetfocus %x\n",msg.wParam)); |
|
2260 | 1961 |
//SetForegroundWindow((HWND)msg.wParam); |
2253 | 1962 |
//SetWindowPos((HWND)msg.wParam, HWND_TOP, 0, 0, 0, 0, SWP_NOOWNERZORDER |SWP_NOACTIVATE | SWP_NOMOVE|SWP_NOSIZE); |
2232 | 1963 |
SetFocus((HWND)msg.wParam); |
1964 |
continue; |
|
1965 |
} |
|
2247 | 1966 |
else if (msg.message == WM_THREADSETCURSOR) |
1967 |
{ |
|
1968 |
if (msg.lParam) |
|
1969 |
{ |
|
2260 | 1970 |
POINT p; |
1971 |
||
1972 |
GetCursorPos(&p); |
|
1973 |
if (WindowFromPoint(p) == msg.hwnd) |
|
1974 |
{ |
|
2247 | 1975 |
CPRINTF(("threadSetCursor %x\n",msg.lParam)); |
1976 |
SetCursor((HCURSOR)msg.lParam); |
|
2260 | 1977 |
} |
2247 | 1978 |
} |
1979 |
continue; |
|
1980 |
} |
|
2232 | 1981 |
else if (msg.message == WM_THREADSETCAPTURE) |
1982 |
{ |
|
1983 |
if (msg.wParam) |
|
1984 |
{ |
|
2325 | 1985 |
if (currentPointerView) |
1986 |
{ |
|
1987 |
if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask) |
|
1988 |
enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers()); |
|
1989 |
} |
|
2244 | 1990 |
currentPointerView = msg.wParam; |
1991 |
currentCapture = CAPTURE_EXPLICIT; |
|
2232 | 1992 |
CPRINTF(("threadSetCapture %x\n",msg.wParam)); |
2244 | 1993 |
SetCapture(currentPointerView); |
2232 | 1994 |
} |
2244 | 1995 |
else |
1996 |
{ |
|
2260 | 1997 |
if (currentPointerView == __rootWinSpezial) |
1998 |
{ |
|
1999 |
//ShowWindow(__rootWinSpezial, SW_HIDE); |
|
2000 |
SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0,SWP_NOREDRAW|SWP_NOSENDCHANGING|SWP_NOCOPYBITS |
|
2001 |
|SWP_HIDEWINDOW| SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE/*| SWP_NOZORDER|SWP_NOOWNERZORDER*/); |
|
2002 |
} |
|
2244 | 2003 |
currentPointerView = 0; |
2004 |
currentCapture = CAPTURE_NONE; |
|
2232 | 2005 |
CPRINTF(("threadReleaseCapture\n")); |
2244 | 2006 |
ReleaseCapture(); |
2007 |
} |
|
2232 | 2008 |
if (msg.lParam) |
2009 |
{ |
|
2244 | 2010 |
CPRINTF(("threadSetCursor %x\n",msg.lParam)); |
2232 | 2011 |
SetCursor((HCURSOR)msg.lParam); |
2244 | 2012 |
} |
2232 | 2013 |
continue; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2014 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2015 |
else if (msg.message == WM_THREADCREATEWINDOW) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2016 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2017 |
TH_DPRINTF(("C %d\n", th_calls)); |
2244 | 2018 |
if (_thread_winStyleBits & WS_POPUP) |
2019 |
{ |
|
2020 |
//_thread_parentHandle = GetActiveWindow(); |
|
2021 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2022 |
_thread_newWinHandle = CreateWindowEx( |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2023 |
_thread_winStyleBitsEx, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2024 |
_thread_className, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2025 |
_thread_windowName, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2026 |
_thread_winStyleBits, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2027 |
_thread_x, _thread_y, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2028 |
_thread_dx,_thread_dy, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2029 |
_thread_parentHandle, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2030 |
NULL, /* menu */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2031 |
(HANDLE) __getHInstance(), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2032 |
_thread_local); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2033 |
SetEvent(hCreateEvent); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2034 |
continue; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2035 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2036 |
/* TranslateMessage(&msg); */ /* Translates virtual key codes */ |
2151 | 2037 |
if ( (msg.message == WM_KEYDOWN) |
2038 |
|| (msg.message == WM_KEYUP) |
|
2039 |
|| (msg.message == WM_SYSKEYDOWN) |
|
2040 |
|| (msg.message == WM_SYSKEYUP) |
|
2041 |
) |
|
2042 |
{ |
|
2232 | 2043 |
#ifdef xxDEBUG |
2044 |
if ((msg.wParam == 0x11) && (msg.message == WM_KEYDOWN))/* CTRL-C */ |
|
2045 |
{ |
|
2046 |
if (c_count++ > 3) /* for debugging */ |
|
2047 |
exit(1); |
|
2048 |
} |
|
2049 |
#endif |
|
2151 | 2050 |
/*printf("keymsg %x\n",msg.wParam);*/ |
2051 |
if ( |
|
2052 |
((msg.wParam >= '0') && (msg.wParam <= 'Z')) |
|
2053 |
|| (msg.wParam == 0x20) |
|
2054 |
|| (msg.wParam == 0x14) |
|
2055 |
/*|| (msg.wParam == 0x10)*/ |
|
2056 |
|| (msg.wParam >= 0xB0) |
|
2057 |
) |
|
2058 |
{ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2059 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2060 |
* translate to a WM_CHAR message |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2061 |
*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2062 |
if (TranslateMessage(&msg)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2063 |
continue; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2064 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2065 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2066 |
evRootX = msg.pt.x; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2067 |
evRootY = msg.pt.y; |
2151 | 2068 |
lastMSGTime = msg.time; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2069 |
DispatchMessage(&msg); /* Dispatches message to window */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2070 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2071 |
return 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2072 |
} |
1127 | 2073 |
|
2074 |
LONG APIENTRY |
|
2151 | 2075 |
MainWndProc(HWND hWnd,UINT message,UINT wParam,LONG lParam) |
1127 | 2076 |
{ |
2077 |
int wantDefault = 1; |
|
2078 |
int retVal; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2079 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2080 |
TH_DPRINTF(("TMW %d\n",message)); |
1127 | 2081 |
retVal = winEventProcessing(hWnd, message, wParam, lParam, &wantDefault); |
2082 |
if (wantDefault) { |
|
1723 | 2083 |
DDPRINTF((">>DefWindowProc\n")); |
1127 | 2084 |
retVal = DefWindowProc(hWnd, message, wParam, lParam); |
1723 | 2085 |
DDPRINTF(("<<DefWindowProc\n")); |
1127 | 2086 |
} |
2087 |
return retVal; |
|
2088 |
} |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
2089 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
2090 |
static int CALLBACK |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2091 |
EnumFPTypeFaceProc( lplf, lptm, dwType, lpData ) |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2092 |
LOGFONT* lplf; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2093 |
TEXTMETRIC* lptm; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2094 |
DWORD dwType; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2095 |
LPARAM lpData; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2096 |
{ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2097 |
OBJ t; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2098 |
OBJ* refToList; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2099 |
OBJ typeFaceList; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2100 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2101 |
if (lplf) { |
2151 | 2102 |
refToList = (OBJ*) lpData; |
2103 |
__PROTECT__(*refToList); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2104 |
t = __MKSTRING( lplf->lfFaceName ); |
2151 | 2105 |
__UNPROTECT__(*refToList); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2106 |
typeFaceList = *refToList; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2107 |
__SSEND1( typeFaceList, @symbol(add:), 0, t ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2108 |
} |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2109 |
return 1; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2110 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2111 |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
2112 |
static int CALLBACK |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2113 |
EnumFontsProc( lplf, lptm, dwType, lpData ) |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2114 |
LOGFONT* lplf; /* address of logical-font data */ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2115 |
TEXTMETRIC* lptm; /* address of physical font data */ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2116 |
DWORD dwType; /* font type */ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2117 |
LPARAM lpData; /* address of application supplied data */ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2118 |
{ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2119 |
OBJ newArray, t; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2120 |
OBJ *refToList; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2121 |
OBJ list; |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2122 |
char *s; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2123 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2124 |
DPRINTF(("EnumFontProc\n\n\n\n")); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2125 |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2126 |
if( lplf ) { |
2151 | 2127 |
refToList = (OBJ*) lpData; |
2128 |
__PROTECT__(*refToList); |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2129 |
DPRINTF((" lfHeight %d\n", lplf->lfHeight )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2130 |
DPRINTF((" lfWidth %d\n", lplf->lfWidth )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2131 |
DPRINTF((" lfEscapement %d\n", lplf->lfEscapement )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2132 |
DPRINTF((" lfOrientation %d\n", lplf->lfOrientation )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2133 |
DPRINTF((" lfWeight %d\n", lplf->lfWeight )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2134 |
DPRINTF((" lfItalic %d\n", lplf->lfItalic )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2135 |
DPRINTF((" lfUnderline %d\n", lplf->lfUnderline )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2136 |
DPRINTF((" lfStrikeOut %d\n", lplf->lfStrikeOut )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2137 |
DPRINTF((" lfCharSet %d\n", lplf->lfCharSet )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2138 |
DPRINTF((" lfOutPrecision %d\n", lplf->lfOutPrecision )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2139 |
DPRINTF((" lfClipPrecision %d\n", lplf->lfClipPrecision )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2140 |
DPRINTF((" lfQuality %d\n", lplf->lfQuality )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2141 |
DPRINTF((" lfPitchAndFamily %d\n", lplf->lfPitchAndFamily )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2142 |
DPRINTF((" lfFaceName %s\n\n", lplf->lfFaceName )); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2143 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2144 |
newArray = __ARRAY_NEW_INT(16); |
2151 | 2145 |
__UNPROTECT__(*refToList); |
2146 |
||
2147 |
if ( dwType & TRUETYPE_FONTTYPE ) |
|
2148 |
__ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(0); |
|
2149 |
else |
|
2232 | 2150 |
//__ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(MulDiv(__logPixelSY,lplf->lfHeight, 72)); |
2151 | 2151 |
__ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(lplf->lfHeight); |
2152 |
||
1920 | 2153 |
__ArrayInstPtr(newArray)->a_element[1] = __MKSMALLINT(lplf->lfWidth); |
2154 |
__ArrayInstPtr(newArray)->a_element[2] = __MKSMALLINT(lplf->lfEscapement); |
|
2155 |
__ArrayInstPtr(newArray)->a_element[3] = __MKSMALLINT(lplf->lfOrientation); |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2156 |
switch (lplf->lfWeight) { |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2157 |
case FW_NORMAL: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2158 |
s = "normal"; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2159 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2160 |
case FW_BOLD: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2161 |
s = "bold"; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2162 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2163 |
case FW_MEDIUM: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2164 |
s = "medium"; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2165 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2166 |
case FW_LIGHT: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2167 |
s = "demi"; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2168 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2169 |
default: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2170 |
s = "other"; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2171 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2172 |
} |
2151 | 2173 |
__PROTECT__(*refToList); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2174 |
__PROTECT__(newArray); |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2175 |
t = __MKSTRING(s); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2176 |
__UNPROTECT__(newArray); |
2151 | 2177 |
__UNPROTECT__(*refToList); |
1920 | 2178 |
__ArrayInstPtr(newArray)->a_element[4] = t; __STORE(newArray, t); |
2179 |
||
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2180 |
if( lplf->lfItalic == TRUE ) { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2181 |
if( lplf->lfUnderline == TRUE ) { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2182 |
if( lplf->lfStrikeOut == TRUE ) { |
1920 | 2183 |
s = "italic-underline-strikeOut"; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2184 |
} else { |
1920 | 2185 |
s = "italic-underline"; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2186 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2187 |
} else { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2188 |
if( lplf->lfStrikeOut == TRUE ) { |
1920 | 2189 |
s = "italic-strikeOut"; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2190 |
} else { |
1920 | 2191 |
s = "italic"; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2192 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2193 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2194 |
} else { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2195 |
if( lplf->lfUnderline == TRUE ) { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2196 |
if( lplf->lfStrikeOut == TRUE ) { |
1920 | 2197 |
s = "underline-strikeOut"; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2198 |
} else { |
1920 | 2199 |
s = "underline"; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2200 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2201 |
} else { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2202 |
if( lplf->lfStrikeOut == TRUE ) { |
1920 | 2203 |
s = "strikeOut"; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2204 |
} else { |
1920 | 2205 |
s = "normal"; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2206 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2207 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2208 |
} |
2151 | 2209 |
__PROTECT__(*refToList); |
1920 | 2210 |
__PROTECT__(newArray); |
2211 |
t = __MKSTRING(s); |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2212 |
__UNPROTECT__(newArray); |
2151 | 2213 |
__UNPROTECT__(*refToList); |
1920 | 2214 |
__ArrayInstPtr(newArray)->a_element[15] = t; __STORE(newArray, t); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2215 |
|
1920 | 2216 |
__ArrayInstPtr(newArray)->a_element[5] = __MKSMALLINT(lplf->lfItalic); |
2217 |
__ArrayInstPtr(newArray)->a_element[6] = __MKSMALLINT(lplf->lfUnderline); |
|
2218 |
__ArrayInstPtr(newArray)->a_element[7] = __MKSMALLINT(lplf->lfStrikeOut); |
|
2219 |
__ArrayInstPtr(newArray)->a_element[8] = __MKSMALLINT(lplf->lfCharSet); |
|
2220 |
__ArrayInstPtr(newArray)->a_element[9] = __MKSMALLINT(lplf->lfOutPrecision); |
|
2221 |
__ArrayInstPtr(newArray)->a_element[10] = __MKSMALLINT(lplf->lfClipPrecision); |
|
2222 |
__ArrayInstPtr(newArray)->a_element[11] = __MKSMALLINT(lplf->lfQuality); |
|
2223 |
__ArrayInstPtr(newArray)->a_element[12] = __MKSMALLINT(lplf->lfPitchAndFamily); |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2224 |
/* ... */ |
2151 | 2225 |
__PROTECT__(*refToList); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2226 |
__PROTECT__(newArray); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2227 |
t = __MKSTRING(lplf->lfFaceName); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2228 |
__UNPROTECT__(newArray); |
2151 | 2229 |
__UNPROTECT__(*refToList); |
1920 | 2230 |
__ArrayInstPtr(newArray)->a_element[13] = t; __STORE(newArray, t); |
2231 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2232 |
switch (lplf->lfCharSet) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2233 |
case ANSI_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2234 |
s = "ansi"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2235 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2236 |
case DEFAULT_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2237 |
s = "default"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2238 |
case SYMBOL_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2239 |
s = "symbol"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2240 |
case SHIFTJIS_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2241 |
s = "sjis"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2242 |
case GB2312_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2243 |
s = "gb"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2244 |
case HANGEUL_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2245 |
s = "hangeul"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2246 |
case CHINESEBIG5_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2247 |
s = "big5"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2248 |
case OEM_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2249 |
s = "oem"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2250 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2251 |
# ifdef JOHAB_CHARSET |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2252 |
case JOHAB_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2253 |
s = "johab"; |
2151 | 2254 |
break; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2255 |
# endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2256 |
# ifdef HEBREW_CHARSET |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2257 |
case HEBREW_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2258 |
s = "hebrew"; |
2151 | 2259 |
break; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2260 |
# endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2261 |
# ifdef GREEK_CHARSET |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2262 |
case GREEK_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2263 |
s = "greek"; |
2151 | 2264 |
break; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2265 |
# endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2266 |
# ifdef RUSSIAN_CHARSET |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2267 |
case RUSSIAN_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2268 |
s = "russian"; |
2151 | 2269 |
break; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2270 |
# endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2271 |
# ifdef MAC_CHARSET |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2272 |
case MAC_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2273 |
s = "mac"; |
2151 | 2274 |
break; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2275 |
# endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2276 |
default: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2277 |
s = "unknown"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2278 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2279 |
} |
2151 | 2280 |
__PROTECT__(*refToList); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2281 |
__PROTECT__(newArray); |
1920 | 2282 |
t = __MKSTRING(s); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2283 |
__UNPROTECT__(newArray); |
2151 | 2284 |
__UNPROTECT__(*refToList); |
2285 |
||
1920 | 2286 |
__ArrayInstPtr(newArray)->a_element[14] = t; __STORE(newArray, t); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2287 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2288 |
list = *refToList; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2289 |
__SSEND1(list, @symbol(add:), 0, newArray); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2290 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2291 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2292 |
DPRINTF((" dwType %d\n", dwType )); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2293 |
return 1; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2294 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2295 |
|
1127 | 2296 |
%} |
2232 | 2297 |
! ! |
2298 |
||
2299 |
!WinWorkstation class methodsFor:'documentation'! |
|
2300 |
||
1127 | 2301 |
copyright |
2302 |
" |
|
2303 |
COPYRIGHT (c) 1996 by Claus Gittinger |
|
2304 |
All Rights Reserved |
|
2305 |
||
2306 |
This software is furnished under a license and may be used |
|
2307 |
only in accordance with the terms of that license and with the |
|
2308 |
inclusion of the above copyright notice. This software may not |
|
2309 |
be provided or otherwise made available to, or used by, any |
|
2310 |
other person. No title to or ownership of the software is |
|
2311 |
hereby transferred. |
|
2312 |
" |
|
2232 | 2313 |
! |
2314 |
||
1127 | 2315 |
documentation |
2316 |
" |
|
2317 |
See more documentation in my superclass, DeviceWorkstation. |
|
2318 |
||
2319 |
[author:] |
|
2320 |
Claus Gittinger |
|
2321 |
" |
|
2232 | 2322 |
! ! |
2323 |
||
2324 |
!WinWorkstation class methodsFor:'initialization'! |
|
2325 |
||
1127 | 2326 |
initialize |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2327 |
|nButtons swap| |
1127 | 2328 |
|
2329 |
super initialize. |
|
2330 |
||
2151 | 2331 |
self initializeStandardColorNames. |
2332 |
||
1705 | 2333 |
NativeWindows := false. |
2334 |
||
1127 | 2335 |
BeepFrequency := 440. "/ Hertz |
2336 |
BeepDuration := 200. "/ millis |
|
2337 |
||
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2338 |
ButtonTranslation := #(1 2 2). |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2339 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2340 |
nButtons := self getSystemMetrics:#mouseButtons. |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2341 |
swap := self getSystemMetrics:#swapButton. |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2342 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2343 |
nButtons == 0 ifTrue:[ |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2344 |
'WinWorkstation [warning]: mouse-less operation may not work' infoPrintCR. |
1127 | 2345 |
] ifFalse:[ |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2346 |
nButtons == 2 ifTrue:[ |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2347 |
ButtonTranslation := #(1 2). |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2348 |
]. |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2349 |
swap ifTrue:[ |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2350 |
ButtonTranslation := ButtonTranslation copy reverse |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2351 |
] |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2352 |
]. |
1705 | 2353 |
|
2354 |
"/ translation table from ST/X windowType symbol (system-independent) |
|
2355 |
"/ to Windows windowClass (windows-specific). |
|
2232 | 2356 |
|
1705 | 2357 |
NativeWindowClassTable := IdentityDictionary new. |
2358 |
NativeWindowClassTable at:#ScrollBar put:'SCROLLBAR'. |
|
2359 |
NativeWindowClassTable at:#CheckBox put:'BUTTON'. |
|
2360 |
NativeWindowClassTable at:#RadioButton put:'BUTTON'. |
|
2361 |
NativeWindowClassTable at:#Button put:'BUTTON'. |
|
2362 |
NativeWindowClassTable at:#DefaultButton put:'BUTTON'. |
|
2363 |
NativeWindowClassTable at:#ComboBox put:'COMBOBOX'. |
|
2364 |
NativeWindowClassTable at:#EditField put:'EDIT'. |
|
2365 |
NativeWindowClassTable at:#ListBox put:'LISTBOX'. |
|
2232 | 2366 |
! |
2367 |
||
2151 | 2368 |
initializeStandardColorNames |
2369 |
"{ Pragma: +optSpace }" |
|
2370 |
||
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
2371 |
"setup standard color names" |
2151 | 2372 |
|
2373 |
StandardColorValues := Dictionary new. |
|
2374 |
#( |
|
2375 |
(240 248 255) 'alice blue' |
|
2376 |
(240 248 255) 'AliceBlue' |
|
2377 |
(250 235 215) 'antique white' |
|
2378 |
(250 235 215) 'AntiqueWhite' |
|
2379 |
(255 239 219) 'AntiqueWhite1' |
|
2380 |
(238 223 204) 'AntiqueWhite2' |
|
2381 |
(205 192 176) 'AntiqueWhite3' |
|
2382 |
(139 131 120) 'AntiqueWhite4' |
|
2383 |
(127 255 212) 'aquamarine' |
|
2384 |
(127 255 212) 'aquamarine1' |
|
2385 |
(118 238 198) 'aquamarine2' |
|
2386 |
(102 205 170) 'aquamarine3' |
|
2387 |
( 69 139 116) 'aquamarine4' |
|
2388 |
(240 255 255) 'azure' |
|
2389 |
(240 255 255) 'azure1' |
|
2390 |
(224 238 238) 'azure2' |
|
2391 |
(193 205 205) 'azure3' |
|
2392 |
(131 139 139) 'azure4' |
|
2393 |
(245 245 220) 'beige' |
|
2394 |
(255 228 196) 'bisque' |
|
2395 |
(255 228 196) 'bisque1' |
|
2396 |
(238 213 183) 'bisque2' |
|
2397 |
(205 183 158) 'bisque3' |
|
2398 |
(139 125 107) 'bisque4' |
|
2399 |
( 0 0 0) 'black' |
|
2400 |
(255 235 205) 'blanched almond' |
|
2401 |
(255 235 205) 'BlanchedAlmond' |
|
2402 |
( 0 0 255) 'blue' |
|
2403 |
(138 43 226) 'blue violet' |
|
2404 |
( 0 0 255) 'blue1' |
|
2405 |
( 0 0 238) 'blue2' |
|
2406 |
( 0 0 205) 'blue3' |
|
2407 |
( 0 0 139) 'blue4' |
|
2408 |
(138 43 226) 'BlueViolet' |
|
2409 |
(165 42 42) 'brown' |
|
2410 |
(255 64 64) 'brown1' |
|
2411 |
(238 59 59) 'brown2' |
|
2412 |
(205 51 51) 'brown3' |
|
2413 |
(139 35 35) 'brown4' |
|
2414 |
(222 184 135) 'burlywood' |
|
2415 |
(255 211 155) 'burlywood1' |
|
2416 |
(238 197 145) 'burlywood2' |
|
2417 |
(205 170 125) 'burlywood3' |
|
2418 |
(139 115 85) 'burlywood4' |
|
2419 |
( 95 158 160) 'cadet blue' |
|
2420 |
( 95 158 160) 'CadetBlue' |
|
2421 |
(152 245 255) 'CadetBlue1' |
|
2422 |
(142 229 238) 'CadetBlue2' |
|
2423 |
(122 197 205) 'CadetBlue3' |
|
2424 |
( 83 134 139) 'CadetBlue4' |
|
2425 |
(127 255 0) 'chartreuse' |
|
2426 |
(127 255 0) 'chartreuse1' |
|
2427 |
(118 238 0) 'chartreuse2' |
|
2428 |
(102 205 0) 'chartreuse3' |
|
2429 |
( 69 139 0) 'chartreuse4' |
|
2430 |
(210 105 30) 'chocolate' |
|
2431 |
(255 127 36) 'chocolate1' |
|
2432 |
(238 118 33) 'chocolate2' |
|
2433 |
(205 102 29) 'chocolate3' |
|
2434 |
(139 69 19) 'chocolate4' |
|
2435 |
(255 127 80) 'coral' |
|
2436 |
(255 114 86) 'coral1' |
|
2437 |
(238 106 80) 'coral2' |
|
2438 |
(205 91 69) 'coral3' |
|
2439 |
(139 62 47) 'coral4' |
|
2440 |
(100 149 237) 'cornflower blue' |
|
2441 |
(100 149 237) 'CornflowerBlue' |
|
2442 |
(255 248 220) 'cornsilk' |
|
2443 |
(255 248 220) 'cornsilk1' |
|
2444 |
(238 232 205) 'cornsilk2' |
|
2445 |
(205 200 177) 'cornsilk3' |
|
2446 |
(139 136 120) 'cornsilk4' |
|
2447 |
( 0 255 255) 'cyan' |
|
2448 |
( 0 255 255) 'cyan1' |
|
2449 |
( 0 238 238) 'cyan2' |
|
2450 |
( 0 205 205) 'cyan3' |
|
2451 |
( 0 139 139) 'cyan4' |
|
2452 |
( 0 0 139) 'dark blue' |
|
2453 |
( 0 139 139) 'dark cyan' |
|
2454 |
(184 134 11) 'dark goldenrod' |
|
2455 |
(169 169 169) 'dark gray' |
|
2456 |
( 0 100 0) 'dark green' |
|
2457 |
(169 169 169) 'dark grey' |
|
2458 |
(189 183 107) 'dark khaki' |
|
2459 |
(139 0 139) 'dark magenta' |
|
2460 |
( 85 107 47) 'dark olive green' |
|
2461 |
(255 140 0) 'dark orange' |
|
2462 |
(153 50 204) 'dark orchid' |
|
2463 |
(139 0 0) 'dark red' |
|
2464 |
(233 150 122) 'dark salmon' |
|
2465 |
(143 188 143) 'dark sea green' |
|
2466 |
( 72 61 139) 'dark slate blue' |
|
2467 |
( 47 79 79) 'dark slate gray' |
|
2468 |
( 47 79 79) 'dark slate grey' |
|
2469 |
( 0 206 209) 'dark turquoise' |
|
2470 |
(148 0 211) 'dark violet' |
|
2471 |
( 0 0 139) 'DarkBlue' |
|
2472 |
( 0 139 139) 'DarkCyan' |
|
2473 |
(184 134 11) 'DarkGoldenrod' |
|
2474 |
(255 185 15) 'DarkGoldenrod1' |
|
2475 |
(238 173 14) 'DarkGoldenrod2' |
|
2476 |
(205 149 12) 'DarkGoldenrod3' |
|
2477 |
(139 101 8) 'DarkGoldenrod4' |
|
2478 |
(169 169 169) 'DarkGray' |
|
2479 |
( 0 100 0) 'DarkGreen' |
|
2480 |
(169 169 169) 'DarkGrey' |
|
2481 |
(189 183 107) 'DarkKhaki' |
|
2482 |
(139 0 139) 'DarkMagenta' |
|
2483 |
( 85 107 47) 'DarkOliveGreen' |
|
2484 |
(202 255 112) 'DarkOliveGreen1' |
|
2485 |
(188 238 104) 'DarkOliveGreen2' |
|
2486 |
(162 205 90) 'DarkOliveGreen3' |
|
2487 |
(110 139 61) 'DarkOliveGreen4' |
|
2488 |
(255 140 0) 'DarkOrange' |
|
2489 |
(255 127 0) 'DarkOrange1' |
|
2490 |
(238 118 0) 'DarkOrange2' |
|
2491 |
(205 102 0) 'DarkOrange3' |
|
2492 |
(139 69 0) 'DarkOrange4' |
|
2493 |
(153 50 204) 'DarkOrchid' |
|
2494 |
(191 62 255) 'DarkOrchid1' |
|
2495 |
(178 58 238) 'DarkOrchid2' |
|
2496 |
(154 50 205) 'DarkOrchid3' |
|
2497 |
(104 34 139) 'DarkOrchid4' |
|
2498 |
(139 0 0) 'DarkRed' |
|
2499 |
(233 150 122) 'DarkSalmon' |
|
2500 |
(143 188 143) 'DarkSeaGreen' |
|
2501 |
(193 255 193) 'DarkSeaGreen1' |
|
2502 |
(180 238 180) 'DarkSeaGreen2' |
|
2503 |
(155 205 155) 'DarkSeaGreen3' |
|
2504 |
(105 139 105) 'DarkSeaGreen4' |
|
2505 |
( 72 61 139) 'DarkSlateBlue' |
|
2506 |
( 47 79 79) 'DarkSlateGray' |
|
2507 |
(151 255 255) 'DarkSlateGray1' |
|
2508 |
(141 238 238) 'DarkSlateGray2' |
|
2509 |
(121 205 205) 'DarkSlateGray3' |
|
2510 |
( 82 139 139) 'DarkSlateGray4' |
|
2511 |
( 47 79 79) 'DarkSlateGrey' |
|
2512 |
( 0 206 209) 'DarkTurquoise' |
|
2513 |
(148 0 211) 'DarkViolet' |
|
2514 |
(255 20 147) 'deep pink' |
|
2515 |
( 0 191 255) 'deep sky blue' |
|
2516 |
(255 20 147) 'DeepPink' |
|
2517 |
(255 20 147) 'DeepPink1' |
|
2518 |
(238 18 137) 'DeepPink2' |
|
2519 |
(205 16 118) 'DeepPink3' |
|
2520 |
(139 10 80) 'DeepPink4' |
|
2521 |
( 0 191 255) 'DeepSkyBlue' |
|
2522 |
( 0 191 255) 'DeepSkyBlue1' |
|
2523 |
( 0 178 238) 'DeepSkyBlue2' |
|
2524 |
( 0 154 205) 'DeepSkyBlue3' |
|
2525 |
( 0 104 139) 'DeepSkyBlue4' |
|
2526 |
(105 105 105) 'dim gray' |
|
2527 |
(105 105 105) 'dim grey' |
|
2528 |
(105 105 105) 'DimGray' |
|
2529 |
(105 105 105) 'DimGrey' |
|
2530 |
( 30 144 255) 'dodger blue' |
|
2531 |
( 30 144 255) 'DodgerBlue' |
|
2532 |
( 30 144 255) 'DodgerBlue1' |
|
2533 |
( 28 134 238) 'DodgerBlue2' |
|
2534 |
( 24 116 205) 'DodgerBlue3' |
|
2535 |
( 16 78 139) 'DodgerBlue4' |
|
2536 |
(178 34 34) 'firebrick' |
|
2537 |
(255 48 48) 'firebrick1' |
|
2538 |
(238 44 44) 'firebrick2' |
|
2539 |
(205 38 38) 'firebrick3' |
|
2540 |
(139 26 26) 'firebrick4' |
|
2541 |
(255 250 240) 'floral white' |
|
2542 |
(255 250 240) 'FloralWhite' |
|
2543 |
( 34 139 34) 'forest green' |
|
2544 |
( 34 139 34) 'ForestGreen' |
|
2545 |
(220 220 220) 'gainsboro' |
|
2546 |
(248 248 255) 'ghost white' |
|
2547 |
(248 248 255) 'GhostWhite' |
|
2548 |
(255 215 0) 'gold' |
|
2549 |
(255 215 0) 'gold1' |
|
2550 |
(238 201 0) 'gold2' |
|
2551 |
(205 173 0) 'gold3' |
|
2552 |
(139 117 0) 'gold4' |
|
2553 |
(218 165 32) 'goldenrod' |
|
2554 |
(255 193 37) 'goldenrod1' |
|
2555 |
(238 180 34) 'goldenrod2' |
|
2556 |
(205 155 29) 'goldenrod3' |
|
2557 |
(139 105 20) 'goldenrod4' |
|
2232 | 2558 |
|
2559 |
(192 192 192) 'grey' |
|
2560 |
( 0 0 0) 'grey0' |
|
2561 |
( 3 3 3) 'grey1' |
|
2562 |
( 26 26 26) 'grey10' |
|
2563 |
(255 255 255) 'grey100' |
|
2564 |
( 28 28 28) 'grey11' |
|
2565 |
( 31 31 31) 'grey12' |
|
2566 |
( 33 33 33) 'grey13' |
|
2567 |
( 36 36 36) 'grey14' |
|
2568 |
( 38 38 38) 'grey15' |
|
2569 |
( 41 41 41) 'grey16' |
|
2570 |
( 43 43 43) 'grey17' |
|
2571 |
( 46 46 46) 'grey18' |
|
2572 |
( 48 48 48) 'grey19' |
|
2573 |
( 5 5 5) 'grey2' |
|
2574 |
( 51 51 51) 'grey20' |
|
2575 |
( 54 54 54) 'grey21' |
|
2576 |
( 56 56 56) 'grey22' |
|
2577 |
( 59 59 59) 'grey23' |
|
2578 |
( 61 61 61) 'grey24' |
|
2579 |
( 64 64 64) 'grey25' |
|
2580 |
( 66 66 66) 'grey26' |
|
2581 |
( 69 69 69) 'grey27' |
|
2582 |
( 71 71 71) 'grey28' |
|
2583 |
( 74 74 74) 'grey29' |
|
2584 |
( 8 8 8) 'grey3' |
|
2585 |
( 77 77 77) 'grey30' |
|
2586 |
( 79 79 79) 'grey31' |
|
2587 |
( 82 82 82) 'grey32' |
|
2588 |
( 84 84 84) 'grey33' |
|
2589 |
( 87 87 87) 'grey34' |
|
2590 |
( 89 89 89) 'grey35' |
|
2591 |
( 92 92 92) 'grey36' |
|
2592 |
( 94 94 94) 'grey37' |
|
2593 |
( 97 97 97) 'grey38' |
|
2594 |
( 99 99 99) 'grey39' |
|
2595 |
( 10 10 10) 'grey4' |
|
2596 |
(102 102 102) 'grey40' |
|
2597 |
(105 105 105) 'grey41' |
|
2598 |
(107 107 107) 'grey42' |
|
2599 |
(110 110 110) 'grey43' |
|
2600 |
(112 112 112) 'grey44' |
|
2601 |
(115 115 115) 'grey45' |
|
2602 |
(117 117 117) 'grey46' |
|
2603 |
(120 120 120) 'grey47' |
|
2604 |
(122 122 122) 'grey48' |
|
2605 |
(125 125 125) 'grey49' |
|
2606 |
( 13 13 13) 'grey5' |
|
2607 |
(127 127 127) 'grey50' |
|
2608 |
(130 130 130) 'grey51' |
|
2609 |
(133 133 133) 'grey52' |
|
2610 |
(135 135 135) 'grey53' |
|
2611 |
(138 138 138) 'grey54' |
|
2612 |
(140 140 140) 'grey55' |
|
2613 |
(143 143 143) 'grey56' |
|
2614 |
(145 145 145) 'grey57' |
|
2615 |
(148 148 148) 'grey58' |
|
2616 |
(150 150 150) 'grey59' |
|
2617 |
( 15 15 15) 'grey6' |
|
2618 |
(153 153 153) 'grey60' |
|
2619 |
(156 156 156) 'grey61' |
|
2620 |
(158 158 158) 'grey62' |
|
2621 |
(161 161 161) 'grey63' |
|
2622 |
(163 163 163) 'grey64' |
|
2623 |
(166 166 166) 'grey65' |
|
2624 |
(168 168 168) 'grey66' |
|
2625 |
(171 171 171) 'grey67' |
|
2626 |
(173 173 173) 'grey68' |
|
2627 |
(176 176 176) 'grey69' |
|
2628 |
( 18 18 18) 'grey7' |
|
2629 |
(179 179 179) 'grey70' |
|
2630 |
(181 181 181) 'grey71' |
|
2631 |
(184 184 184) 'grey72' |
|
2632 |
(186 186 186) 'grey73' |
|
2633 |
(189 189 189) 'grey74' |
|
2634 |
(191 191 191) 'grey75' |
|
2635 |
(194 194 194) 'grey76' |
|
2636 |
(196 196 196) 'grey77' |
|
2637 |
(199 199 199) 'grey78' |
|
2638 |
(201 201 201) 'grey79' |
|
2639 |
( 20 20 20) 'grey8' |
|
2640 |
(204 204 204) 'grey80' |
|
2641 |
(207 207 207) 'grey81' |
|
2642 |
(209 209 209) 'grey82' |
|
2643 |
(212 212 212) 'grey83' |
|
2644 |
(214 214 214) 'grey84' |
|
2645 |
(217 217 217) 'grey85' |
|
2646 |
(219 219 219) 'grey86' |
|
2647 |
(222 222 222) 'grey87' |
|
2648 |
(224 224 224) 'grey88' |
|
2649 |
(227 227 227) 'grey89' |
|
2650 |
( 23 23 23) 'grey9' |
|
2651 |
(229 229 229) 'grey90' |
|
2652 |
(232 232 232) 'grey91' |
|
2653 |
(235 235 235) 'grey92' |
|
2654 |
(237 237 237) 'grey93' |
|
2655 |
(240 240 240) 'grey94' |
|
2656 |
(242 242 242) 'grey95' |
|
2657 |
(245 245 245) 'grey96' |
|
2658 |
(247 247 247) 'grey97' |
|
2659 |
(250 250 250) 'grey98' |
|
2660 |
(252 252 252) 'grey99' |
|
2661 |
||
2151 | 2662 |
(192 192 192) 'gray' |
2663 |
( 0 0 0) 'gray0' |
|
2664 |
( 3 3 3) 'gray1' |
|
2665 |
( 26 26 26) 'gray10' |
|
2666 |
(255 255 255) 'gray100' |
|
2667 |
( 28 28 28) 'gray11' |
|
2668 |
( 31 31 31) 'gray12' |
|
2669 |
( 33 33 33) 'gray13' |
|
2670 |
( 36 36 36) 'gray14' |
|
2671 |
( 38 38 38) 'gray15' |
|
2672 |
( 41 41 41) 'gray16' |
|
2673 |
( 43 43 43) 'gray17' |
|
2674 |
( 46 46 46) 'gray18' |
|
2675 |
( 48 48 48) 'gray19' |
|
2676 |
( 5 5 5) 'gray2' |
|
2677 |
( 51 51 51) 'gray20' |
|
2678 |
( 54 54 54) 'gray21' |
|
2679 |
( 56 56 56) 'gray22' |
|
2680 |
( 59 59 59) 'gray23' |
|
2681 |
( 61 61 61) 'gray24' |
|
2682 |
( 64 64 64) 'gray25' |
|
2683 |
( 66 66 66) 'gray26' |
|
2684 |
( 69 69 69) 'gray27' |
|
2685 |
( 71 71 71) 'gray28' |
|
2686 |
( 74 74 74) 'gray29' |
|
2687 |
( 8 8 8) 'gray3' |
|
2688 |
( 77 77 77) 'gray30' |
|
2689 |
( 79 79 79) 'gray31' |
|
2690 |
( 82 82 82) 'gray32' |
|
2691 |
( 84 84 84) 'gray33' |
|
2692 |
( 87 87 87) 'gray34' |
|
2693 |
( 89 89 89) 'gray35' |
|
2694 |
( 92 92 92) 'gray36' |
|
2695 |
( 94 94 94) 'gray37' |
|
2696 |
( 97 97 97) 'gray38' |
|
2697 |
( 99 99 99) 'gray39' |
|
2698 |
( 10 10 10) 'gray4' |
|
2699 |
(102 102 102) 'gray40' |
|
2700 |
(105 105 105) 'gray41' |
|
2701 |
(107 107 107) 'gray42' |
|
2702 |
(110 110 110) 'gray43' |
|
2703 |
(112 112 112) 'gray44' |
|
2704 |
(115 115 115) 'gray45' |
|
2705 |
(117 117 117) 'gray46' |
|
2706 |
(120 120 120) 'gray47' |
|
2707 |
(122 122 122) 'gray48' |
|
2708 |
(125 125 125) 'gray49' |
|
2709 |
( 13 13 13) 'gray5' |
|
2710 |
(127 127 127) 'gray50' |
|
2711 |
(130 130 130) 'gray51' |
|
2712 |
(133 133 133) 'gray52' |
|
2713 |
(135 135 135) 'gray53' |
|
2714 |
(138 138 138) 'gray54' |
|
2715 |
(140 140 140) 'gray55' |
|
2716 |
(143 143 143) 'gray56' |
|
2717 |
(145 145 145) 'gray57' |
|
2718 |
(148 148 148) 'gray58' |
|
2719 |
(150 150 150) 'gray59' |
|
2720 |
( 15 15 15) 'gray6' |
|
2721 |
(153 153 153) 'gray60' |
|
2722 |
(156 156 156) 'gray61' |
|
2723 |
(158 158 158) 'gray62' |
|
2724 |
(161 161 161) 'gray63' |
|
2725 |
(163 163 163) 'gray64' |
|
2726 |
(166 166 166) 'gray65' |
|
2727 |
(168 168 168) 'gray66' |
|
2728 |
(171 171 171) 'gray67' |
|
2729 |
(173 173 173) 'gray68' |
|
2730 |
(176 176 176) 'gray69' |
|
2731 |
( 18 18 18) 'gray7' |
|
2732 |
(179 179 179) 'gray70' |
|
2733 |
(181 181 181) 'gray71' |
|
2734 |
(184 184 184) 'gray72' |
|
2735 |
(186 186 186) 'gray73' |
|
2736 |
(189 189 189) 'gray74' |
|
2737 |
(191 191 191) 'gray75' |
|
2738 |
(194 194 194) 'gray76' |
|
2739 |
(196 196 196) 'gray77' |
|
2740 |
(199 199 199) 'gray78' |
|
2741 |
(201 201 201) 'gray79' |
|
2742 |
( 20 20 20) 'gray8' |
|
2743 |
(204 204 204) 'gray80' |
|
2744 |
(207 207 207) 'gray81' |
|
2745 |
(209 209 209) 'gray82' |
|
2746 |
(212 212 212) 'gray83' |
|
2747 |
(214 214 214) 'gray84' |
|
2748 |
(217 217 217) 'gray85' |
|
2749 |
(219 219 219) 'gray86' |
|
2750 |
(222 222 222) 'gray87' |
|
2751 |
(224 224 224) 'gray88' |
|
2752 |
(227 227 227) 'gray89' |
|
2753 |
( 23 23 23) 'gray9' |
|
2754 |
(229 229 229) 'gray90' |
|
2755 |
(232 232 232) 'gray91' |
|
2756 |
(235 235 235) 'gray92' |
|
2757 |
(237 237 237) 'gray93' |
|
2758 |
(240 240 240) 'gray94' |
|
2759 |
(242 242 242) 'gray95' |
|
2760 |
(245 245 245) 'gray96' |
|
2761 |
(247 247 247) 'gray97' |
|
2762 |
(250 250 250) 'gray98' |
|
2763 |
(252 252 252) 'gray99' |
|
2764 |
( 0 255 0) 'green' |
|
2765 |
(173 255 47) 'green yellow' |
|
2766 |
( 0 255 0) 'green1' |
|
2767 |
( 0 238 0) 'green2' |
|
2768 |
( 0 205 0) 'green3' |
|
2769 |
( 0 139 0) 'green4' |
|
2770 |
(173 255 47) 'GreenYellow' |
|
2771 |
(240 255 240) 'honeydew' |
|
2772 |
(240 255 240) 'honeydew1' |
|
2773 |
(224 238 224) 'honeydew2' |
|
2774 |
(193 205 193) 'honeydew3' |
|
2775 |
(131 139 131) 'honeydew4' |
|
2776 |
(255 105 180) 'hot pink' |
|
2777 |
(255 105 180) 'HotPink' |
|
2778 |
(255 110 180) 'HotPink1' |
|
2779 |
(238 106 167) 'HotPink2' |
|
2780 |
(205 96 144) 'HotPink3' |
|
2781 |
(139 58 98) 'HotPink4' |
|
2782 |
(205 92 92) 'indian red' |
|
2783 |
(205 92 92) 'IndianRed' |
|
2784 |
(255 106 106) 'IndianRed1' |
|
2785 |
(238 99 99) 'IndianRed2' |
|
2786 |
(205 85 85) 'IndianRed3' |
|
2787 |
(139 58 58) 'IndianRed4' |
|
2788 |
(255 255 240) 'ivory' |
|
2789 |
(255 255 240) 'ivory1' |
|
2790 |
(238 238 224) 'ivory2' |
|
2791 |
(205 205 193) 'ivory3' |
|
2792 |
(139 139 131) 'ivory4' |
|
2793 |
(240 230 140) 'khaki' |
|
2794 |
(255 246 143) 'khaki1' |
|
2795 |
(238 230 133) 'khaki2' |
|
2796 |
(205 198 115) 'khaki3' |
|
2797 |
(139 134 78) 'khaki4' |
|
2798 |
(230 230 250) 'lavender' |
|
2799 |
(255 240 245) 'lavender blush' |
|
2800 |
(255 240 245) 'LavenderBlush' |
|
2801 |
(255 240 245) 'LavenderBlush1' |
|
2802 |
(238 224 229) 'LavenderBlush2' |
|
2803 |
(205 193 197) 'LavenderBlush3' |
|
2804 |
(139 131 134) 'LavenderBlush4' |
|
2805 |
(124 252 0) 'lawn green' |
|
2806 |
(124 252 0) 'LawnGreen' |
|
2807 |
(255 250 205) 'lemon chiffon' |
|
2808 |
(255 250 205) 'LemonChiffon' |
|
2809 |
(255 250 205) 'LemonChiffon1' |
|
2810 |
(238 233 191) 'LemonChiffon2' |
|
2811 |
(205 201 165) 'LemonChiffon3' |
|
2812 |
(139 137 112) 'LemonChiffon4' |
|
2813 |
(173 216 230) 'light blue' |
|
2814 |
(240 128 128) 'light coral' |
|
2815 |
(224 255 255) 'light cyan' |
|
2816 |
(238 221 130) 'light goldenrod' |
|
2817 |
(250 250 210) 'light goldenrod yellow' |
|
2818 |
(211 211 211) 'light gray' |
|
2819 |
(144 238 144) 'light green' |
|
2820 |
(211 211 211) 'light grey' |
|
2821 |
(255 182 193) 'light pink' |
|
2822 |
(255 160 122) 'light salmon' |
|
2823 |
( 32 178 170) 'light sea green' |
|
2824 |
(135 206 250) 'light sky blue' |
|
2825 |
(132 112 255) 'light slate blue' |
|
2826 |
(119 136 153) 'light slate gray' |
|
2827 |
(119 136 153) 'light slate grey' |
|
2828 |
(176 196 222) 'light steel blue' |
|
2829 |
(255 255 224) 'light yellow' |
|
2830 |
(173 216 230) 'LightBlue' |
|
2831 |
(191 239 255) 'LightBlue1' |
|
2832 |
(178 223 238) 'LightBlue2' |
|
2833 |
(154 192 205) 'LightBlue3' |
|
2834 |
(104 131 139) 'LightBlue4' |
|
2835 |
(240 128 128) 'LightCoral' |
|
2836 |
(224 255 255) 'LightCyan' |
|
2837 |
(224 255 255) 'LightCyan1' |
|
2838 |
(209 238 238) 'LightCyan2' |
|
2839 |
(180 205 205) 'LightCyan3' |
|
2840 |
(122 139 139) 'LightCyan4' |
|
2841 |
(238 221 130) 'LightGoldenrod' |
|
2842 |
(255 236 139) 'LightGoldenrod1' |
|
2843 |
(238 220 130) 'LightGoldenrod2' |
|
2844 |
(205 190 112) 'LightGoldenrod3' |
|
2845 |
(139 129 76) 'LightGoldenrod4' |
|
2846 |
(250 250 210) 'LightGoldenrodYellow' |
|
2847 |
(211 211 211) 'LightGray' |
|
2848 |
(144 238 144) 'LightGreen' |
|
2849 |
(211 211 211) 'LightGrey' |
|
2850 |
(255 182 193) 'LightPink' |
|
2851 |
(255 174 185) 'LightPink1' |
|
2852 |
(238 162 173) 'LightPink2' |
|
2853 |
(205 140 149) 'LightPink3' |
|
2854 |
(139 95 101) 'LightPink4' |
|
2855 |
(255 160 122) 'LightSalmon' |
|
2856 |
(255 160 122) 'LightSalmon1' |
|
2857 |
(238 149 114) 'LightSalmon2' |
|
2858 |
(205 129 98) 'LightSalmon3' |
|
2859 |
(139 87 66) 'LightSalmon4' |
|
2860 |
( 32 178 170) 'LightSeaGreen' |
|
2861 |
(135 206 250) 'LightSkyBlue' |
|
2862 |
(176 226 255) 'LightSkyBlue1' |
|
2863 |
(164 211 238) 'LightSkyBlue2' |
|
2864 |
(141 182 205) 'LightSkyBlue3' |
|
2865 |
( 96 123 139) 'LightSkyBlue4' |
|
2866 |
(132 112 255) 'LightSlateBlue' |
|
2867 |
(119 136 153) 'LightSlateGray' |
|
2868 |
(119 136 153) 'LightSlateGrey' |
|
2869 |
(176 196 222) 'LightSteelBlue' |
|
2870 |
(202 225 255) 'LightSteelBlue1' |
|
2871 |
(188 210 238) 'LightSteelBlue2' |
|
2872 |
(162 181 205) 'LightSteelBlue3' |
|
2873 |
(110 123 139) 'LightSteelBlue4' |
|
2874 |
(255 255 224) 'LightYellow' |
|
2875 |
(255 255 224) 'LightYellow1' |
|
2876 |
(238 238 209) 'LightYellow2' |
|
2877 |
(205 205 180) 'LightYellow3' |
|
2878 |
(139 139 122) 'LightYellow4' |
|
2879 |
( 50 205 50) 'lime green' |
|
2880 |
( 50 205 50) 'LimeGreen' |
|
2881 |
(250 240 230) 'linen' |
|
2882 |
(255 0 255) 'magenta' |
|
2883 |
(255 0 255) 'magenta1' |
|
2884 |
(238 0 238) 'magenta2' |
|
2885 |
(205 0 205) 'magenta3' |
|
2886 |
(139 0 139) 'magenta4' |
|
2887 |
(176 48 96) 'maroon' |
|
2888 |
(255 52 179) 'maroon1' |
|
2889 |
(238 48 167) 'maroon2' |
|
2890 |
(205 41 144) 'maroon3' |
|
2891 |
(139 28 98) 'maroon4' |
|
2892 |
(102 205 170) 'medium aquamarine' |
|
2893 |
( 0 0 205) 'medium blue' |
|
2894 |
(186 85 211) 'medium orchid' |
|
2895 |
(147 112 219) 'medium purple' |
|
2896 |
( 60 179 113) 'medium sea green' |
|
2897 |
(123 104 238) 'medium slate blue' |
|
2898 |
( 0 250 154) 'medium spring green' |
|
2899 |
( 72 209 204) 'medium turquoise' |
|
2900 |
(199 21 133) 'medium violet red' |
|
2901 |
(102 205 170) 'MediumAquamarine' |
|
2902 |
( 0 0 205) 'MediumBlue' |
|
2903 |
(186 85 211) 'MediumOrchid' |
|
2904 |
(224 102 255) 'MediumOrchid1' |
|
2905 |
(209 95 238) 'MediumOrchid2' |
|
2906 |
(180 82 205) 'MediumOrchid3' |
|
2907 |
(122 55 139) 'MediumOrchid4' |
|
2908 |
(147 112 219) 'MediumPurple' |
|
2909 |
(171 130 255) 'MediumPurple1' |
|
2910 |
(159 121 238) 'MediumPurple2' |
|
2911 |
(137 104 205) 'MediumPurple3' |
|
2912 |
( 93 71 139) 'MediumPurple4' |
|
2913 |
( 60 179 113) 'MediumSeaGreen' |
|
2914 |
(123 104 238) 'MediumSlateBlue' |
|
2915 |
( 0 250 154) 'MediumSpringGreen' |
|
2916 |
( 72 209 204) 'MediumTurquoise' |
|
2917 |
(199 21 133) 'MediumVioletRed' |
|
2918 |
( 25 25 112) 'midnight blue' |
|
2919 |
( 25 25 112) 'MidnightBlue' |
|
2920 |
(245 255 250) 'mint cream' |
|
2921 |
(245 255 250) 'MintCream' |
|
2922 |
(255 228 225) 'misty rose' |
|
2923 |
(255 228 225) 'MistyRose' |
|
2924 |
(255 228 225) 'MistyRose1' |
|
2925 |
(238 213 210) 'MistyRose2' |
|
2926 |
(205 183 181) 'MistyRose3' |
|
2927 |
(139 125 123) 'MistyRose4' |
|
2928 |
(255 228 181) 'moccasin' |
|
2929 |
(255 222 173) 'navajo white' |
|
2930 |
(255 222 173) 'NavajoWhite' |
|
2931 |
(255 222 173) 'NavajoWhite1' |
|
2932 |
(238 207 161) 'NavajoWhite2' |
|
2933 |
(205 179 139) 'NavajoWhite3' |
|
2934 |
(139 121 94) 'NavajoWhite4' |
|
2935 |
( 0 0 128) 'navy' |
|
2936 |
( 0 0 128) 'navy blue' |
|
2937 |
( 0 0 128) 'NavyBlue' |
|
2938 |
(253 245 230) 'old lace' |
|
2939 |
(253 245 230) 'OldLace' |
|
2940 |
(107 142 35) 'olive drab' |
|
2941 |
(107 142 35) 'OliveDrab' |
|
2942 |
(192 255 62) 'OliveDrab1' |
|
2943 |
(179 238 58) 'OliveDrab2' |
|
2944 |
(154 205 50) 'OliveDrab3' |
|
2945 |
(105 139 34) 'OliveDrab4' |
|
2946 |
(255 165 0) 'orange' |
|
2947 |
(255 69 0) 'orange red' |
|
2948 |
(255 165 0) 'orange1' |
|
2949 |
(238 154 0) 'orange2' |
|
2950 |
(205 133 0) 'orange3' |
|
2951 |
(139 90 0) 'orange4' |
|
2952 |
(255 69 0) 'OrangeRed' |
|
2953 |
(255 69 0) 'OrangeRed1' |
|
2954 |
(238 64 0) 'OrangeRed2' |
|
2955 |
(205 55 0) 'OrangeRed3' |
|
2956 |
(139 37 0) 'OrangeRed4' |
|
2957 |
(218 112 214) 'orchid' |
|
2958 |
(255 131 250) 'orchid1' |
|
2959 |
(238 122 233) 'orchid2' |
|
2960 |
(205 105 201) 'orchid3' |
|
2961 |
(139 71 137) 'orchid4' |
|
2962 |
(238 232 170) 'pale goldenrod' |
|
2963 |
(152 251 152) 'pale green' |
|
2964 |
(175 238 238) 'pale turquoise' |
|
2965 |
(219 112 147) 'pale violet red' |
|
2966 |
(238 232 170) 'PaleGoldenrod' |
|
2967 |
(152 251 152) 'PaleGreen' |
|
2968 |
(154 255 154) 'PaleGreen1' |
|
2969 |
(144 238 144) 'PaleGreen2' |
|
2970 |
(124 205 124) 'PaleGreen3' |
|
2971 |
( 84 139 84) 'PaleGreen4' |
|
2972 |
(175 238 238) 'PaleTurquoise' |
|
2973 |
(187 255 255) 'PaleTurquoise1' |
|
2974 |
(174 238 238) 'PaleTurquoise2' |
|
2975 |
(150 205 205) 'PaleTurquoise3' |
|
2976 |
(102 139 139) 'PaleTurquoise4' |
|
2977 |
(219 112 147) 'PaleVioletRed' |
|
2978 |
(255 130 171) 'PaleVioletRed1' |
|
2979 |
(238 121 159) 'PaleVioletRed2' |
|
2980 |
(205 104 137) 'PaleVioletRed3' |
|
2981 |
(139 71 93) 'PaleVioletRed4' |
|
2982 |
(255 239 213) 'papaya whip' |
|
2983 |
(255 239 213) 'PapayaWhip' |
|
2984 |
(255 218 185) 'peach puff' |
|
2985 |
(255 218 185) 'PeachPuff' |
|
2986 |
(255 218 185) 'PeachPuff1' |
|
2987 |
(238 203 173) 'PeachPuff2' |
|
2988 |
(205 175 149) 'PeachPuff3' |
|
2989 |
(139 119 101) 'PeachPuff4' |
|
2990 |
(205 133 63) 'peru' |
|
2991 |
(255 192 203) 'pink' |
|
2992 |
(255 181 197) 'pink1' |
|
2993 |
(238 169 184) 'pink2' |
|
2994 |
(205 145 158) 'pink3' |
|
2995 |
(139 99 108) 'pink4' |
|
2996 |
(221 160 221) 'plum' |
|
2997 |
(255 187 255) 'plum1' |
|
2998 |
(238 174 238) 'plum2' |
|
2999 |
(205 150 205) 'plum3' |
|
3000 |
(139 102 139) 'plum4' |
|
3001 |
(176 224 230) 'powder blue' |
|
3002 |
(176 224 230) 'PowderBlue' |
|
3003 |
(160 32 240) 'purple' |
|
3004 |
(155 48 255) 'purple1' |
|
3005 |
(145 44 238) 'purple2' |
|
3006 |
(125 38 205) 'purple3' |
|
3007 |
( 85 26 139) 'purple4' |
|
3008 |
(255 0 0) 'red' |
|
3009 |
(255 0 0) 'red1' |
|
3010 |
(238 0 0) 'red2' |
|
3011 |
(205 0 0) 'red3' |
|
3012 |
(139 0 0) 'red4' |
|
3013 |
(188 143 143) 'rosy brown' |
|
3014 |
(188 143 143) 'RosyBrown' |
|
3015 |
(255 193 193) 'RosyBrown1' |
|
3016 |
(238 180 180) 'RosyBrown2' |
|
3017 |
(205 155 155) 'RosyBrown3' |
|
3018 |
(139 105 105) 'RosyBrown4' |
|
3019 |
( 65 105 225) 'royal blue' |
|
3020 |
( 65 105 225) 'RoyalBlue' |
|
3021 |
( 72 118 255) 'RoyalBlue1' |
|
3022 |
( 67 110 238) 'RoyalBlue2' |
|
3023 |
( 58 95 205) 'RoyalBlue3' |
|
3024 |
( 39 64 139) 'RoyalBlue4' |
|
3025 |
(139 69 19) 'saddle brown' |
|
3026 |
(139 69 19) 'SaddleBrown' |
|
3027 |
(250 128 114) 'salmon' |
|
3028 |
(255 140 105) 'salmon1' |
|
3029 |
(238 130 98) 'salmon2' |
|
3030 |
(205 112 84) 'salmon3' |
|
3031 |
(139 76 57) 'salmon4' |
|
3032 |
(244 164 96) 'sandy brown' |
|
3033 |
(244 164 96) 'SandyBrown' |
|
3034 |
( 255 206 137) 'scoActiveBackground' |
|
3035 |
( 43 45 49) 'scoActiveForeground' |
|
3036 |
( 254 222 255) 'scoActiveTopShadow' |
|
3037 |
( 172 186 204) 'scoAltBackground' |
|
3038 |
( 203 203 192) 'scoBackground' |
|
3039 |
( 11 0 113) 'scoForeground' |
|
3040 |
( 141 178 215) 'scoHighlight' |
|
3041 |
( 255 240 248) 'scoTopShadow' |
|
3042 |
( 46 139 87) 'sea green' |
|
3043 |
( 46 139 87) 'SeaGreen' |
|
3044 |
( 84 255 159) 'SeaGreen1' |
|
3045 |
( 78 238 148) 'SeaGreen2' |
|
3046 |
( 67 205 128) 'SeaGreen3' |
|
3047 |
( 46 139 87) 'SeaGreen4' |
|
3048 |
(255 245 238) 'seashell' |
|
3049 |
(255 245 238) 'seashell1' |
|
3050 |
(238 229 222) 'seashell2' |
|
3051 |
(205 197 191) 'seashell3' |
|
3052 |
(139 134 130) 'seashell4' |
|
3053 |
(142 56 142) 'sgi beet' |
|
3054 |
(197 193 170) 'sgi bright gray' |
|
3055 |
(197 193 170) 'sgi bright grey' |
|
3056 |
(113 198 113) 'sgi chartreuse' |
|
3057 |
( 85 85 85) 'sgi dark gray' |
|
3058 |
( 85 85 85) 'sgi dark grey' |
|
3059 |
( 0 0 0) 'sgi gray 0' |
|
3060 |
(255 255 255) 'sgi gray 100' |
|
3061 |
( 30 30 30) 'sgi gray 12' |
|
3062 |
( 40 40 40) 'sgi gray 16' |
|
3063 |
( 51 51 51) 'sgi gray 20' |
|
3064 |
( 61 61 61) 'sgi gray 24' |
|
3065 |
( 71 71 71) 'sgi gray 28' |
|
3066 |
( 81 81 81) 'sgi gray 32' |
|
3067 |
( 91 91 91) 'sgi gray 36' |
|
3068 |
( 10 10 10) 'sgi gray 4' |
|
3069 |
(102 102 102) 'sgi gray 40' |
|
3070 |
(112 112 112) 'sgi gray 44' |
|
3071 |
(122 122 122) 'sgi gray 48' |
|
3072 |
(132 132 132) 'sgi gray 52' |
|
3073 |
(142 142 142) 'sgi gray 56' |
|
3074 |
(153 153 153) 'sgi gray 60' |
|
3075 |
(163 163 163) 'sgi gray 64' |
|
3076 |
(173 173 173) 'sgi gray 68' |
|
3077 |
(183 183 183) 'sgi gray 72' |
|
3078 |
(193 193 193) 'sgi gray 76' |
|
3079 |
( 20 20 20) 'sgi gray 8' |
|
3080 |
(204 204 204) 'sgi gray 80' |
|
3081 |
(214 214 214) 'sgi gray 84' |
|
3082 |
(224 224 224) 'sgi gray 88' |
|
3083 |
(234 234 234) 'sgi gray 92' |
|
3084 |
(244 244 244) 'sgi gray 96' |
|
3085 |
( 0 0 0) 'sgi grey 0' |
|
3086 |
(255 255 255) 'sgi grey 100' |
|
3087 |
( 30 30 30) 'sgi grey 12' |
|
3088 |
( 40 40 40) 'sgi grey 16' |
|
3089 |
( 51 51 51) 'sgi grey 20' |
|
3090 |
( 61 61 61) 'sgi grey 24' |
|
3091 |
( 71 71 71) 'sgi grey 28' |
|
3092 |
( 81 81 81) 'sgi grey 32' |
|
3093 |
( 91 91 91) 'sgi grey 36' |
|
3094 |
( 10 10 10) 'sgi grey 4' |
|
3095 |
(102 102 102) 'sgi grey 40' |
|
3096 |
(112 112 112) 'sgi grey 44' |
|
3097 |
(122 122 122) 'sgi grey 48' |
|
3098 |
(132 132 132) 'sgi grey 52' |
|
3099 |
(142 142 142) 'sgi grey 56' |
|
3100 |
(153 153 153) 'sgi grey 60' |
|
3101 |
(163 163 163) 'sgi grey 64' |
|
3102 |
(173 173 173) 'sgi grey 68' |
|
3103 |
(183 183 183) 'sgi grey 72' |
|
3104 |
(193 193 193) 'sgi grey 76' |
|
3105 |
( 20 20 20) 'sgi grey 8' |
|
3106 |
(204 204 204) 'sgi grey 80' |
|
3107 |
(214 214 214) 'sgi grey 84' |
|
3108 |
(224 224 224) 'sgi grey 88' |
|
3109 |
(234 234 234) 'sgi grey 92' |
|
3110 |
(244 244 244) 'sgi grey 96' |
|
3111 |
(125 158 192) 'sgi light blue' |
|
3112 |
(170 170 170) 'sgi light gray' |
|
3113 |
(170 170 170) 'sgi light grey' |
|
3114 |
(132 132 132) 'sgi medium gray' |
|
3115 |
(132 132 132) 'sgi medium grey' |
|
3116 |
(142 142 56) 'sgi olive drab' |
|
3117 |
(198 113 113) 'sgi salmon' |
|
3118 |
(113 113 198) 'sgi slate blue' |
|
3119 |
( 56 142 142) 'sgi teal' |
|
3120 |
( 40 40 40) 'sgi very dark gray' |
|
3121 |
( 40 40 40) 'sgi very dark grey' |
|
3122 |
(214 214 214) 'sgi very light gray' |
|
3123 |
(214 214 214) 'sgi very light grey' |
|
3124 |
(142 56 142) 'SGIBeet' |
|
3125 |
(197 193 170) 'SGIBrightGray' |
|
3126 |
(197 193 170) 'SGIBrightGrey' |
|
3127 |
(113 198 113) 'SGIChartreuse' |
|
3128 |
( 85 85 85) 'SGIDarkGray' |
|
3129 |
( 85 85 85) 'SGIDarkGrey' |
|
3130 |
( 0 0 0) 'SGIGray0' |
|
3131 |
(255 255 255) 'SGIGray100' |
|
3132 |
( 30 30 30) 'SGIGray12' |
|
3133 |
( 40 40 40) 'SGIGray16' |
|
3134 |
( 51 51 51) 'SGIGray20' |
|
3135 |
( 61 61 61) 'SGIGray24' |
|
3136 |
( 71 71 71) 'SGIGray28' |
|
3137 |
( 81 81 81) 'SGIGray32' |
|
3138 |
( 91 91 91) 'SGIGray36' |
|
3139 |
( 10 10 10) 'SGIGray4' |
|
3140 |
(102 102 102) 'SGIGray40' |
|
3141 |
(112 112 112) 'SGIGray44' |
|
3142 |
(122 122 122) 'SGIGray48' |
|
3143 |
(132 132 132) 'SGIGray52' |
|
3144 |
(142 142 142) 'SGIGray56' |
|
3145 |
(153 153 153) 'SGIGray60' |
|
3146 |
(163 163 163) 'SGIGray64' |
|
3147 |
(173 173 173) 'SGIGray68' |
|
3148 |
(183 183 183) 'SGIGray72' |
|
3149 |
(193 193 193) 'SGIGray76' |
|
3150 |
( 20 20 20) 'SGIGray8' |
|
3151 |
(204 204 204) 'SGIGray80' |
|
3152 |
(214 214 214) 'SGIGray84' |
|
3153 |
(224 224 224) 'SGIGray88' |
|
3154 |
(234 234 234) 'SGIGray92' |
|
3155 |
(244 244 244) 'SGIGray96' |
|
3156 |
( 0 0 0) 'SGIGrey0' |
|
3157 |
(255 255 255) 'SGIGrey100' |
|
3158 |
( 30 30 30) 'SGIGrey12' |
|
3159 |
( 40 40 40) 'SGIGrey16' |
|
3160 |
( 51 51 51) 'SGIGrey20' |
|
3161 |
( 61 61 61) 'SGIGrey24' |
|
3162 |
( 71 71 71) 'SGIGrey28' |
|
3163 |
( 81 81 81) 'SGIGrey32' |
|
3164 |
( 91 91 91) 'SGIGrey36' |
|
3165 |
( 10 10 10) 'SGIGrey4' |
|
3166 |
(102 102 102) 'SGIGrey40' |
|
3167 |
(112 112 112) 'SGIGrey44' |
|
3168 |
(122 122 122) 'SGIGrey48' |
|
3169 |
(132 132 132) 'SGIGrey52' |
|
3170 |
(142 142 142) 'SGIGrey56' |
|
3171 |
(153 153 153) 'SGIGrey60' |
|
3172 |
(163 163 163) 'SGIGrey64' |
|
3173 |
(173 173 173) 'SGIGrey68' |
|
3174 |
(183 183 183) 'SGIGrey72' |
|
3175 |
(193 193 193) 'SGIGrey76' |
|
3176 |
( 20 20 20) 'SGIGrey8' |
|
3177 |
(204 204 204) 'SGIGrey80' |
|
3178 |
(214 214 214) 'SGIGrey84' |
|
3179 |
(224 224 224) 'SGIGrey88' |
|
3180 |
(234 234 234) 'SGIGrey92' |
|
3181 |
(244 244 244) 'SGIGrey96' |
|
3182 |
(125 158 192) 'SGILightBlue' |
|
3183 |
(170 170 170) 'SGILightGray' |
|
3184 |
(170 170 170) 'SGILightGrey' |
|
3185 |
(132 132 132) 'SGIMediumGray' |
|
3186 |
(132 132 132) 'SGIMediumGrey' |
|
3187 |
(142 142 56) 'SGIOliveDrab' |
|
3188 |
(198 113 113) 'SGISalmon' |
|
3189 |
(113 113 198) 'SGISlateBlue' |
|
3190 |
( 56 142 142) 'SGITeal' |
|
3191 |
( 40 40 40) 'SGIVeryDarkGray' |
|
3192 |
( 40 40 40) 'SGIVeryDarkGrey' |
|
3193 |
(214 214 214) 'SGIVeryLightGray' |
|
3194 |
(214 214 214) 'SGIVeryLightGrey' |
|
3195 |
(160 82 45) 'sienna' |
|
3196 |
(255 130 71) 'sienna1' |
|
3197 |
(238 121 66) 'sienna2' |
|
3198 |
(205 104 57) 'sienna3' |
|
3199 |
(139 71 38) 'sienna4' |
|
3200 |
(135 206 235) 'sky blue' |
|
3201 |
(135 206 235) 'SkyBlue' |
|
3202 |
(135 206 255) 'SkyBlue1' |
|
3203 |
(126 192 238) 'SkyBlue2' |
|
3204 |
(108 166 205) 'SkyBlue3' |
|
3205 |
( 74 112 139) 'SkyBlue4' |
|
3206 |
(106 90 205) 'slate blue' |
|
3207 |
(112 128 144) 'slate gray' |
|
3208 |
(112 128 144) 'slate grey' |
|
3209 |
(106 90 205) 'SlateBlue' |
|
3210 |
(131 111 255) 'SlateBlue1' |
|
3211 |
(122 103 238) 'SlateBlue2' |
|
3212 |
(105 89 205) 'SlateBlue3' |
|
3213 |
( 71 60 139) 'SlateBlue4' |
|
3214 |
(112 128 144) 'SlateGray' |
|
3215 |
(198 226 255) 'SlateGray1' |
|
3216 |
(185 211 238) 'SlateGray2' |
|
3217 |
(159 182 205) 'SlateGray3' |
|
3218 |
(108 123 139) 'SlateGray4' |
|
3219 |
(112 128 144) 'SlateGrey' |
|
3220 |
(255 250 250) 'snow' |
|
3221 |
(255 250 250) 'snow1' |
|
3222 |
(238 233 233) 'snow2' |
|
3223 |
(205 201 201) 'snow3' |
|
3224 |
(139 137 137) 'snow4' |
|
3225 |
( 0 255 127) 'spring green' |
|
3226 |
( 0 255 127) 'SpringGreen' |
|
3227 |
( 0 255 127) 'SpringGreen1' |
|
3228 |
( 0 238 118) 'SpringGreen2' |
|
3229 |
( 0 205 102) 'SpringGreen3' |
|
3230 |
( 0 139 69) 'SpringGreen4' |
|
3231 |
( 70 130 180) 'steel blue' |
|
3232 |
( 70 130 180) 'SteelBlue' |
|
3233 |
( 99 184 255) 'SteelBlue1' |
|
3234 |
( 92 172 238) 'SteelBlue2' |
|
3235 |
( 79 148 205) 'SteelBlue3' |
|
3236 |
( 54 100 139) 'SteelBlue4' |
|
3237 |
(210 180 140) 'tan' |
|
3238 |
(255 165 79) 'tan1' |
|
3239 |
(238 154 73) 'tan2' |
|
3240 |
(205 133 63) 'tan3' |
|
3241 |
(139 90 43) 'tan4' |
|
3242 |
(216 191 216) 'thistle' |
|
3243 |
(255 225 255) 'thistle1' |
|
3244 |
(238 210 238) 'thistle2' |
|
3245 |
(205 181 205) 'thistle3' |
|
3246 |
(139 123 139) 'thistle4' |
|
3247 |
(255 99 71) 'tomato' |
|
3248 |
(255 99 71) 'tomato1' |
|
3249 |
(238 92 66) 'tomato2' |
|
3250 |
(205 79 57) 'tomato3' |
|
3251 |
(139 54 38) 'tomato4' |
|
3252 |
( 64 224 208) 'turquoise' |
|
3253 |
( 0 245 255) 'turquoise1' |
|
3254 |
( 0 229 238) 'turquoise2' |
|
3255 |
( 0 197 205) 'turquoise3' |
|
3256 |
( 0 134 139) 'turquoise4' |
|
3257 |
(238 130 238) 'violet' |
|
3258 |
(208 32 144) 'violet red' |
|
3259 |
(208 32 144) 'VioletRed' |
|
3260 |
(255 62 150) 'VioletRed1' |
|
3261 |
(238 58 140) 'VioletRed2' |
|
3262 |
(205 50 120) 'VioletRed3' |
|
3263 |
(139 34 82) 'VioletRed4' |
|
3264 |
(245 222 179) 'wheat' |
|
3265 |
(255 231 186) 'wheat1' |
|
3266 |
(238 216 174) 'wheat2' |
|
3267 |
(205 186 150) 'wheat3' |
|
3268 |
(139 126 102) 'wheat4' |
|
3269 |
(255 255 255) 'white' |
|
3270 |
(245 245 245) 'white smoke' |
|
3271 |
(245 245 245) 'WhiteSmoke' |
|
3272 |
(255 255 0) 'yellow' |
|
3273 |
(154 205 50) 'yellow green' |
|
3274 |
(255 255 0) 'yellow1' |
|
3275 |
(238 238 0) 'yellow2' |
|
3276 |
(205 205 0) 'yellow3' |
|
3277 |
(139 139 0) 'yellow4' |
|
3278 |
(154 205 50) 'YellowGreen' |
|
3279 |
) pairWiseDo:[ :value :name | |
|
3280 |
StandardColorValues at:name put:value |
|
3281 |
]. |
|
3282 |
" |
|
3283 |
WinWorkstation initializeStandardColorNames |
|
3284 |
" |
|
3285 |
||
3286 |
||
2232 | 3287 |
! |
3288 |
||
1705 | 3289 |
nativeWindows:aBoolean |
3290 |
"enable / disable use of native windows" |
|
3291 |
||
3292 |
NativeWindows := aBoolean |
|
2232 | 3293 |
! ! |
3294 |
||
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3295 |
!WinWorkstation class methodsFor:'debugging'! |
2232 | 3296 |
|
1127 | 3297 |
debug:aBoolean |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3298 |
"enable/disable debug prints - this will vanish" |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3299 |
|
1127 | 3300 |
%{ /* NOCONTEXT */ |
3301 |
||
3302 |
__debug__ = (aBoolean == true) ? 1 : 0; |
|
3303 |
%} |
|
2232 | 3304 |
! |
3305 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3306 |
prim |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3307 |
"show prim values" |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3308 |
|
2232 | 3309 |
('WINWORKSTATION: pW=',self primWindows printString,'pB=',self primBitmaps printString,'pGc=',self primgcData printString,'pbmpdc=',self primBmpDc printString) errorPrintNL |
3310 |
! |
|
3311 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3312 |
primBitmaps |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3313 |
%{ /* NOCONTEXT */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3314 |
RETURN ( __MKSMALLINT(__cnt_bitmap)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3315 |
%} |
2232 | 3316 |
! |
3317 |
||
3318 |
primBmpDc |
|
3319 |
%{ /* NOCONTEXT */ |
|
3320 |
RETURN ( __MKSMALLINT(__cnt_bmpdc)); |
|
3321 |
%} |
|
3322 |
! |
|
3323 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3324 |
primWindows |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3325 |
%{ /* NOCONTEXT */ |
2232 | 3326 |
RETURN ( __MKSMALLINT(__cnt_createWindows)); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3327 |
%} |
2232 | 3328 |
! |
3329 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3330 |
primgcData |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3331 |
%{ /* NOCONTEXT */ |
2232 | 3332 |
RETURN ( __MKSMALLINT(__cnt_gcData)); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3333 |
%} |
2232 | 3334 |
! ! |
3335 |
||
3336 |
!WinWorkstation class methodsFor:'queries'! |
|
3337 |
||
1127 | 3338 |
getSystemMetrics:aSymbol |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3339 |
"get a system metrics value" |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3340 |
|
2232 | 3341 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 3342 |
int info = 0; |
3343 |
int isBool = 0; |
|
3344 |
int arg; |
|
3345 |
||
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3346 |
if ((aSymbol == @symbol(swapButton)) |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3347 |
|| (aSymbol == @symbol(SM_SWAPBUTTON))) { |
1127 | 3348 |
arg = SM_SWAPBUTTON; |
3349 |
isBool = 1; |
|
3350 |
} else if (aSymbol == @symbol(mouseButtons)) { |
|
3351 |
arg = SM_CMOUSEBUTTONS; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3352 |
} else if ((aSymbol == @symbol(iconWidth)) || (aSymbol == @symbol(SM_CXICON))) { |
1127 | 3353 |
arg = SM_CXICON; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3354 |
} else if ((aSymbol == @symbol(iconHeight)) || (aSymbol == @symbol(SM_CYICON))) { |
1127 | 3355 |
arg = SM_CYICON; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3356 |
} else if ((aSymbol == @symbol(cursorWidth)) || (aSymbol == @symbol(SM_CXCURSOR))) { |
1127 | 3357 |
arg = SM_CXCURSOR; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3358 |
} else if ((aSymbol == @symbol(cursorHeight)) || (aSymbol == @symbol(SM_CYCURSOR))) { |
1127 | 3359 |
arg = SM_CYCURSOR; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3360 |
} else if ((aSymbol == @symbol(captionHeight)) || (aSymbol == @symbol(SM_CYCAPTION))) { |
1127 | 3361 |
arg = SM_CYCAPTION; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3362 |
} else if ((aSymbol == @symbol(resizeFrameWidth)) || (aSymbol == @symbol(SM_CXFRAME))) { |
1127 | 3363 |
arg = SM_CXFRAME; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3364 |
} else if ((aSymbol == @symbol(resizeFrameHeight)) || (aSymbol == @symbol(SM_CYFRAME))) { |
1127 | 3365 |
arg = SM_CYFRAME; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3366 |
} else if ((aSymbol == @symbol(borderFrameWidth)) || (aSymbol == @symbol(SM_CXBORDER))) { |
1127 | 3367 |
arg = SM_CXBORDER; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3368 |
} else if ((aSymbol == @symbol(borderFrameHeight)) || (aSymbol == @symbol(SM_CYBORDER))) { |
1127 | 3369 |
arg = SM_CYBORDER; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3370 |
} else if ((aSymbol == @symbol(fullScreenWindowWidth)) || (aSymbol == @symbol(SM_CXFULLSCREEN))) { |
1127 | 3371 |
arg = SM_CXFULLSCREEN; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3372 |
} else if ((aSymbol == @symbol(fullScreenWindowHeight)) || (aSymbol == @symbol(SM_CYFULLSCREEN))) { |
1127 | 3373 |
arg = SM_CYFULLSCREEN; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3374 |
} else if ((aSymbol == @symbol(vScrollbarWidth)) || (aSymbol == @symbol(SM_CXVSCROLL))) { |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3375 |
arg = SM_CXVSCROLL; |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3376 |
} else if ((aSymbol == @symbol(hScrollbarHeight)) || (aSymbol == @symbol(SM_CYHSCROLL))) { |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3377 |
arg = SM_CYHSCROLL; |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3378 |
} else if ((aSymbol == @symbol(vThumbHeight)) || (aSymbol == @symbol(SM_CYVTHUMB))) { |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3379 |
arg = SM_CYVTHUMB; |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3380 |
} else if ((aSymbol == @symbol(hThumbWidth)) || (aSymbol == @symbol(SM_CXHTHUMB))) { |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3381 |
arg = SM_CXHTHUMB; |
1127 | 3382 |
} else { |
3383 |
RETURN (nil); |
|
3384 |
} |
|
3385 |
info = GetSystemMetrics(arg); |
|
3386 |
if (isBool) { |
|
3387 |
RETURN (info ? true : false); |
|
3388 |
} |
|
3389 |
RETURN (__MKSMALLINT(info)); |
|
3390 |
%} |
|
2232 | 3391 |
! |
3392 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3393 |
platformName |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3394 |
"ST-80 compatibility. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3395 |
Return a string describing the display systems platform." |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3396 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3397 |
^ 'WIN32' |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3398 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3399 |
"Modified: 26.5.1996 / 15:32:46 / cg" |
2232 | 3400 |
! ! |
3401 |
||
3402 |
!WinWorkstation methodsFor:'accessing & queries'! |
|
3403 |
||
1127 | 3404 |
anyButtonMotionMask |
3405 |
"return the state-mask for any button in motion events' state-field. |
|
3406 |
This is the devices mask." |
|
3407 |
||
3408 |
%{ /* NOCONTEXT */ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3409 |
RETURN ( __MKSMALLINT(Button1MotionMask | Button2MotionMask | Button3MotionMask)); |
1723 | 3410 |
%} |
2232 | 3411 |
! |
3412 |
||
1127 | 3413 |
blackpixel |
3414 |
"return the colornumber of black" |
|
3415 |
||
3416 |
^ blackpixel |
|
2232 | 3417 |
! |
3418 |
||
1127 | 3419 |
button1MotionMask |
3420 |
"return the state-mask for button1 in motion events' state-field. |
|
3421 |
For backward compatibility." |
|
3422 |
||
3423 |
%{ /* NOCONTEXT */ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3424 |
RETURN (__MKSMALLINT(Button1MotionMask)); |
1127 | 3425 |
%} |
3426 |
||
3427 |
" |
|
3428 |
Display button1MotionMask |
|
3429 |
" |
|
2232 | 3430 |
! |
3431 |
||
1127 | 3432 |
button2MotionMask |
3433 |
"return the state-mask for button2 in motion events' state-field |
|
3434 |
For backward compatibility." |
|
3435 |
||
3436 |
%{ /* NOCONTEXT */ |
|
3437 |
RETURN (__MKSMALLINT(Button2MotionMask)); |
|
3438 |
%} |
|
2232 | 3439 |
! |
3440 |
||
1127 | 3441 |
button3MotionMask |
3442 |
"return the state-mask for button3 in motion events' state-field |
|
3443 |
For backward compatibility." |
|
3444 |
||
3445 |
%{ /* NOCONTEXT */ |
|
3446 |
RETURN (__MKSMALLINT(Button3MotionMask)); |
|
3447 |
%} |
|
2232 | 3448 |
! |
3449 |
||
1127 | 3450 |
buttonMotionMask:aButton |
3451 |
"return the state-mask for button1 in motion events state-field. |
|
3452 |
This is the devices mask." |
|
3453 |
||
3454 |
%{ /* NOCONTEXT */ |
|
3455 |
if (aButton == __MKSMALLINT(1)) { |
|
3456 |
RETURN (__MKSMALLINT(Button1MotionMask)); |
|
3457 |
} |
|
3458 |
if (aButton == __MKSMALLINT(2)) { |
|
3459 |
RETURN (__MKSMALLINT(Button2MotionMask)); |
|
3460 |
} |
|
3461 |
if (aButton == __MKSMALLINT(3)) { |
|
3462 |
RETURN (__MKSMALLINT(Button3MotionMask)); |
|
3463 |
} |
|
3464 |
%}. |
|
3465 |
^ nil |
|
2232 | 3466 |
! |
3467 |
||
1127 | 3468 |
controlMask |
3469 |
"return the state-mask for the CTRL modified in motion events' state-field." |
|
3470 |
||
3471 |
%{ /* NOCONTEXT */ |
|
3472 |
RETURN (__MKSMALLINT(ControlMask)); |
|
3473 |
%} |
|
2232 | 3474 |
! |
3475 |
||
1127 | 3476 |
defaultEventMask |
3477 |
"return a mask to enable some events by default." |
|
3478 |
||
3479 |
%{ /* NOCONTEXT */ |
|
2151 | 3480 |
RETURN (__MKSMALLINT( ExposureMask | StructureNotifyMask | |
1127 | 3481 |
KeyPressMask | KeyReleaseMask | |
3482 |
EnterWindowMask | LeaveWindowMask | |
|
3483 |
ButtonPressMask | ButtonMotionMask | ButtonReleaseMask )); |
|
2151 | 3484 |
%} |
2232 | 3485 |
! |
3486 |
||
1127 | 3487 |
displayFileDescriptor |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
3488 |
"return the displays fileNumber for select, if any" |
1127 | 3489 |
|
3490 |
%{ /* NOCONTEXT */ |
|
2232 | 3491 |
/* RETURN (nil);*/ |
3492 |
RETURN ( __MKEXTERNALADDRESS(hInputEvent)); |
|
1127 | 3493 |
%} |
2232 | 3494 |
! |
3495 |
||
1127 | 3496 |
displayName |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
3497 |
"return the display-connections display name. |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
3498 |
For Windows, a dummy name is returned" |
1127 | 3499 |
|
3500 |
^ 'local' |
|
2232 | 3501 |
! |
3502 |
||
1723 | 3503 |
getSystemColor:aKey |
2298
0b4a9634b79c
added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
3504 |
"retrieve a windows system color. |
0b4a9634b79c
added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
3505 |
The styleSheet/View classes may use this to setup default colors" |
0b4a9634b79c
added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
3506 |
|
1723 | 3507 |
|rgb| |
3508 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3509 |
rgb := self primGetSystemColor:aKey. |
1723 | 3510 |
rgb notNil ifTrue:[ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3511 |
^ Color |
1723 | 3512 |
redByte:((rgb bitShift:-16) bitAnd:16rFF) |
3513 |
greenByte:((rgb bitShift:-8) bitAnd:16rFF) |
|
3514 |
blueByte:(rgb bitAnd:16rFF) |
|
3515 |
]. |
|
3516 |
^ nil |
|
2298
0b4a9634b79c
added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
3517 |
|
0b4a9634b79c
added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
3518 |
" |
0b4a9634b79c
added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
3519 |
Display getSystemColor:#COLOR_WINDOW |
0b4a9634b79c
added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
3520 |
Display getSystemColor:#COLOR_HIGHLIGHT |
0b4a9634b79c
added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
3521 |
" |
2232 | 3522 |
! |
3523 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3524 |
primGetSystemColor:aKey |
2232 | 3525 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2238 | 3526 |
int p; |
2298
0b4a9634b79c
added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
3527 |
int rgb, r, g, b; |
2238 | 3528 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3529 |
if (aKey == @symbol(COLOR_WINDOW)) { |
2240 | 3530 |
p = COLOR_WINDOW; |
2238 | 3531 |
} else if (aKey == @symbol(COLOR_WINDOWTEXT)) { |
2240 | 3532 |
p = COLOR_WINDOWTEXT; |
2238 | 3533 |
} else if (aKey == @symbol(COLOR_MENU)) { |
2240 | 3534 |
p = COLOR_MENU; |
2238 | 3535 |
} else if (aKey == @symbol(COLOR_MENUTEXT)) { |
2240 | 3536 |
p = COLOR_MENUTEXT; |
2238 | 3537 |
} else if (aKey == @symbol(COLOR_BTNFACE)) { |
2240 | 3538 |
p = COLOR_BTNFACE; |
2238 | 3539 |
} else if (aKey == @symbol(COLOR_BTNSHADOW)) { |
2240 | 3540 |
p = COLOR_BTNSHADOW; |
2238 | 3541 |
} else if (aKey == @symbol(COLOR_BTNTEXT)) { |
2240 | 3542 |
p = COLOR_BTNTEXT; |
2238 | 3543 |
} else if (aKey == @symbol(COLOR_GRAYTEXT)) { |
2240 | 3544 |
p = COLOR_GRAYTEXT; |
2238 | 3545 |
} else if (aKey == @symbol(COLOR_HIGHLIGHT)) { |
2240 | 3546 |
p = COLOR_HIGHLIGHT; |
2238 | 3547 |
} else if (aKey == @symbol(COLOR_HIGHLIGHTTEXT)) { |
2240 | 3548 |
p = COLOR_HIGHLIGHTTEXT; |
2238 | 3549 |
} else if (aKey == @symbol(COLOR_MENU)) { |
2240 | 3550 |
p = COLOR_MENU; |
2238 | 3551 |
} else if (aKey == @symbol(COLOR_MENUTEXT)) { |
2240 | 3552 |
p = COLOR_MENUTEXT; |
2238 | 3553 |
} else if (aKey == @symbol(COLOR_SCROLLBAR)) { |
2240 | 3554 |
p = COLOR_SCROLLBAR; |
2239 | 3555 |
#ifdef COLOR_SHADOW |
2238 | 3556 |
} else if (aKey == @symbol(COLOR_SHADOW)) { |
2240 | 3557 |
p = COLOR_SHADOW; |
2239 | 3558 |
#endif |
2238 | 3559 |
} else { |
2240 | 3560 |
RETURN (nil); |
2238 | 3561 |
} |
2298
0b4a9634b79c
added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
3562 |
rgb = GetSysColor(p); |
0b4a9634b79c
added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
3563 |
/* win uses BGR order */ |
0b4a9634b79c
added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
3564 |
r = rgb & 0xFF; |
0b4a9634b79c
added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
3565 |
g = (rgb >> 8) & 0xFF; |
0b4a9634b79c
added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
3566 |
b = (rgb >> 16) & 0xFF; |
0b4a9634b79c
added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
3567 |
rgb = (((r << 8) | g) << 8) | b; |
0b4a9634b79c
added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
3568 |
RETURN (__MKSMALLINT(rgb)); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3569 |
%}. |
2232 | 3570 |
! |
3571 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3572 |
primTranslatePointX:x y:y from:windowId1 to:windowId2 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3573 |
|
2232 | 3574 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3575 |
HWND w1, w2; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3576 |
POINT point; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3577 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3578 |
if (__isExternalAddress(windowId1) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3579 |
&& __isExternalAddress(windowId2) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3580 |
&& __bothSmallInteger(x, y)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3581 |
w1 = _HWNDVal(windowId1); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3582 |
w2 = _HWNDVal(windowId2); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3583 |
point.x = __intVal(x); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3584 |
point.y = __intVal(y); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3585 |
DPRINTF(("TransPoint %x %d/%d ->",w1,point.x,point.y)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3586 |
ClientToScreen(w1,&point); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3587 |
ScreenToClient(w2,&point); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3588 |
DPRINTF((" %x %d/%d\n",w2,point.x,point.y)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3589 |
RETURN (__MKPOINT_INT(point.x, point.y)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3590 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3591 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3592 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3593 |
%} |
2232 | 3594 |
! |
3595 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3596 |
primViewIdFromPoint:aPoint in:windowId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3597 |
"given a point in rootWindow, return the viewId of the subview of windowId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3598 |
hit by this coordinate. Return nil if no view was hit. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3599 |
The returned id may be the id of a non ST view. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3600 |
- used to find the window to drop objects after a cross-view drag." |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3601 |
|
2232 | 3602 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3603 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3604 |
OBJ xp, yp; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3605 |
int xpos, ypos; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3606 |
HWND child_return; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3607 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3608 |
if (ISCONNECTED |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3609 |
&& __isExternalAddress(windowId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3610 |
&& __isPoint(aPoint)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3611 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3612 |
xp = _point_X(aPoint); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3613 |
yp = _point_Y(aPoint); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3614 |
if (__bothSmallInteger(xp, yp)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3615 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3616 |
POINT p; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3617 |
HWND hWnd = _HWNDVal(windowId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3618 |
p.x = __intVal(xp); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3619 |
p.y = __intVal(yp); |
2151 | 3620 |
ScreenToClient(hWnd, &p); |
2232 | 3621 |
child_return = ChildWindowFromPointEx(hWnd,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT); |
2151 | 3622 |
/*printf("ChildWindow From %x Point %d.%d = %x\n",hWnd,p.x,p.y,child_return);*/ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3623 |
if ((child_return) && (child_return != hWnd)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3624 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3625 |
RETURN ( __MKEXTERNALADDRESS(child_return) ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3626 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3627 |
RETURN ( nil ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3628 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3629 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3630 |
%}. |
2232 | 3631 |
! |
3632 |
||
2151 | 3633 |
protocolVersion |
3634 |
"return the displays protocol version. |
|
3635 |
For Windows, a dummy number is returned" |
|
3636 |
||
3637 |
^ '1' |
|
3638 |
||
3639 |
" |
|
3640 |
Display protocolVersion |
|
3641 |
" |
|
2232 | 3642 |
! |
3643 |
||
2151 | 3644 |
serverVendor |
3645 |
"return the server vendor string. |
|
3646 |
For Windows, a dummy name is returned" |
|
3647 |
||
3648 |
^ 'microsoft' |
|
3649 |
||
3650 |
" |
|
3651 |
Display serverVendor |
|
3652 |
" |
|
2232 | 3653 |
! |
3654 |
||
2151 | 3655 |
shiftMask |
3656 |
"return the state-mask for the SHIFT modified in motion events' state-field." |
|
3657 |
||
3658 |
%{ /* NOCONTEXT */ |
|
3659 |
RETURN (__MKSMALLINT(ShiftMask)); |
|
3660 |
%} |
|
2232 | 3661 |
! |
3662 |
||
2151 | 3663 |
translatePoint:aPoint from:windowId1 to:windowId2 |
3664 |
"given a point in window1, return the coordinate in window2. |
|
3665 |
This expects a device coordinate (relative to the first views origin) |
|
3666 |
in aPoint and returns a device coordinate relative to the 2nd views origin. |
|
3667 |
- use to xlate points from a window to rootwindow" |
|
3668 |
||
2276 | 3669 |
|x1 y1 x2 y2| |
3670 |
||
3671 |
x1 := x2 := aPoint x truncated. |
|
3672 |
y1 := y2 := aPoint y truncated. |
|
3673 |
||
3674 |
%{ |
|
3675 |
HWND w1, w2; |
|
3676 |
POINT point; |
|
3677 |
||
3678 |
if (__isExternalAddress(windowId1) |
|
3679 |
&& __isExternalAddress(windowId2) |
|
2279 | 3680 |
&& __bothSmallInteger(x1, y1)) { |
2297
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
3681 |
w1 = _HWNDVal(windowId1); |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
3682 |
w2 = _HWNDVal(windowId2); |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
3683 |
point.x = __intVal(x1); |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
3684 |
point.y = __intVal(y1); |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
3685 |
DPRINTF(("TransPoint %x %d/%d ->",w1,point.x,point.y)); |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
3686 |
ClientToScreen(w1,&point); |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
3687 |
ScreenToClient(w2,&point); |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
3688 |
DPRINTF((" %x %d/%d\n",w2,point.x,point.y)); |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
3689 |
x2 = __MKSMALLINT(point.x); |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
3690 |
y2 = __MKSMALLINT(point.y); |
2276 | 3691 |
} |
3692 |
%}. |
|
3693 |
^ (x2 @ y2) |
|
3694 |
||
2232 | 3695 |
! |
3696 |
||
2151 | 3697 |
vendorRelease |
3698 |
"return the display-servers vendor release |
|
3699 |
- should normally not be of any interest, |
|
3700 |
but may be usefule for special cases. |
|
3701 |
(to avoid bugs in certain implementations / releases)" |
|
3702 |
||
3703 |
^ 1 |
|
3704 |
||
3705 |
" |
|
3706 |
Display vendorRelease |
|
3707 |
" |
|
2232 | 3708 |
! |
3709 |
||
2151 | 3710 |
viewIdFromPoint:aPoint in:windowId |
3711 |
"given a point in rootWindow, return the viewId of the subview of windowId |
|
3712 |
hit by this coordinate. Return nil if no view was hit. |
|
3713 |
The returned id may be the id of a non ST view. |
|
3714 |
- used to find the window to drop objects after a cross-view drag." |
|
3715 |
||
3716 |
windowId notNil ifTrue:[ |
|
3717 |
aPoint isPoint ifTrue:[ |
|
2232 | 3718 |
"/(aPoint x > 30000) ifTrue:[self halt.]. |
3719 |
"/(aPoint y > 30000) ifTrue:[self halt.]. |
|
3720 |
"/aPoint printString errorPrintCR. |
|
2151 | 3721 |
^ self primViewIdFromPoint:aPoint asPoint truncated in:windowId |
3722 |
] |
|
3723 |
]. |
|
3724 |
||
3725 |
^ nil |
|
2232 | 3726 |
! |
3727 |
||
1127 | 3728 |
whitepixel |
3729 |
"return the colornumber of white" |
|
3730 |
||
3731 |
^ whitepixel |
|
2232 | 3732 |
! ! |
3733 |
||
3734 |
!WinWorkstation methodsFor:'accessing display capabilities'! |
|
3735 |
||
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3736 |
captionHeight |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3737 |
"return the height in pixels of any caption (title-bar) in |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3738 |
standard topWindows." |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3739 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3740 |
^ self class getSystemMetrics:#captionHeight |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3741 |
! |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3742 |
|
1127 | 3743 |
iconSizes |
3744 |
"Get the preferred/supported icon sizes." |
|
3745 |
||
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3746 |
|d w h| |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3747 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3748 |
w := self class getSystemMetrics:#iconWidth. |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3749 |
h := self class getSystemMetrics:#iconHeight. |
1127 | 3750 |
|
3751 |
d := IdentityDictionary new. |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3752 |
d at:#minWidth put:w. |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3753 |
d at:#maxWidth put:h. |
1127 | 3754 |
d at:#widthStep put:1. |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3755 |
d at:#minHeight put:w. |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3756 |
d at:#maxHeight put:h. |
1127 | 3757 |
d at:#heightStep put:1. |
3758 |
||
3759 |
^ OrderedCollection with:d |
|
3760 |
||
3761 |
" |
|
3762 |
Display iconSizes |
|
3763 |
" |
|
2232 | 3764 |
! |
3765 |
||
2151 | 3766 |
scrollsAsynchronous |
3767 |
"return true, if this display asynchronously sends expose events after a |
|
3768 |
scroll operation. False otherwise. Asynchronous expose events are an X |
|
3769 |
speciality, which affects a few methods outside of the display class (sorry)" |
|
3770 |
||
3771 |
"/ event Handling erst verbessern |
|
2232 | 3772 |
^ true "/ false |
3773 |
! |
|
3774 |
||
2151 | 3775 |
supportedImageFormats |
3776 |
"return an array with supported image formats; each array entry |
|
3777 |
is another array, consisting of depth and bitsPerPixel values." |
|
3778 |
||
3779 |
|info| |
|
3780 |
||
3781 |
info := IdentityDictionary new. |
|
3782 |
info at:#depth put:depth. |
|
3783 |
info at:#bitsPerPixel put:depth. |
|
3784 |
info at:#padding put:32. |
|
3785 |
^ Array with:info |
|
2232 | 3786 |
! |
3787 |
||
2151 | 3788 |
supportsDeepIcons |
3789 |
"return true, if this device supports deepicons." |
|
3790 |
||
3791 |
^ true |
|
2232 | 3792 |
! |
3793 |
||
1127 | 3794 |
supportsIconViews |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
3795 |
"return true, if this device supports views as icons." |
1127 | 3796 |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3797 |
^ false "/ true |
1127 | 3798 |
|
3799 |
" |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3800 |
Display supportsIconViews |
1127 | 3801 |
" |
3802 |
||
3803 |
"Modified: 10.6.1996 / 20:11:48 / cg" |
|
3804 |
"Created: 10.6.1996 / 21:08:18 / cg" |
|
2232 | 3805 |
! |
3806 |
||
1705 | 3807 |
usableExtent |
3808 |
"return the usable extent of the display (in pixels). |
|
3809 |
Normally, the same as extent, but may be smaller, in |
|
3810 |
case some menu space is taken up by the window manager (windows)" |
|
3811 |
||
3812 |
^ (self class getSystemMetrics:#fullScreenWindowWidth) |
|
3813 |
@ |
|
3814 |
(self class getSystemMetrics:#fullScreenWindowHeight) |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3815 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3816 |
" |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3817 |
Display usableExtent |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
3818 |
" |
2232 | 3819 |
! ! |
3820 |
||
3821 |
!WinWorkstation methodsFor:'bitmap/window creation'! |
|
3822 |
||
1127 | 3823 |
createBitmapFromArray:anArray width:w height:h |
3824 |
|bitmapId| |
|
3825 |
||
3826 |
bitmapId := self primCreateBitmapFromArray:anArray width:w height:h. |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
3827 |
|
1127 | 3828 |
bitmapId isNil ifTrue:[ |
3829 |
'WINWORKSTATION: cannot create bitmap' errorPrintCR. |
|
3830 |
]. |
|
3831 |
^ bitmapId |
|
2232 | 3832 |
! |
3833 |
||
1127 | 3834 |
createBitmapWidth:w height:h |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3835 |
|
2232 | 3836 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
3837 |
HANDLE newBitmapHandle; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
3838 |
int b_width, b_height; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3839 |
/* printf("CreateBitmap B/W\n");*/ |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
3840 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
3841 |
if (__bothSmallInteger(w, h)) { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
3842 |
b_width = __intVal(w); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
3843 |
b_height = __intVal(h); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
3844 |
newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, NULL); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
3845 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3846 |
if (newBitmapHandle) |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
3847 |
{ |
2232 | 3848 |
#ifdef COUNT_BMP_RESOURCES |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3849 |
__cnt_bitmap++; |
2232 | 3850 |
RES_BMP_PRINTF(("CreateBitmap %x %d\n",newBitmapHandle,__cnt_bitmap)); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3851 |
#endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3852 |
RETURN ( __MKOBJ(newBitmapHandle)); |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
3853 |
} |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
3854 |
DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle)); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
3855 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3856 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3857 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3858 |
%} |
2232 | 3859 |
! |
3860 |
||
1127 | 3861 |
createPixmapWidth:w height:h depth:d |
3862 |
"allocate a pixmap on the Xserver, the contents is undefined |
|
3863 |
(i.e. random). Return a bitmap id or nil" |
|
3864 |
||
2232 | 3865 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
3866 |
HANDLE newBitmapHandle; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3867 |
/*printf("CreateBitmap Color\n");*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3868 |
if (__bothSmallInteger(w, h) && __isSmallInteger(d) && ISCONNECTED) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3869 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3870 |
if (__intVal(d) == 1) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3871 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3872 |
newBitmapHandle = CreateBitmap(__intVal(w), __intVal(h) , 1, 1, NULL); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3873 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3874 |
else |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
3875 |
{ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3876 |
/*if (__intVal(d) != __depth) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3877 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3878 |
printf("invalite depth\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3879 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3880 |
} */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3881 |
newBitmapHandle = CreateCompatibleBitmap(__rootDC,__intVal(w), __intVal(h) ); |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
3882 |
} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3883 |
if (newBitmapHandle) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3884 |
{ |
2232 | 3885 |
#ifdef COUNT_BMP_RESOURCES |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
3886 |
__cnt_bitmap++; |
2232 | 3887 |
RES_BMP_PRINTF(("CreatePixmap %x %d\n",newBitmapHandle,__cnt_bitmap)); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
3888 |
#endif |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3889 |
RETURN ( __MKOBJ(newBitmapHandle)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3890 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3891 |
DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3892 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3893 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3894 |
%} |
2232 | 3895 |
! |
3896 |
||
1467
9629ce710c53
added type argument to createWindowFor - prepare for native window support (windows)
Claus Gittinger <cg@exept.de>
parents:
1461
diff
changeset
|
3897 |
createWindowFor:aView type:typeSymbol |
1127 | 3898 |
origin:origin |
3899 |
extent:extent |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3900 |
minExtent:minExt |
1127 | 3901 |
maxExtent:maxExt |
3902 |
borderWidth:bWidth |
|
3903 |
subViewOf:wsuperView |
|
1705 | 3904 |
style:wStyle |
1127 | 3905 |
inputOnly:winputOnly |
3906 |
label:wlabel |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3907 |
owner:wowner |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3908 |
icon:wicon |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
3909 |
iconMask:wiconMask |
1127 | 3910 |
iconView:wiconView |
3911 |
||
2232 | 3912 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3913 |
|xpos ypos wwidth wheight minWidth minHeight maxWidth maxHeight |
2232 | 3914 |
wsuperViewId wiconId wiconMaskId windowId |
3915 |
weventMask wiconHeight |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3916 |
wiconWidth windowType windowClass moreArgs| |
1127 | 3917 |
|
2232 | 3918 |
"/ bColorId wiconViewId bitGravity vBgColor vBgForm deepForm |
3919 |
"/ preferredVisual preferredDepth viewGravity wcursorId |
|
3920 |
||
1127 | 3921 |
displayId isNil ifTrue:[ |
3922 |
self primitiveFailed. |
|
3923 |
^ nil |
|
3924 |
]. |
|
3925 |
||
3926 |
origin notNil ifTrue:[ |
|
3927 |
xpos := origin x. |
|
3928 |
ypos := origin y. |
|
3929 |
] ifFalse:[ |
|
3930 |
xpos := ypos := 0. |
|
3931 |
]. |
|
3932 |
extent notNil ifTrue:[ |
|
3933 |
wwidth := extent x. |
|
3934 |
wheight := extent y. |
|
3935 |
] ifFalse:[ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3936 |
wwidth := 100. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3937 |
wheight := 40. |
1127 | 3938 |
]. |
3939 |
minExt notNil ifTrue:[ |
|
3940 |
minWidth := minExt x. |
|
3941 |
minHeight := minExt y |
|
3942 |
]. |
|
3943 |
maxExt notNil ifTrue:[ |
|
3944 |
maxWidth := maxExt x. |
|
3945 |
maxHeight := maxExt y |
|
3946 |
]. |
|
3947 |
||
3948 |
wsuperView notNil ifTrue:[ |
|
3949 |
wsuperViewId := wsuperView id |
|
3950 |
]. |
|
3951 |
||
3952 |
wicon notNil ifTrue:[ |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
3953 |
wiconId := wicon id. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
3954 |
wiconHeight := wicon height. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
3955 |
wiconWidth := wicon width. |
1418 | 3956 |
wiconMask notNil ifTrue:[ |
3957 |
wiconMaskId := wiconMask id |
|
3958 |
] |
|
1127 | 3959 |
]. |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3960 |
"/ wiconView notNil ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3961 |
"/ wiconViewId := wiconView id |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3962 |
"/ ]. |
2151 | 3963 |
weventMask := aView eventMask. |
1127 | 3964 |
|
1705 | 3965 |
NativeWindows ifTrue:[ |
1723 | 3966 |
windowType := aView nativeWindowType. |
1705 | 3967 |
|
3968 |
"/ if it is already a string, take it as it is; |
|
3969 |
"/ otherwise, it must be a symbol and is used |
|
3970 |
"/ as a key into the nativeClass translation map. |
|
3971 |
||
3972 |
windowType isString ifTrue:[ |
|
3973 |
windowClass := windowType |
|
3974 |
] ifFalse:[ |
|
3975 |
windowClass := NativeWindowClassTable at:windowType ifAbsent:nil |
|
3976 |
] |
|
3977 |
]. |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
3978 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3979 |
moreArgs := Array new:20. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3980 |
moreArgs at:1 put:xpos. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3981 |
moreArgs at:2 put:ypos. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3982 |
moreArgs at:3 put:wwidth. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3983 |
moreArgs at:4 put:wheight. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3984 |
moreArgs at:5 put:minWidth. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3985 |
moreArgs at:6 put:minHeight. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3986 |
moreArgs at:7 put:maxWidth. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3987 |
moreArgs at:8 put:maxHeight. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3988 |
moreArgs at:9 put:wsuperViewId. |
2232 | 3989 |
moreArgs at:10 put:nil. "/ wcursorId. |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3990 |
moreArgs at:11 put:wiconId. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3991 |
moreArgs at:12 put:wiconMaskId. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3992 |
moreArgs at:13 put:wiconWidth. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3993 |
moreArgs at:14 put:wiconHeight. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3994 |
moreArgs at:15 put:windowType. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3995 |
moreArgs at:16 put:windowClass. |
2151 | 3996 |
moreArgs at:17 put:weventMask. |
2232 | 3997 |
moreArgs at:18 put:(aView className asString). |
2151 | 3998 |
|
3999 |
[ |
|
4000 |
windowId := self |
|
4001 |
primCreateWindowFor:aView |
|
4002 |
type:typeSymbol |
|
4003 |
borderWidth:bWidth |
|
4004 |
subViewOf:wsuperView |
|
4005 |
style:wStyle |
|
4006 |
inputOnly:winputOnly |
|
4007 |
label:wlabel |
|
4008 |
owner:wowner |
|
4009 |
icon:wicon |
|
4010 |
iconMask:wiconMask |
|
4011 |
moreArgs:moreArgs. |
|
4012 |
aView setId:windowId. |
|
4013 |
] valueUninterruptably. |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4014 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4015 |
windowId notNil ifTrue:[self addKnownView:aView withId:windowId]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4016 |
^ windowId |
2232 | 4017 |
! |
4018 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4019 |
destroyGC:aGCId |
2232 | 4020 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4021 |
if (__isExternalAddress(aGCId)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4022 |
struct gcData *gcData = _GCDATA(aGCId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4023 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4024 |
#ifdef COUNT_RESOURCES |
2232 | 4025 |
__cnt_gcData--; |
4026 |
RESPRINTF(("DestroyGcData %d\n",__cnt_gcData)); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4027 |
#endif |
2232 | 4028 |
if (gcData->hBitmap) |
4029 |
{ |
|
4030 |
#ifdef COUNT_BMP_RESOURCES |
|
4031 |
__cnt_bmpdc--; |
|
4032 |
RES_BMP_PRINTF(("free BmpDC %d\n",__cnt_bmpdc)); |
|
4033 |
#endif |
|
4034 |
} |
|
2325 | 4035 |
if (lastGcData == gcData) |
4036 |
{ |
|
4037 |
_releaseDC(lastGcData); |
|
4038 |
lastGcData = 0; |
|
4039 |
} |
|
2232 | 4040 |
free(gcData); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4041 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4042 |
%} |
2232 | 4043 |
! |
4044 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4045 |
destroyPixmap:aDrawableId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4046 |
|
2232 | 4047 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4048 |
if (__isExternalAddress(aDrawableId) && ISCONNECTED) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4049 |
HANDLE bitmapHandle = _HANDLEVal(aDrawableId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4050 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4051 |
if (bitmapHandle) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4052 |
{ |
2232 | 4053 |
#ifdef COUNT_BMP_RESOURCES |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4054 |
__cnt_bitmap--; |
2232 | 4055 |
RES_BMP_PRINTF(("DestroyPixmap %x %d\n",bitmapHandle,__cnt_bitmap)); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4056 |
#endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4057 |
if( DelObject(bitmapHandle) ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4058 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4059 |
DPRINTF(("Bitmap deleted!\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4060 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4061 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4062 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4063 |
%} |
2232 | 4064 |
! |
4065 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4066 |
destroyView:aView withId:aWindowId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4067 |
self primDestroyView:aView withId:aWindowId. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4068 |
self removeKnownView:aView withId:aWindowId |
2232 | 4069 |
! |
4070 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4071 |
gcFor:aDrawableId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4072 |
|
2232 | 4073 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4074 |
HWND hWnd; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4075 |
struct gcData *gcData; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4076 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4077 |
if (__isExternalAddress(aDrawableId)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4078 |
hWnd = _HWNDVal(aDrawableId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4079 |
gcData = newGcData(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4080 |
if (! gcData) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4081 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4082 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4083 |
#ifdef COUNT_RESOURCES |
2232 | 4084 |
__cnt_gcData++; |
4085 |
RESPRINTF(("CreateGcData %d\n",__cnt_gcData)); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4086 |
#endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4087 |
gcData->hWnd = hWnd; |
2232 | 4088 |
gcData->_hDC = 0; |
4089 |
DPRINTF(("gcFor hDC=%x hWnd=%x\n",gcData->_hDC,gcData->hWnd)); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4090 |
RETURN ( __MKOBJ(gcData) ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4091 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4092 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4093 |
%} |
2232 | 4094 |
! |
4095 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4096 |
gcForBitmap:aDrawableId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4097 |
|
2232 | 4098 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4099 |
struct gcData *gcData; |
2151 | 4100 |
BITMAP bitmap; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4101 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4102 |
if (__isExternalAddress(aDrawableId)) { /* HBITMAP */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4103 |
HBITMAP hBitmap = _HBITMAPVAL(aDrawableId); |
2232 | 4104 |
HDC hDC; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4105 |
gcData = newGcData(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4106 |
if (! gcData) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4107 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4108 |
} |
2232 | 4109 |
#ifdef COUNT_BMP_RESOURCES |
4110 |
__cnt_bmpdc++; |
|
4111 |
RES_BMP_PRINTF(("CreateBmpDC %d\n",__cnt_bmpdc)); |
|
4112 |
#endif |
|
2151 | 4113 |
if (GetObject(hBitmap,sizeof(bitmap),&bitmap)) |
4114 |
{ |
|
4115 |
DPRINTF(("bitmap info:%d\n",bitmap.bmBitsPixel)); |
|
4116 |
} |
|
4117 |
else |
|
4118 |
{ |
|
4119 |
DPRINTF(("noinfo returned\n")); |
|
4120 |
} |
|
2244 | 4121 |
gcData->hBitmap = hBitmap; |
2151 | 4122 |
gcData->bitmapColorBitCount = bitmap.bmBitsPixel; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4123 |
#ifdef COUNT_RESOURCES |
2232 | 4124 |
__cnt_gcData++; |
4125 |
RESPRINTF(("CreateGcData %d\n",__cnt_gcData)); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4126 |
#endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4127 |
RETURN ( __MKOBJ(gcData) ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4128 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4129 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4130 |
%} |
2232 | 4131 |
! |
4132 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4133 |
primCreateBitmapFromArray:anArray width:w height:h |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4134 |
|
2232 | 4135 |
%{ /* xxLIMITEDSTACK */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4136 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4137 |
HBITMAP newBitmapHandle; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4138 |
int b_width, b_height, bytesPerRowST, bytesPerRowWN, padding, nBytes; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4139 |
int row, col; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4140 |
unsigned char *cp, *bPits; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4141 |
unsigned char *b_bits; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4142 |
unsigned char *pBits; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4143 |
int index; |
2232 | 4144 |
OBJ num, *op; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4145 |
unsigned char *allocatedBits = 0; |
2232 | 4146 |
unsigned char fastBits[10000]; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4147 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4148 |
if (! ISCONNECTED) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4149 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4150 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4151 |
*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4152 |
if (__bothSmallInteger(w, h) && _isNonNilObject(anArray)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4153 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4154 |
b_width = __intVal(w); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4155 |
b_height = __intVal(h); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4156 |
bytesPerRowST = (b_width + 7) / 8; |
2151 | 4157 |
bytesPerRowWN = ((b_width + 15) / 16) * 2; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4158 |
padding = bytesPerRowWN - bytesPerRowST; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4159 |
nBytes = b_height * bytesPerRowWN; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4160 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4161 |
if (nBytes < sizeof(fastBits)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4162 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4163 |
cp = b_bits = fastBits; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4164 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4165 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4166 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4167 |
cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4168 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4169 |
if (cp) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4170 |
{ |
2232 | 4171 |
if (__qClass(anArray) == @global(Array)) |
4172 |
{ |
|
4173 |
index = 1; |
|
4174 |
op = &(__ArrayInstPtr(anArray)->a_element[index - 1]); |
|
4175 |
for (row = b_height; row; row--) |
|
4176 |
{ |
|
4177 |
for (col = bytesPerRowST; col; col--) |
|
4178 |
{ |
|
4179 |
num = *op++; |
|
4180 |
if (! __isSmallInteger(num)) |
|
4181 |
goto fail; |
|
4182 |
*cp++ = __intVal(num); |
|
4183 |
} |
|
4184 |
cp += padding; |
|
4185 |
} |
|
4186 |
} |
|
4187 |
else if (__qClass(anArray) == @global(ByteArray)) |
|
4188 |
{ |
|
4189 |
pBits = __ByteArrayInstPtr(anArray)->ba_element; |
|
4190 |
for (row = b_height; row; row--) |
|
4191 |
{ |
|
4192 |
for (col = bytesPerRowST; col; col--) |
|
4193 |
{ |
|
4194 |
*cp++ = ( *pBits++ /*^ 0xFF*/ ); |
|
4195 |
} |
|
4196 |
cp += padding; |
|
4197 |
} |
|
4198 |
} |
|
4199 |
else |
|
4200 |
{ |
|
4201 |
goto fail; |
|
4202 |
} |
|
4203 |
DPRINTF(("create bitmap ...\n")); |
|
4204 |
||
4205 |
newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, b_bits ); |
|
4206 |
||
4207 |
if( newBitmapHandle ) |
|
4208 |
{ |
|
4209 |
#ifdef COUNT_BMP_RESOURCES |
|
4210 |
__cnt_bitmap++; |
|
4211 |
RES_BMP_PRINTF(("CreateBitmap %x %d\n",newBitmapHandle,__cnt_bitmap)); |
|
4212 |
#endif |
|
4213 |
DPRINTF(("returning bitmap ...\n")); |
|
4214 |
if (allocatedBits) |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4215 |
{ |
2232 | 4216 |
free(allocatedBits); |
4217 |
} |
|
4218 |
RETURN ( __MKOBJ(newBitmapHandle)); |
|
4219 |
} |
|
4220 |
} |
|
4221 |
} |
|
4222 |
fail: ; |
|
4223 |
PRINTF(("create bitmap FAILED!!!\n")); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4224 |
if (allocatedBits) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4225 |
{ |
2232 | 4226 |
PRINTF(("freeing up bitmap bits ...\n")); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4227 |
free(allocatedBits); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4228 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4229 |
DPRINTF(("returning nil ...\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4230 |
RETURN ( nil ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4231 |
%} |
2232 | 4232 |
! |
4233 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4234 |
primCreateWindowFor:aView type:aSymbol |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4235 |
borderWidth:bWidth subViewOf:wsuperView |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4236 |
style:wStyle inputOnly:winputOnly |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4237 |
label:wlabel owner:wowner |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4238 |
icon:wicon iconMask:wiconMask |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4239 |
moreArgs:moreArgs |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4240 |
|
2232 | 4241 |
%{ /* xxLIMITEDSTACK */ |
1127 | 4242 |
|
4243 |
WNDCLASS wc; |
|
4244 |
long bg, bd, bw; |
|
1706 | 4245 |
int winStyleBits, winEXStyleBits; |
1127 | 4246 |
int w, h, x, y; |
4247 |
int min_width, min_height; |
|
4248 |
int max_width, max_height; |
|
2151 | 4249 |
OBJ eventMask; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4250 |
RECT rec; |
1127 | 4251 |
HANDLE parentHandle; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4252 |
OBJ xpos, ypos, wwidth, wheight; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4253 |
OBJ minWidth, minHeight, maxWidth, maxHeight; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4254 |
OBJ wsuperViewId, wcursorId, wiconId, wiconMaskId; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4255 |
OBJ wiconWidth, wiconHeight; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4256 |
OBJ windowType, windowClass, windowId; |
2232 | 4257 |
OBJ stClassName; |
1127 | 4258 |
int isTopWindow = 0; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4259 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4260 |
unsigned char* cp; |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4261 |
HBITMAP xBitMap, maskBitmap; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4262 |
int height, width; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4263 |
int nBytes, nBits; |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4264 |
int index; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4265 |
HICON xIcon = (HICON)0; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4266 |
SIZE oldSize; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4267 |
ICONINFO iconInfo; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4268 |
char *className; |
2232 | 4269 |
unsigned char *allocatedBits = 0; |
4270 |
unsigned char fastBits[10000]; |
|
1127 | 4271 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4272 |
xpos = __ArrayInstPtr(moreArgs)->a_element[0]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4273 |
ypos = __ArrayInstPtr(moreArgs)->a_element[1]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4274 |
wwidth = __ArrayInstPtr(moreArgs)->a_element[2]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4275 |
wheight = __ArrayInstPtr(moreArgs)->a_element[3]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4276 |
minWidth = __ArrayInstPtr(moreArgs)->a_element[4]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4277 |
minHeight = __ArrayInstPtr(moreArgs)->a_element[5]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4278 |
maxWidth = __ArrayInstPtr(moreArgs)->a_element[6]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4279 |
maxHeight = __ArrayInstPtr(moreArgs)->a_element[7]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4280 |
wsuperViewId = __ArrayInstPtr(moreArgs)->a_element[8]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4281 |
wcursorId = __ArrayInstPtr(moreArgs)->a_element[9]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4282 |
wiconId = __ArrayInstPtr(moreArgs)->a_element[10]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4283 |
wiconMaskId = __ArrayInstPtr(moreArgs)->a_element[11]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4284 |
wiconWidth = __ArrayInstPtr(moreArgs)->a_element[12]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4285 |
wiconHeight = __ArrayInstPtr(moreArgs)->a_element[13]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4286 |
windowType = __ArrayInstPtr(moreArgs)->a_element[14]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4287 |
windowClass = __ArrayInstPtr(moreArgs)->a_element[15]; |
2151 | 4288 |
eventMask = __ArrayInstPtr(moreArgs)->a_element[16]; |
2232 | 4289 |
stClassName = __ArrayInstPtr(moreArgs)->a_element[17]; |
1127 | 4290 |
bg = WhitePixel; |
4291 |
bd = BlackPixel; |
|
2151 | 4292 |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4293 |
/* get bitmap for icon */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4294 |
if( __isExternalAddress(wiconId) ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4295 |
{ |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4296 |
xBitMap = _HBITMAPVAL( wiconId ); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4297 |
if( xBitMap != 0 ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4298 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4299 |
BITMAP bm; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4300 |
if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4301 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4302 |
int d = bm.bmPlanes * bm.bmBitsPixel; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4303 |
BYTE *ep; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4304 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4305 |
DPRINTF(("Bitmap w:%d h:%d p:%d d:%d\n",bm.bmWidth,bm.bmHeight,bm.bmPlanes,bm.bmBitsPixel)); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4306 |
height = __intVal( wiconHeight ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4307 |
width = __intVal( wiconWidth ); |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4308 |
nBytes = ( width + 15 ) / 16; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4309 |
nBytes = height * nBytes * 2; |
2232 | 4310 |
if (nBytes < sizeof(fastBits)) |
4311 |
{ |
|
4312 |
ep = fastBits; |
|
4313 |
} |
|
4314 |
else |
|
4315 |
{ |
|
4316 |
ep = allocatedBits = (unsigned char *) malloc(nBytes); |
|
4317 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4318 |
if ( ep != 0 ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4319 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4320 |
memset(ep,0,nBytes); |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4321 |
maskBitmap = CreateBitmap(width, height, 1, 1, ep ); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4322 |
if( maskBitmap != NULL ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4323 |
{ |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4324 |
DPRINTF(( "BITMAP mask CREATED!!!\n" )); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4325 |
iconInfo.fIcon = TRUE; |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4326 |
iconInfo.hbmMask = maskBitmap; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4327 |
iconInfo.hbmColor = xBitMap; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4328 |
xIcon = CreateIconIndirect( &iconInfo ); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4329 |
DPRINTF(( "ICON CREATED!!!\n" )); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4330 |
DelObject( maskBitmap ); |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4331 |
} else { |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4332 |
DPRINTF(( "BITMAP mask CREATION failed!!!\n" )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4333 |
} |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4334 |
} else { |
2232 | 4335 |
PRINTF(( " malloc failed\n" )); |
4336 |
} |
|
2244 | 4337 |
if (allocatedBits) |
2232 | 4338 |
free(allocatedBits); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4339 |
} |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4340 |
} else { |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4341 |
DPRINTF((" xBitMap is zero \n" )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4342 |
} |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4343 |
} else { |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4344 |
if (wiconId == nil) { |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4345 |
DPRINTF((" wiconId is nil\n")); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4346 |
} else { |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4347 |
DPRINTF((" wiconId is not an external address\n")); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4348 |
} |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4349 |
} |
2232 | 4350 |
|
1127 | 4351 |
if (__bothSmallInteger(wwidth, wheight)) { |
4352 |
w = __intVal(wwidth); |
|
4353 |
h = __intVal(wheight); |
|
4354 |
} else { |
|
4355 |
w = h = 100; |
|
4356 |
} |
|
4357 |
||
4358 |
if (__bothSmallInteger(xpos, ypos)) { |
|
4359 |
x = __intVal(xpos); |
|
4360 |
y = __intVal(ypos); |
|
4361 |
} else { |
|
4362 |
x = y = 0; |
|
4363 |
} |
|
4364 |
||
4365 |
if (__bothSmallInteger(minWidth, minHeight)) { |
|
4366 |
min_width = __intVal(minWidth); |
|
4367 |
min_height = __intVal(minHeight); |
|
4368 |
} else { |
|
4369 |
min_width = min_height = 0; |
|
4370 |
} |
|
4371 |
||
4372 |
if (__bothSmallInteger(maxWidth, maxHeight)) { |
|
4373 |
max_width = __intVal(maxWidth); |
|
4374 |
max_height = __intVal(maxHeight); |
|
4375 |
} else { |
|
4376 |
max_width = max_height = 10000; |
|
4377 |
} |
|
4378 |
||
1706 | 4379 |
winStyleBits = winEXStyleBits = 0; |
1127 | 4380 |
|
4381 |
if (__isSmallInteger(bWidth)) { |
|
4382 |
bw = __intVal(bWidth); |
|
4383 |
if (bw) { |
|
1705 | 4384 |
winStyleBits |= WS_BORDER; |
1127 | 4385 |
bw = 1; |
4386 |
} |
|
4387 |
} else { |
|
4388 |
bw = 0; |
|
4389 |
} |
|
4390 |
||
1705 | 4391 |
className = app_name; |
4392 |
||
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4393 |
#ifdef LATER |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4394 |
if (__isString(windowClass)) { |
1705 | 4395 |
className = __stringVal(windowClass); |
4396 |
} |
|
4397 |
||
4398 |
if (__isString(windowClass)) { |
|
4399 |
if (__isInteger(wStyle)) { |
|
4400 |
winStyleBits |= __longIntVal(wStyle); |
|
4401 |
} else { |
|
1723 | 4402 |
if (windowType == @symbol(RadioButton)) { |
4403 |
winStyleBits |= BS_RADIOBUTTON; |
|
4404 |
} else if (windowType == @symbol(CheckBox)) { |
|
4405 |
winStyleBits |= BS_CHECKBOX; |
|
4406 |
} else if (windowType == @symbol(HorizontalScrollbar)) { |
|
4407 |
winStyleBits |= SBS_HORZ; |
|
4408 |
} else if (windowType == @symbol(VerticalScrollBar)) { |
|
4409 |
winStyleBits |= SBS_VERT; |
|
4410 |
} |
|
1705 | 4411 |
} |
4412 |
} |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4413 |
#endif /* LATER */ |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4414 |
|
1127 | 4415 |
if (__isExternalAddress(wsuperViewId)) { |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4416 |
/* |
1127 | 4417 |
* a child window |
4418 |
*/ |
|
4419 |
parentHandle = _HANDLEVal(wsuperViewId); |
|
2151 | 4420 |
winStyleBits |= WS_CHILD; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4421 |
if (winputOnly != true) { |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4422 |
winStyleBits |= (WS_CLIPSIBLINGS|WS_CLIPCHILDREN); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4423 |
/*winStyleBits |= WS_CLIPCHILDREN;*/ |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4424 |
DPRINTF(("parent handle=%x\n", parentHandle)); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4425 |
} else { |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4426 |
winEXStyleBits |= WS_EX_TRANSPARENT; |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4427 |
DPRINTF(("inputview parent handle=%x\n", parentHandle)); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4428 |
} |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4429 |
} else { |
2232 | 4430 |
char buf[300]; |
4431 |
char *stName; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4432 |
static winCount; |
2232 | 4433 |
# ifdef __BORLANDC__ |
4434 |
struct timeb timebuffer; |
|
4435 |
ftime(&timebuffer); |
|
4436 |
# else |
|
4437 |
struct _timeb timebuffer; |
|
4438 |
_ftime(&timebuffer); |
|
4439 |
# endif |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4440 |
if (__isString(stClassName)) { |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4441 |
stName = __stringVal(stClassName); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4442 |
} else { |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4443 |
stName = app_name; |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4444 |
} |
2232 | 4445 |
|
4446 |
sprintf(buf,"S%d.%d%s",HIWORD(timebuffer.time),++winCount,stName); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4447 |
/* |
1127 | 4448 |
* a top window |
4449 |
*/ |
|
4450 |
parentHandle = NULL; |
|
4451 |
isTopWindow = 1; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4452 |
|
2260 | 4453 |
#ifdef TOPWINDOWCLASS |
2232 | 4454 |
DPRINTF(("topview - registerClass:%s\n",buf)); |
4455 |
||
4456 |
wc.style = /* CS_HREDRAW | CS_VREDRAW | CS_OWNDC |*/ CS_DBLCLKS; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4457 |
wc.lpfnWndProc = (WNDPROC) MainWndProc; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4458 |
wc.cbClsExtra = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4459 |
wc.cbWndExtra = N_WINDOW_PRIVATE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4460 |
wc.hInstance = (HANDLE) __getHInstance(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4461 |
if (xIcon) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4462 |
wc.hIcon = xIcon; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4463 |
/* wc.hIconSm = wiconId; In 4.x there are large and small icons */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4464 |
} else { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4465 |
wc.hIcon = NULL; /* THIS MUST BE NULL TO DELETE ICONS */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4466 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4467 |
wc.hCursor = 0 /* LoadCursor(NULL, IDC_ARROW) */; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4468 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4469 |
wc.hbrBackground = 0; /*CreateSolidBrush (bg);*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4470 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4471 |
wc.lpszMenuName = NULL; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4472 |
wc.lpszClassName = buf; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4473 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4474 |
if (!RegisterClass(&wc)) { |
2151 | 4475 |
PRINTF(("RegisterClass failed\n")); |
4476 |
RETURN( nil ); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4477 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4478 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4479 |
className = buf; |
2260 | 4480 |
#endif |
1705 | 4481 |
if (wStyle == @symbol(popUp)) { |
4482 |
winStyleBits |= WS_POPUP; |
|
2244 | 4483 |
winStyleBits |= WS_DISABLED; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4484 |
winEXStyleBits |= WS_EX_TOOLWINDOW; |
2244 | 4485 |
CPRINTF(("Create popUpWindow\n")); |
1705 | 4486 |
} else if (wStyle == @symbol(dialog)) { |
4487 |
/* |
|
4488 |
winStyleBits |= WS_OVERLAPPED | WS_CAPTION | WS_THICKFRAME; |
|
4489 |
*/ |
|
4490 |
winStyleBits |= WS_OVERLAPPED | WS_CAPTION | DS_MODALFRAME | WS_SYSMENU; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4491 |
if ((min_width || min_height) |
1705 | 4492 |
&& (min_width == max_width) |
4493 |
&& (min_height == max_height)) { |
|
4494 |
winStyleBits &= ~WS_THICKFRAME; |
|
4495 |
} |
|
1127 | 4496 |
} else { |
2260 | 4497 |
//winStyleBits |= WS_OVERLAPPEDWINDOW; |
4498 |
winStyleBits |= WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |WS_MAXIMIZEBOX | WS_SIZEBOX; |
|
4499 |
//winEXStyleBits |= WS_EX_CLIENTEDGE; |
|
2297
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
4500 |
winEXStyleBits |= WS_EX_WINDOWEDGE; |
1127 | 4501 |
} |
2151 | 4502 |
winStyleBits |= WS_CLIPCHILDREN; |
1127 | 4503 |
} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4504 |
rec.left = x; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4505 |
rec.top = y; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4506 |
rec.right = x + w; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4507 |
rec.bottom = y+ h; |
2151 | 4508 |
_thread_winStyleBitsEx = WS_EX_LEFT | WS_EX_NOPARENTNOTIFY | winEXStyleBits; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4509 |
|
2232 | 4510 |
#ifdef ADJUSTWINDOW |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4511 |
AdjustWindowRectEx(&rec,winStyleBits,0,_thread_winStyleBitsEx); |
2232 | 4512 |
w = rec.right - rec.left; |
4513 |
h = rec.bottom - rec.top; |
|
4514 |
#endif |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4515 |
|
2151 | 4516 |
DPRINTF(("create%s pos==%d/%d size=%d/%d bw=%d parent %x class='%s'...\n", |
4517 |
((wStyle == @symbol(popUp)) ? " popUp" : ""), x, y, w, h, bw,parentHandle, className)); |
|
1127 | 4518 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4519 |
/* allocate localMemory for Window */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4520 |
_thread_local = (localWindowInfo*)malloc(sizeof(localWindowInfo)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4521 |
if (_thread_local) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4522 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4523 |
memset(_thread_local,0,sizeof(*_thread_local)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4524 |
if (isTopWindow) |
2232 | 4525 |
{ |
4526 |
if (rec.left < 0) |
|
4527 |
{ |
|
4528 |
rec.left = 0; |
|
4529 |
rec.right = w; |
|
4530 |
} |
|
4531 |
if (rec.top < 0) |
|
4532 |
{ |
|
4533 |
rec.top = 0; |
|
4534 |
rec.bottom = h; |
|
4535 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4536 |
_thread_local->flag = LI_TOPWIN; |
2232 | 4537 |
} |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4538 |
|
2151 | 4539 |
if (winputOnly == true) |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4540 |
_thread_local->flag |= LI_INPUTWIN; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4541 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4542 |
_thread_className = className; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4543 |
_thread_winStyleBits = winStyleBits; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4544 |
_thread_parentHandle = parentHandle; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4545 |
_thread_x = rec.left; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4546 |
_thread_y = rec.top; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4547 |
_thread_dx = rec.right - rec.left; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4548 |
_thread_dy = rec.bottom - rec.top; |
2151 | 4549 |
rec.left = 0; |
4550 |
rec.top = 0; |
|
4551 |
rec.right = min_width; |
|
4552 |
rec.bottom = min_height; |
|
2232 | 4553 |
#ifdef ADJUSTWINDOW |
2151 | 4554 |
AdjustWindowRectEx(&rec,winStyleBits,0,_thread_winStyleBitsEx); |
2232 | 4555 |
#endif |
2151 | 4556 |
_thread_local->minWidth = rec.right - rec.left; |
4557 |
_thread_local->minHeight = rec.bottom - rec.top; |
|
4558 |
||
4559 |
rec.left = 0; |
|
4560 |
rec.top = 0; |
|
4561 |
rec.right = max_width; |
|
4562 |
rec.bottom = max_height; |
|
2232 | 4563 |
#ifdef ADJUSTWINDOW |
2151 | 4564 |
AdjustWindowRectEx(&rec,winStyleBits,0,_thread_winStyleBitsEx); |
2232 | 4565 |
#endif |
2151 | 4566 |
_thread_local->maxWidth = rec.right - rec.left; |
4567 |
_thread_local->maxHeight = rec.bottom - rec.top; |
|
4568 |
_thread_local->bgBrush = 0; /*GetStockObject(HOLLOW_BRUSH);*/ |
|
4569 |
||
4570 |
if (__isSmallInteger(eventMask)) |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4571 |
_thread_local->eventMask = __intVal(eventMask); |
2151 | 4572 |
else |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
4573 |
_thread_local->eventMask = 0xffffffff; |
2151 | 4574 |
DPRINTF(("eventMask is %x\n")); |
2232 | 4575 |
#ifdef DEBUGMASK1 |
2151 | 4576 |
printMask(_thread_local->eventMask); |
4577 |
#endif |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4578 |
_thread_newWinHandle = 0; |
2232 | 4579 |
_thread_windowName = 0; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4580 |
if (isTopWindow) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4581 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4582 |
if (__isString(wlabel) || __isSymbol(wlabel)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4583 |
_thread_windowName = (char *) __stringVal(wlabel); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4584 |
DPRINTF(("title = %s\n", _thread_windowName)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4585 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4586 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4587 |
PostThreadMessage(_dispatchThreadId,WM_THREADCREATEWINDOW,0,0); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4588 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4589 |
DWORD dwWaitResult; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4590 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4591 |
/* Request ownership of mutex. */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4592 |
dwWaitResult = WaitForSingleObject( |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4593 |
hCreateEvent, /* handle of mutex */ |
2151 | 4594 |
15000L); /* time-out interval */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4595 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4596 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4597 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4598 |
DPRINTF(("handle = %x\n", _thread_newWinHandle)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4599 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4600 |
if (! _thread_newWinHandle) { |
2232 | 4601 |
DPRINTF(("handle is nil\n")); |
1127 | 4602 |
RETURN ( nil ); |
4603 |
} |
|
4604 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4605 |
windowId = __MKOBJ(_thread_newWinHandle); |
2232 | 4606 |
if (_thread_newWinHandle) |
2260 | 4607 |
{ |
2232 | 4608 |
SetWindowPos(_thread_newWinHandle, HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE); |
2260 | 4609 |
#ifndef TOPWINDOWCLASS |
4610 |
if (xIcon) |
|
4611 |
{ |
|
2297
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
4612 |
SendMessage(_thread_newWinHandle,WM_SETICON,ICON_SMALL,(LPARAM)xIcon); |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
4613 |
SendMessage(_thread_newWinHandle,WM_SETICON,ICON_BIG,(LPARAM)xIcon); |
2260 | 4614 |
} |
4615 |
#endif |
|
4616 |
} |
|
1127 | 4617 |
DPRINTF(("done - create\n")); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4618 |
RETURN (windowId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4619 |
%} |
2232 | 4620 |
! |
4621 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4622 |
primDestroyView:aView withId:aWindowId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4623 |
|
2232 | 4624 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4625 |
HICON yIcon; |
1127 | 4626 |
if (__isExternalAddress(aWindowId)) { |
4627 |
HWND win = _HWNDVal(aWindowId); |
|
4628 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4629 |
if (win && IsWindow(win)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4630 |
{ |
2260 | 4631 |
#ifndef TOPWINDOWCLASS |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4632 |
yIcon = (HICON)GetClassLong(_thread_newWinHandle,GCL_HICON); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4633 |
SetClassLong(_thread_newWinHandle,GCL_HICON,(DWORD)0); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4634 |
/* It has to be checked whether thia can be deleted!!!!! */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4635 |
if( yIcon ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4636 |
{ |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4637 |
if( DestroyIcon( yIcon ) ) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4638 |
DPRINTF(( "Old icon deleted\n" )); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4639 |
} |
2260 | 4640 |
#endif |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4641 |
/*printf("post WM_THREADDESTROYWINDOW\n");*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4642 |
PostMessage(win,WM_THREADDESTROYWINDOW,0,0); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4643 |
} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4644 |
} |
1127 | 4645 |
%} |
2232 | 4646 |
! |
4647 |
||
1127 | 4648 |
rootWindowId |
4649 |
"return the id of the root window. |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4650 |
This is the window you see as background, |
1127 | 4651 |
however, it may or may not be the real physical root window, |
4652 |
since some window managers install a virtual root window on top |
|
4653 |
of the real one. If this is the case, that views id is returned here." |
|
4654 |
||
4655 |
^ rootWin |
|
2232 | 4656 |
! ! |
4657 |
||
4658 |
!WinWorkstation methodsFor:'color stuff'! |
|
4659 |
||
1127 | 4660 |
colorRed:redVal green:greenVal blue:blueVal |
4661 |
"allocate a color with rgb values (0..100) - return the color index (i.e. colorID). |
|
4662 |
This method is obsoleted by #colorScaledRed:scaledGreen:scaledBlue:" |
|
4663 |
||
4664 |
|r g b| |
|
4665 |
||
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4666 |
r := self percentToDeviceColorValue:redVal. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4667 |
g := self percentToDeviceColorValue:greenVal. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4668 |
b := self percentToDeviceColorValue:blueVal. |
1127 | 4669 |
^ self colorScaledRed:r scaledGreen:g scaledBlue:b |
2232 | 4670 |
! |
4671 |
||
1127 | 4672 |
colorScaledRed:r scaledGreen:g scaledBlue:b |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4673 |
"allocate a color with rgb values (0..16rFFFF) - return the color index |
1127 | 4674 |
(i.e. colorID)" |
4675 |
%{ |
|
4676 |
int id, ir, ig, ib; |
|
4677 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4678 |
if (__bothSmallInteger(r, g) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4679 |
&& __isSmallInteger(b)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4680 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4681 |
id = RGB2st(__intVal(r),__intVal(g),__intVal(b)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4682 |
DDPRINTF(("alloc color %d/%d/%d -> %x\n", ir, ig, ib, id)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4683 |
RETURN ( __MKSMALLINT(id) ); |
1127 | 4684 |
} |
4685 |
%}. |
|
4686 |
self primitiveFailed. |
|
4687 |
^ nil |
|
2232 | 4688 |
! |
4689 |
||
1127 | 4690 |
freeColor:colorIndex |
4691 |
"free a display color when its no longer needed" |
|
4692 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4693 |
'free color' printCR. |
1127 | 4694 |
^ self |
2232 | 4695 |
! |
4696 |
||
1127 | 4697 |
getRGBFrom:index into:aBlock |
4698 |
"get rgb components (0..100) of color in map at:index, |
|
4699 |
and evaluate the 3-arg block, aBlock with them" |
|
4700 |
||
4701 |
|val| |
|
4702 |
||
4703 |
self getScaledRGBFrom:index into:[:r :g :b | |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4704 |
val := aBlock |
1127 | 4705 |
value:(r * 100.0 / 16rFFFF) |
4706 |
value:(g * 100.0 / 16rFFFF) |
|
4707 |
value:(b * 100.0 / 16rFFFF) |
|
4708 |
]. |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4709 |
'get RGB' printCR. |
1127 | 4710 |
^ val |
2232 | 4711 |
! |
4712 |
||
2151 | 4713 |
getRGBFromName:colorName into:aBlock |
4714 |
"get rgb components (0..100) of color named colorName, |
|
4715 |
and evaluate the 3-arg block, aBlock with them" |
|
4716 |
||
4717 |
|val| |
|
4718 |
||
4719 |
self getScaledRGBFromName:colorName into:[:r :g :b | |
|
4720 |
r isNil ifTrue:[^nil]. |
|
4721 |
val := aBlock |
|
4722 |
value:(r * 100.0 / 16rFFFF) |
|
4723 |
value:(g * 100.0 / 16rFFFF) |
|
4724 |
value:(b * 100.0 / 16rFFFF) |
|
4725 |
]. |
|
4726 |
^val |
|
2232 | 4727 |
! |
4728 |
||
1127 | 4729 |
getScaledRGBFrom:index into:aBlock |
4730 |
"get rgb components (0 .. 16rFFFF) of color in map at:index, |
|
4731 |
and evaluate the 3-arg block, aBlock with them" |
|
4732 |
||
4733 |
|r g b| |
|
4734 |
%{ |
|
4735 |
int id = __intVal(index); |
|
4736 |
int iR, iG, iB; |
|
4737 |
||
2151 | 4738 |
id = st2RGB(id,0); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4739 |
iR = id & 0xFF; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4740 |
iG = (id >> 8) & 0xFF; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4741 |
iB = (id >> 16) & 0xFF; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4742 |
iR = (iR << 8) | iR; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4743 |
iG = (iG << 8) | iG; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4744 |
iB = (iB << 8) | iB; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4745 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4746 |
r = __MKSMALLINT(iR); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4747 |
g = __MKSMALLINT(iG); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4748 |
b = __MKSMALLINT(iB); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4749 |
/*printf("get color %x -> %x/%x/%x\n",id, iR, iG, iB);*/ |
1127 | 4750 |
%}. |
4751 |
^ aBlock value:r value:g value:b |
|
2232 | 4752 |
! |
4753 |
||
2151 | 4754 |
getScaledRGBFromName:colorName into:aBlock |
4755 |
"get scaled rgb components (0..16rFFFF) of color named colorName, |
|
4756 |
and evaluate the 3-arg block, aBlock with them" |
|
4757 |
||
4758 |
|triple r g b found| |
|
4759 |
||
4760 |
r := g := b := 0. |
|
4761 |
found := false. |
|
4762 |
(colorName startsWith:$#) ifTrue:[ |
|
4763 |
"/ color in r/g/b hex notation |
|
4764 |
r := Integer readFrom:(colorName copyFrom:2 to:3) radix:16. |
|
4765 |
g := Integer readFrom:(colorName copyFrom:4 to:5) radix:16. |
|
4766 |
b := Integer readFrom:(colorName copyFrom:6 to:7) radix:16. |
|
4767 |
found := true. |
|
4768 |
] ifFalse:[ |
|
4769 |
||
4770 |
triple := StandardColorValues at:colorName asString ifAbsent:nil. |
|
4771 |
triple isNil ifTrue:[ |
|
4772 |
triple := StandardColorValues at:colorName asString asLowercase ifAbsent:nil. |
|
4773 |
]. |
|
4774 |
triple notNil ifTrue:[ |
|
4775 |
r := triple at:1. |
|
4776 |
g := triple at:2. |
|
4777 |
b := triple at:3. |
|
4778 |
found := true. |
|
4779 |
]. |
|
4780 |
]. |
|
4781 |
found ifFalse:[ |
|
4782 |
('WinWorkstation: unknown color: ' , colorName) infoPrintCR. |
|
4783 |
]. |
|
4784 |
||
4785 |
^ aBlock value:((r * 256) + r) value:((g * 256) + g) value:((b * 256) + b) |
|
2232 | 4786 |
! |
4787 |
||
2151 | 4788 |
listOfAvailableColors |
4789 |
"return a list of all available colornames. |
|
4790 |
This should not be used, since colornames are very |
|
4791 |
display-specific (here X-specific)." |
|
4792 |
||
4793 |
|aStream list line index colorName| |
|
4794 |
||
4795 |
aStream := FileStream readonlyFileNamed:'/usr/lib/X11/rgb.txt'. |
|
4796 |
aStream isNil ifTrue:[^ nil]. |
|
4797 |
list := OrderedCollection new. |
|
4798 |
[aStream atEnd] whileFalse:[ |
|
4799 |
line := aStream nextLine. |
|
4800 |
line notNil ifTrue:[ |
|
4801 |
"skip the r/g/b numbers" |
|
4802 |
index := 1. |
|
4803 |
[(line at:index) isSeparator] whileTrue:[index := index + 1]. |
|
4804 |
[(line at:index) isDigit] whileTrue:[index := index + 1]. |
|
4805 |
[(line at:index) isSeparator] whileTrue:[index := index + 1]. |
|
4806 |
[(line at:index) isDigit] whileTrue:[index := index + 1]. |
|
4807 |
[(line at:index) isSeparator] whileTrue:[index := index + 1]. |
|
4808 |
[(line at:index) isDigit] whileTrue:[index := index + 1]. |
|
4809 |
[(line at:index) isSeparator] whileTrue:[index := index + 1]. |
|
4810 |
colorName := line copyFrom:index. |
|
4811 |
((colorName occurrencesOf:(Character space)) == 0) ifTrue:[ |
|
4812 |
list add:colorName |
|
4813 |
] |
|
4814 |
] |
|
4815 |
]. |
|
4816 |
aStream close. |
|
4817 |
^ list sort |
|
4818 |
||
4819 |
" |
|
4820 |
Screen current listOfAvailableColors |
|
4821 |
" |
|
4822 |
||
4823 |
"Modified: 11.9.1996 / 15:26:28 / stefan" |
|
2232 | 4824 |
! |
4825 |
||
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4826 |
percentToDeviceColorValue:aPercentage |
1127 | 4827 |
"given a color-component value in percent (0..100), return the corresponding |
4828 |
WIN-component value (0..16rFFFF) as an integer" |
|
4829 |
||
4830 |
%{ /* NOCONTEXT */ |
|
4831 |
||
4832 |
if (__isSmallInteger(aPercentage)) { |
|
4833 |
RETURN ( __MKSMALLINT(0xFFFF * __intVal(aPercentage) / 100) ); |
|
4834 |
} |
|
4835 |
if (__isFloat(aPercentage)) { |
|
4836 |
RETURN ( __MKSMALLINT(0xFFFF * (int)(__floatVal(aPercentage)) / 100) ); |
|
4837 |
} |
|
4838 |
%}. |
|
4839 |
^ (16rFFFF * aPercentage / 100) rounded |
|
2232 | 4840 |
! |
4841 |
||
2151 | 4842 |
setColor:index scaledRed:sred scaledGreen:sgreen scaledBlue:sblue |
4843 |
||
4844 |
'setColor:index scaledRed:sred scaledGreen:sgreen scaledBlue:sblue' printCR. |
|
4845 |
^ self. |
|
4846 |
||
4847 |
"Created: 30.1.1998 / 09:27:48 / md" |
|
4848 |
"Modified: 30.1.1998 / 09:30:22 / md" |
|
2232 | 4849 |
! ! |
4850 |
||
4851 |
!WinWorkstation methodsFor:'cursor stuff'! |
|
4852 |
||
1723 | 4853 |
builtInCursorShapes |
4854 |
"return a collection of standard cursor names. |
|
4855 |
Those are built into Windows and need not be created as |
|
4856 |
user cursors. |
|
4857 |
(actually, there are more than those below ...)" |
|
4858 |
||
4859 |
"/ if you add something here, also add to #shapeNumberFromCursor ... |
|
4860 |
||
4861 |
^ #( |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4862 |
#upLeftArrow "/ IDC_ARROW |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4863 |
#upDownArrow "/ IDC_SIZENS |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4864 |
#leftRightArrow "/ IDC_SIZEWE |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4865 |
#text "/ IDC_IBEAM |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4866 |
#wait "/ IDC_WAIT |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4867 |
#execute "/ IDC_APPSTARTING |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4868 |
#crossHair "/ IDC_CROSS |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4869 |
#fourWay "/ IDC_SIZEALL |
2151 | 4870 |
#upRightHand "/ IDC_ARROW |
1723 | 4871 |
) |
2232 | 4872 |
! |
4873 |
||
1127 | 4874 |
createCursorShape:aShape |
4875 |
"create a cursor given a shape-symbol" |
|
4876 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4877 |
|number| |
1127 | 4878 |
|
4879 |
number := self shapeNumberFromSymbol:aShape. |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4880 |
^ self primCreateCursorShapeNr:number |
2232 | 4881 |
! |
4882 |
||
2151 | 4883 |
createCursorSourceForm:sourceBytes maskForm:maskBytes hotX:hx hotY:hy width:w height:h |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4884 |
"create a cursor given 2 bitmaps (source, mask) and a hotspot" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4885 |
|
2232 | 4886 |
|padding bpl bplPadded srcOffs dstOffs |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4887 |
src mask srcPadded maskPadded cW cH nB nR cursor | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4888 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4889 |
cW := self class getSystemMetrics:#cursorWidth. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4890 |
cH := self class getSystemMetrics:#cursorHeight. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4891 |
"/ ('cursorWidth ',cW printString,'cursorHeight ',cH printString) infoPrintCR. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4892 |
src := sourceBytes. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4893 |
mask := maskBytes. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4894 |
padding := self cursorBitmapPadding. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4895 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4896 |
"/ repadding and/or resizing required ? |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4897 |
bpl := sourceBytes size / h. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4898 |
bplPadded := (cW + padding - 1) // padding * 2. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4899 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4900 |
bpl ~~ bplPadded ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4901 |
"/ 'repad cursor bits' infoPrintCR. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4902 |
srcPadded := ByteArray new:(bplPadded * cH). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4903 |
nB := bpl min: bplPadded. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4904 |
nR := cH min: h. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4905 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4906 |
dstOffs := srcOffs := 1. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4907 |
1 to:nR do:[:row | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4908 |
srcPadded |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4909 |
replaceFrom:dstOffs |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4910 |
to:(dstOffs+nB-1) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4911 |
with:src |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4912 |
startingAt:srcOffs. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4913 |
dstOffs := dstOffs + bplPadded. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4914 |
srcOffs := srcOffs + bpl. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4915 |
]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4916 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4917 |
maskPadded := ByteArray new:(bplPadded * cH). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4918 |
dstOffs := srcOffs := 1. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4919 |
1 to:nR do:[:row | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4920 |
maskPadded |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4921 |
replaceFrom:dstOffs |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4922 |
to:(dstOffs+nB-1) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4923 |
with:mask |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4924 |
startingAt:srcOffs. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4925 |
dstOffs := dstOffs + bplPadded. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4926 |
srcOffs := srcOffs + bpl. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4927 |
]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4928 |
src := srcPadded. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4929 |
mask := maskPadded. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4930 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4931 |
]. |
2232 | 4932 |
src invert. |
4933 |
1 to:src size do:[:index | |
|
4934 |
src byteAt:index put:((src byteAt:index) bitAnd:(mask byteAt:index)). |
|
4935 |
]. |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4936 |
mask invert. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4937 |
cursor := self |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4938 |
primCreateCursorSourceBits:src |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4939 |
maskBits:mask |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4940 |
hotX:hx hotY:hy |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4941 |
width:cW height:cH. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4942 |
cursor notNil ifTrue:[ ^ cursor ]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4943 |
self halt. |
2232 | 4944 |
! |
4945 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4946 |
cursorBitmapPadding |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4947 |
^ 16 "/ windows requires short-padded rows |
2232 | 4948 |
! |
4949 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4950 |
destroyCursor:aCursorId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4951 |
|
2232 | 4952 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4953 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4954 |
if (ISCONNECTED) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4955 |
if (__isExternalAddress(aCursorId)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4956 |
HCURSOR curs = _HCURSORVal(aCursorId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4957 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4958 |
if (curs) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4959 |
#ifdef KEEP_STD_CURSORS |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4960 |
if ((curs != H_C_ARROW) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4961 |
&& (curs != H_C_CROSS) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4962 |
&& (curs != H_C_IBEAM) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4963 |
&& (curs != H_C_ICON) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4964 |
&& (curs != H_C_NO) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4965 |
&& (curs != H_C_SIZE) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4966 |
&& (curs != H_C_SIZEALL) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4967 |
&& (curs != H_C_SIZENESW) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4968 |
&& (curs != H_C_SIZENS) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4969 |
&& (curs != H_C_SIZENWSE) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4970 |
&& (curs != H_C_UPARROW) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4971 |
&& (curs != H_C_WAIT)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4972 |
#endif /* KEEP_STD_CURSORS */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4973 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4974 |
DestroyCursor(curs); |
2232 | 4975 |
#ifdef COUNT_RESOURCES |
4976 |
__cnt_cur--; |
|
4977 |
RESPRINTF(("DestroyCursor %d\n",__cnt_cur)); |
|
4978 |
#endif |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4979 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4980 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4981 |
RETURN ( self ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4982 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4983 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4984 |
%} |
2232 | 4985 |
! |
4986 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4987 |
needDeviceFormsForCursor |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4988 |
^ false |
2232 | 4989 |
! |
4990 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4991 |
primCreateCursorShapeNr:number |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4992 |
|
2232 | 4993 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 4994 |
HCURSOR newCursor; |
4995 |
LPCTSTR cId; |
|
4996 |
||
4997 |
if (__isSmallInteger(number)) { |
|
4998 |
cId = (LPCTSTR)(__intVal(number)); |
|
4999 |
newCursor = LoadCursor(NULL, cId); |
|
1705 | 5000 |
if (newCursor) { |
1685 | 5001 |
#ifdef KEEP_STD_CURSORS |
1127 | 5002 |
if (cId == IDC_ARROW) |
5003 |
H_C_ARROW = newCursor; |
|
5004 |
else if (cId == IDC_CROSS) |
|
5005 |
H_C_CROSS = newCursor; |
|
5006 |
else if (cId == IDC_IBEAM) |
|
5007 |
H_C_IBEAM = newCursor; |
|
5008 |
else if (cId == IDC_ICON) |
|
5009 |
H_C_ICON = newCursor; |
|
5010 |
else if (cId == IDC_NO) |
|
5011 |
H_C_NO = newCursor; |
|
5012 |
else if (cId == IDC_SIZE) |
|
5013 |
H_C_SIZE = newCursor; |
|
5014 |
else if (cId == IDC_SIZEALL) |
|
5015 |
H_C_SIZEALL = newCursor; |
|
5016 |
else if (cId == IDC_SIZENESW) |
|
5017 |
H_C_SIZENESW = newCursor; |
|
5018 |
else if (cId == IDC_SIZENS) |
|
5019 |
H_C_SIZENS = newCursor; |
|
5020 |
else if (cId == IDC_SIZENWSE) |
|
5021 |
H_C_SIZENWSE = newCursor; |
|
5022 |
else if (cId == IDC_UPARROW) |
|
5023 |
H_C_UPARROW = newCursor; |
|
5024 |
else if (cId == IDC_WAIT) |
|
5025 |
H_C_WAIT = newCursor; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5026 |
#endif /* KEEP_STD_CURSORS */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5027 |
RETURN ( __MKOBJ(newCursor) ); |
1127 | 5028 |
} |
5029 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5030 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5031 |
%} |
2232 | 5032 |
! |
5033 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5034 |
primCreateCursorSourceBits:src maskBits:mask hotX:hx hotY:hy width:w height:h |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5035 |
|
2232 | 5036 |
%{ /* xxLIMITEDSTACK (WIN95) */ |
1127 | 5037 |
HCURSOR newCursor; |
5038 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5039 |
if (__isByteArray(src) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5040 |
&& __isByteArray(mask) |
1127 | 5041 |
&& __bothSmallInteger(hx, hy) |
5042 |
&& __bothSmallInteger(w, h)) { |
|
5043 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5044 |
newCursor = CreateCursor((HANDLE) __getHInstance(), |
1127 | 5045 |
__intVal(hx), __intVal(hy), |
5046 |
__intVal(w), __intVal(h), |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5047 |
__ByteArrayInstPtr(mask)->ba_element, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5048 |
__ByteArrayInstPtr(src)->ba_element); |
1127 | 5049 |
if (newCursor) { |
2232 | 5050 |
#ifdef COUNT_RESOURCES |
5051 |
__cnt_cur++; |
|
5052 |
RESPRINTF(("CreateCursor %d\n",__cnt_cur)); |
|
5053 |
#endif |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5054 |
RETURN ( __MKOBJ(newCursor)); |
1127 | 5055 |
} |
5056 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5057 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5058 |
%} |
2232 | 5059 |
! |
5060 |
||
1127 | 5061 |
shapeNumberFromSymbol:shape |
5062 |
"given a shape-symbol, return the corresponding cursor-number, |
|
5063 |
or nil if no such standard cursor exists." |
|
5064 |
||
5065 |
"this is pure Win-knowlegde - but you may easily add more" |
|
5066 |
||
5067 |
%{ /* NOCONTEXT */ |
|
2151 | 5068 |
if (shape == @symbol(upRightHand)) { |
5069 |
RETURN ( __MKSMALLINT( (INT)IDC_ARROW)); |
|
5070 |
} |
|
1127 | 5071 |
if (shape == @symbol(upLeftArrow)) { |
5072 |
RETURN ( __MKSMALLINT( (INT)IDC_ARROW)); |
|
5073 |
} |
|
5074 |
if (shape == @symbol(upDownArrow)) { |
|
5075 |
RETURN ( __MKSMALLINT( (INT)IDC_SIZENS)); |
|
5076 |
} |
|
5077 |
if (shape == @symbol(leftRightArrow)) { |
|
5078 |
RETURN ( __MKSMALLINT( (INT)IDC_SIZEWE)); |
|
5079 |
} |
|
5080 |
if (shape == @symbol(text)) { |
|
5081 |
RETURN ( __MKSMALLINT( (INT)IDC_IBEAM)); |
|
5082 |
} |
|
5083 |
if (shape == @symbol(wait)) { |
|
5084 |
RETURN ( __MKSMALLINT( (INT)IDC_WAIT)); |
|
5085 |
} |
|
5086 |
if (shape == @symbol(crossHair)) { |
|
5087 |
RETURN ( __MKSMALLINT( (INT)IDC_CROSS)); |
|
5088 |
} |
|
5089 |
if (shape == @symbol(fourWay)) { |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5090 |
RETURN ( __MKSMALLINT( (INT)IDC_SIZEALL)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5091 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5092 |
if (shape == @symbol(execute)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5093 |
RETURN ( __MKSMALLINT( (INT)IDC_APPSTARTING)); |
1127 | 5094 |
} |
5095 |
%}. |
|
5096 |
"/ ('WINWORKSTATION: invalid cursorShape:' , shape printString) infoPrintNL. |
|
5097 |
^ nil |
|
2232 | 5098 |
! ! |
5099 |
||
5100 |
!WinWorkstation methodsFor:'drawing'! |
|
5101 |
||
1127 | 5102 |
copyFromId:sourceId x:srcX y:srcY gc:srcGCId to:destId x:dstX y:dstY gc:dstGCId |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5103 |
width:w height:h |
1127 | 5104 |
"do a bit-blt; copy bits from the rectangle defined by |
5105 |
srcX/srcY and w/h from the sourceId drawable to the rectangle |
|
5106 |
below dstX/dstY in the destId drawable. Trigger an error if any |
|
5107 |
argument is not integer." |
|
5108 |
||
2232 | 5109 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5110 |
|
2264 | 5111 |
struct gcData *dstGcData = 0; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5112 |
struct gcData *srcGcData = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5113 |
HDC srcDC = (HDC)0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5114 |
HDC dstDC = (HDC)0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5115 |
|
2232 | 5116 |
if (__isExternalAddress(srcGCId)) |
5117 |
{ |
|
5118 |
srcGcData = _GCDATA(srcGCId); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5119 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5120 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5121 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5122 |
goto fail; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5123 |
} |
2232 | 5124 |
if (__isExternalAddress(dstGCId)) { |
2264 | 5125 |
dstGcData = _GCDATA(dstGCId); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5126 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5127 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5128 |
{ |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
5129 |
goto fail; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
5130 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
5131 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
5132 |
if (__bothSmallInteger(w, h) |
1127 | 5133 |
&& __bothSmallInteger(srcX, srcY) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5134 |
&& __bothSmallInteger(dstX, dstY)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5135 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5136 |
int fun = BITBLT_COPY; |
2264 | 5137 |
if (srcGcData && dstGcData) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5138 |
{ |
2264 | 5139 |
fun = dstGcData->bitbltrop2; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5140 |
#if 0 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5141 |
switch (fun) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5142 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5143 |
case BITBLT_COPY: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5144 |
printf("BITBLT_COPY\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5145 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5146 |
case BITBLT_COPYINVERTED: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5147 |
printf("BITBLT_COPYINVERTED\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5148 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5149 |
case BITBLT_XOR: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5150 |
printf("BITBLT_XOR\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5151 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5152 |
case BITBLT_AND: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5153 |
printf("BITBLT_AND\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5154 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5155 |
case BITBLT_OR: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5156 |
printf("BITBLT_OR\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5157 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5158 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5159 |
#endif |
2264 | 5160 |
if (srcGcData->hWnd && ((srcGcData->hWnd == dstGcData->hWnd) && (fun == BITBLT_COPY))) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5161 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5162 |
RECT rec,uprec; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5163 |
rec.left = __intVal(srcX); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5164 |
rec.top = __intVal(srcY); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5165 |
rec.right = rec.left + __intVal(w); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5166 |
rec.bottom = rec.top + __intVal(h); |
2232 | 5167 |
DPRINTF(("dst and src is HWND %x fun == BITBLT_COPY --> scrolling %d %d\n",srcGcData->hWnd,__intVal(dstX) - __intVal(srcX),__intVal(dstY) - __intVal(srcY))); |
5168 |
ScrollWindow(srcGcData->hWnd,__intVal(dstX) - __intVal(srcX),__intVal(dstY) - __intVal(srcY),&rec,0); |
|
5169 |
UpdateWindow(srcGcData->hWnd); |
|
5170 |
if (GetWindow_eventMask(srcGcData->hWnd) & ExposureMask) |
|
5171 |
enqEvent(ExposureMask,srcGcData->hWnd, __WM_NOGEXPOSE, 0, 0, 0, 0, 0); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5172 |
RETURN ( self ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5173 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5174 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5175 |
if (srcGcData->hWnd) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5176 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5177 |
/*printf("src is HWND %x\n",srcGcData->hWnd);*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5178 |
} |
2264 | 5179 |
fun = dstGcData->bitbltrop2; |
5180 |
if ((srcGcData == dstGcData) && (fun == BITBLT_COPY)) |
|
2232 | 5181 |
{ |
5182 |
RECT rec,uprec; |
|
5183 |
rec.left = __intVal(srcX); |
|
5184 |
rec.top = __intVal(srcY); |
|
5185 |
rec.right = rec.left + __intVal(w); |
|
5186 |
rec.bottom = rec.top + __intVal(h); |
|
5187 |
srcDC = _getDC(srcGcData); |
|
5188 |
DPRINTF(("dst and src is DC %x fun == BITBLT_COPY --> scrolling %d %d\n",srcDC,__intVal(dstX) - __intVal(srcX),__intVal(dstY) - __intVal(srcY))); |
|
5189 |
ScrollDC(srcDC,__intVal(dstX) - __intVal(srcX),__intVal(dstY) - __intVal(srcY),&rec,0,0,&uprec); |
|
5190 |
_releaseDC(srcGcData); |
|
5191 |
RETURN ( self ); |
|
5192 |
||
5193 |
} |
|
5194 |
else |
|
2244 | 5195 |
{ |
5196 |
srcDC = _getDC(srcGcData); |
|
2264 | 5197 |
dstDC = _getDC(dstGcData); |
2297
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
5198 |
DDPRINTF(("bitblt src f:%x b:%x",GetTextColor(srcDC),GetBkColor(srcDC))); |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
5199 |
DDPRINTF(("dst f:%x b:%x\n",GetTextColor(dstDC),GetBkColor(dstDC))); |
2244 | 5200 |
if (BitBlt(dstDC, |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5201 |
__intVal(dstX), __intVal(dstY), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5202 |
__intVal(w), __intVal(h), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5203 |
srcDC, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5204 |
__intVal(srcX), __intVal(srcY), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5205 |
fun) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5206 |
== 0 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5207 |
) |
2244 | 5208 |
{ |
5209 |
printf("ERROR in BitBlt\n"); |
|
5210 |
} |
|
5211 |
} |
|
2264 | 5212 |
_releaseDC(dstGcData); |
2244 | 5213 |
_releaseDC(srcGcData); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5214 |
RETURN ( self ); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
5215 |
} |
1127 | 5216 |
} |
1685 | 5217 |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
5218 |
fail: ; |
1127 | 5219 |
%}. |
2264 | 5220 |
self primitiveFailed. |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5221 |
^ nil |
2232 | 5222 |
|
5223 |
! |
|
5224 |
||
1127 | 5225 |
copyPlaneFromId:sourceId x:srcX y:srcY gc:srcDCId to:destId x:dstX y:dstY gc:dstDCId |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5226 |
width:w height:h |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5227 |
"do a bit-blt, but only copy the low-bit plane; |
1127 | 5228 |
copy bits from the rectangle defined by |
5229 |
srcX/srcY and w/h from the sourceId drawable to the rectangle |
|
5230 |
below dstX/dstY in the destId drawable. Trigger an error if any |
|
5231 |
argument is not integer." |
|
5232 |
||
5233 |
^ self |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5234 |
copyFromId:sourceId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5235 |
x:srcX y:srcY gc:srcDCId |
1127 | 5236 |
to:destId x:dstX y:dstY gc:dstDCId |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5237 |
width:w height:h |
2232 | 5238 |
! |
5239 |
||
1127 | 5240 |
displayArcX:x y:y width:width height:height from:startAngle angle:angle in:aDrawableId with:aGCId |
5241 |
"draw an arc. If any of x,y, w or h is not an integer, an error is triggered. |
|
5242 |
The angles may be floats or integer - they are given in degrees." |
|
5243 |
||
2270
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
5244 |
%{ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5245 |
int __x, __y, w, h; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5246 |
float angle1, angle2; |
1127 | 5247 |
double f; |
5248 |
||
5249 |
if (__isSmallInteger(startAngle)) |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5250 |
angle1 = (float)(__intVal(startAngle)); |
1127 | 5251 |
else if (__isFloat(startAngle)) { |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5252 |
angle1 = __floatVal(startAngle); |
2270
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
5253 |
} else if (__isShortFloat(startAngle)) { |
2297
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
5254 |
angle1 = __shortFloatVal(startAngle); |
2270
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
5255 |
} else goto bad; |
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
5256 |
|
1127 | 5257 |
if (__isSmallInteger(angle)) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5258 |
angle2 = (float)(__intVal(angle)); |
1127 | 5259 |
else if (__isFloat(angle)) { |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5260 |
angle2 = __floatVal(angle); |
2270
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
5261 |
} else if (__isShortFloat(angle)) { |
2297
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
5262 |
angle2 = __shortFloatVal(angle); |
2270
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
5263 |
} else goto bad; |
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
5264 |
|
1127 | 5265 |
if (__isExternalAddress(aGCId) |
5266 |
&& __isExternalAddress(aDrawableId) |
|
5267 |
&& __bothSmallInteger(x, y) |
|
2232 | 5268 |
&& __bothSmallInteger(width, height)) |
5269 |
{ |
|
1127 | 5270 |
struct gcData *gcData = _GCDATA(aGCId); |
5271 |
HDC hDC; |
|
1725 | 5272 |
POINT p; |
2244 | 5273 |
HPEN hPen; |
1127 | 5274 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5275 |
w = __intVal(width); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5276 |
h = __intVal(height); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5277 |
__x = __intVal(x); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5278 |
__y = __intVal(y); |
1127 | 5279 |
|
2232 | 5280 |
hDC = _getDC(gcData); |
5281 |
||
5282 |
if (!(hPen = GcDataGetPen(hDC,gcData))) { |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5283 |
DPRINTF(("displayArc: no pen\n")); |
2232 | 5284 |
} |
5285 |
else |
|
5286 |
{ |
|
5287 |
double xB, yB, xE, yE, xR, yR; |
|
2244 | 5288 |
HPEN hSavePen = SelectObject(hDC, hPen); |
2232 | 5289 |
xR = w / 2; |
5290 |
yR = h / 2; |
|
5291 |
if (angle2 - angle1 >= 360) |
|
5292 |
{ |
|
5293 |
xB = xE = __x + xR + 0.5; |
|
5294 |
yB = yE = __y /*+ yR + 0.5*/; |
|
5295 |
} |
|
5296 |
else |
|
5297 |
{ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5298 |
double sin(), cos(); |
2232 | 5299 |
if (angle1 <= 180) |
5300 |
angle1 = 180 - angle1; |
|
5301 |
else |
|
5302 |
angle1 = 360 + 180 - angle1; |
|
5303 |
angle2 = angle1 - angle2; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5304 |
/* sigh - compute the intersections ... */ |
2232 | 5305 |
xB = (cos((angle1 * 3.14159265359) / 180.0)*xR); |
5306 |
yB = (sin((angle1 * 3.14159265359) / 180.0)*yR); |
|
5307 |
xE = (cos((angle2 * 3.14159265359) / 180.0)*xR); |
|
5308 |
yE = (sin((angle2 * 3.14159265359) / 180.0)*yR); |
|
5309 |
xB = __x + xR - xB+0.5; |
|
5310 |
yB = __y + yR - yB+0.5; |
|
5311 |
xE = __x + xR - xE+0.5; |
|
5312 |
yE = __y + yR - yE+0.5; |
|
5313 |
} |
|
5314 |
DPRINTF(("Arc x=%d y=%d w=%d h=%d xB=%d xE=%d yB=%d yE=%d a1=%f a2=%f\n",__x,__y,w,h,(int)xB,(int)xE,(int)yB,(int)yE,angle1,angle2)); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5315 |
Arc(hDC, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5316 |
__x, __y, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5317 |
__x + w, __y + h, |
2232 | 5318 |
(int)xB, (int)yB, |
5319 |
(int)xE, (int)yE); |
|
5320 |
||
2244 | 5321 |
SelectObject(hDC,hSavePen); |
5322 |
DelObject(hPen); |
|
2232 | 5323 |
} |
5324 |
_releaseDC(gcData); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5325 |
RETURN ( self ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5326 |
} |
2270
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
5327 |
bad: ; |
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
5328 |
%}. |
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
5329 |
self primitiveFailed |
2232 | 5330 |
! |
5331 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5332 |
displayLineFromX:x0 y:y0 toX:x1 y:y1 in:aDrawableId with:aGCId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5333 |
"draw a line. If the coordinates are not integers, an error is triggered." |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5334 |
|
2232 | 5335 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5336 |
if (__isExternalAddress(aGCId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5337 |
/*&& __isExternalAddress(aDrawableId)*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5338 |
&& __bothSmallInteger(x0, y0) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5339 |
&& __bothSmallInteger(x1, y1)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5340 |
struct gcData *gcData = _GCDATA(aGCId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5341 |
int __x1 = __intVal(x1), __y1 = __intVal(y1); |
2244 | 5342 |
HPEN hPen; |
2232 | 5343 |
HDC hDC = _getDC(gcData); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5344 |
/* DPRINTF(("displayLine: %d/%d -> %d/%d in %x\n", |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5345 |
__intVal(x0), __intVal(y0), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5346 |
__x1, __y1,_HWNDVal(aDrawableId))); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5347 |
*/ |
2232 | 5348 |
if (!(hPen = GcDataGetPen(hDC,gcData))) { |
1127 | 5349 |
DPRINTF(("displayLine: no pen\n")); |
5350 |
} else { |
|
2244 | 5351 |
HPEN hSavePen = SelectObject(hDC, hPen); |
2232 | 5352 |
MoveToEx(hDC, __intVal(x0), __intVal(y0), NULL); |
5353 |
||
5354 |
LineTo(hDC, __x1, __y1); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5355 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5356 |
* end-point ... |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5357 |
*/ |
2232 | 5358 |
LineTo(hDC, __x1+1, __y1); |
2244 | 5359 |
SelectObject(hDC,hSavePen); |
5360 |
DelObject(hPen); |
|
2232 | 5361 |
} |
5362 |
_releaseDC(gcData); |
|
1127 | 5363 |
RETURN ( self ); |
5364 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5365 |
%} |
2232 | 5366 |
! |
5367 |
||
1725 | 5368 |
displayPointX:px y:py in:aDrawableId with:aGCId |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5369 |
"draw a point. If x/y are not integers, an error is triggered." |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5370 |
|
2232 | 5371 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 5372 |
if (__isExternalAddress(aGCId) |
5373 |
&& __isExternalAddress(aDrawableId) |
|
1725 | 5374 |
&& __bothSmallInteger(px, py)) { |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
5375 |
struct gcData *gcData = _GCDATA(aGCId); |
2232 | 5376 |
HDC hDC; |
1725 | 5377 |
POINT p; |
2244 | 5378 |
HPEN hPen; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5379 |
int __x = __intVal(px), __y = __intVal(py); |
2232 | 5380 |
hDC = _getDC(gcData); |
5381 |
||
5382 |
if (!(hPen = GcDataGetPen(hDC,gcData))) { |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5383 |
DPRINTF(("displayPoint: no pen\n")); |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
5384 |
} else { |
2244 | 5385 |
HPEN hSavePen = SelectObject(hDC, hPen); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5386 |
MoveToEx(hDC, __x, __y, NULL); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5387 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5388 |
* end-point ... |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5389 |
*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5390 |
LineTo(hDC, __x+1, __y); |
2244 | 5391 |
SelectObject(hDC,hSavePen); |
5392 |
DelObject(hPen); |
|
2232 | 5393 |
} |
5394 |
_releaseDC(gcData); |
|
1127 | 5395 |
RETURN ( self ); |
5396 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5397 |
%} |
2232 | 5398 |
! |
5399 |
||
1127 | 5400 |
displayPolygon:aPolygon in:aDrawableId with:aGCId |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5401 |
"draw a polygon, the argument aPolygon is a Collection of individual points, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5402 |
which define the polygon. |
1127 | 5403 |
If any coordinate is not integer, an error is triggered." |
5404 |
||
2232 | 5405 |
|numberOfPoints | |
1127 | 5406 |
|
5407 |
numberOfPoints := aPolygon size. |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5408 |
self |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5409 |
primDisplayPolygon:aPolygon n:numberOfPoints |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5410 |
in:aDrawableId with:aGCId |
2232 | 5411 |
! |
5412 |
||
1127 | 5413 |
displayRectangleX:x y:y width:width height:height in:aDrawableId with:aGCId |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5414 |
"draw a rectangle. If the coordinates are not integers, an error is triggered." |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5415 |
|
2232 | 5416 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 5417 |
int w, h; |
5418 |
int xL, yT; |
|
5419 |
if (__isExternalAddress(aGCId) |
|
5420 |
&& __isExternalAddress(aDrawableId) |
|
5421 |
&& __bothSmallInteger(x, y) |
|
5422 |
&& __bothSmallInteger(width, height)) { |
|
5423 |
struct gcData *gcData = _GCDATA(aGCId); |
|
2232 | 5424 |
HDC hDC = _getDC(gcData); |
2244 | 5425 |
HPEN hPen; |
1127 | 5426 |
|
5427 |
xL = __intVal(x); |
|
5428 |
yT = __intVal(y); |
|
5429 |
w = __intVal(width); |
|
5430 |
h = __intVal(height); |
|
5431 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5432 |
DPRINTF(("displayRectangle: %d/%d -> %d/%d\n", |
1127 | 5433 |
xL, yT, w, h)); |
5434 |
/* |
|
5435 |
* need this check here: some servers simply dump core with bad args |
|
5436 |
*/ |
|
5437 |
if ((w >= 0) && (h >= 0)) { |
|
2232 | 5438 |
if (!(hPen = GcDataGetPen(hDC,gcData))) { |
1127 | 5439 |
DPRINTF(("displayRect: no pen\n")); |
5440 |
} else { |
|
2244 | 5441 |
HPEN hSavePen = SelectObject(hDC, hPen); |
1127 | 5442 |
MoveToEx(hDC, xL, yT, NULL); |
5443 |
LineTo(hDC, xL+w-1, yT); |
|
5444 |
LineTo(hDC, xL+w-1, yT+h-1); |
|
5445 |
LineTo(hDC, xL, yT+h-1); |
|
5446 |
LineTo(hDC, xL, yT); |
|
2244 | 5447 |
SelectObject(hDC,hSavePen); |
5448 |
DelObject(hPen); |
|
2232 | 5449 |
} |
5450 |
} |
|
5451 |
_releaseDC(gcData); |
|
1127 | 5452 |
RETURN ( self ); |
5453 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5454 |
%} |
2232 | 5455 |
! |
5456 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5457 |
displayString:aString from:index1 to:index2 x:x y:y in:aDrawableId with:aGCId opaque:opaque |
1127 | 5458 |
"draw a sub-string - if opaque is false, draw foreground only; otherwise, draw both |
5459 |
foreground and background characters. |
|
5460 |
If the coordinates are not integers, an error is triggered." |
|
5461 |
||
2232 | 5462 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 5463 |
unsigned char *cp; |
5464 |
OBJ cls; |
|
5465 |
int i1, i2, l, n; |
|
5466 |
# define NLOCALBUFFER 200 |
|
5467 |
short xlatebuffer[NLOCALBUFFER]; |
|
5468 |
int nInstBytes; |
|
5469 |
||
5470 |
if (__isExternalAddress(aGCId) |
|
5471 |
&& __isExternalAddress(aDrawableId) |
|
5472 |
&& __isNonNilObject(aString) |
|
5473 |
&& __bothSmallInteger(index1, index2) |
|
2232 | 5474 |
&& __bothSmallInteger(x, y)) |
5475 |
{ |
|
1127 | 5476 |
struct gcData *gcData = _GCDATA(aGCId); |
5477 |
int pX, pY; |
|
2232 | 5478 |
HDC hDC = _getDC(gcData); |
5479 |
HFONT hOldFont; |
|
1127 | 5480 |
pX = __intVal(x); |
5481 |
pY = __intVal(y); |
|
5482 |
pY -= gcData->fontAscent; |
|
5483 |
||
5484 |
cls = __qClass(aString); |
|
5485 |
||
5486 |
i1 = __intVal(index1) - 1; |
|
5487 |
if (i1 >= 0) { |
|
5488 |
i2 = __intVal(index2) - 1; |
|
5489 |
if (i2 < i1) { |
|
2232 | 5490 |
goto ret; |
1127 | 5491 |
} |
5492 |
||
5493 |
cp = _stringVal(aString); |
|
5494 |
l = i2 - i1 + 1; |
|
5495 |
||
2232 | 5496 |
if ((cls == @global(String)) || (cls == @global(Symbol))) |
5497 |
{ |
|
1127 | 5498 |
n = _stringSize(aString); |
2232 | 5499 |
if (i2 < n) |
5500 |
{ |
|
1127 | 5501 |
cp += i1; |
2253 | 5502 |
DDPRINTF(("string1: %s pos=%d/%d l=%d hDC=%x hWnd=%x\n", cp, pX, pY,l,hDC,_HWNDVal(aDrawableId))); |
1127 | 5503 |
if (opaque == true) { |
5504 |
SetBkMode(hDC, OPAQUE); |
|
5505 |
} else { |
|
5506 |
SetBkMode(hDC, TRANSPARENT); |
|
5507 |
} |
|
2232 | 5508 |
hOldFont = SelectObject(hDC, gcData->hFont); |
5509 |
SetTextColor(hDC, gcData->fgColor); |
|
5510 |
SetBkColor(hDC, gcData->bgColor); |
|
5511 |
||
5512 |
if (!TextOut(hDC, pX, pY, (char *)cp, l)) |
|
5513 |
{ |
|
5514 |
PRINTF(("Textout failed. %d\n",GetLastError())); |
|
5515 |
} |
|
5516 |
SelectObject(hDC, hOldFont); |
|
5517 |
goto ret; |
|
1127 | 5518 |
} |
5519 |
} |
|
5520 |
||
5521 |
nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars)); |
|
5522 |
cp += nInstBytes; |
|
5523 |
||
2232 | 5524 |
if (__isBytes(aString)) |
5525 |
{ |
|
1127 | 5526 |
n = __byteArraySize(aString) - nInstBytes - 1; |
5527 |
||
2232 | 5528 |
if (i2 < n) |
5529 |
{ |
|
1127 | 5530 |
cp += i1; |
2253 | 5531 |
DDPRINTF(("string: %s pos=%d/%d\n", cp, pX, pY)); |
1127 | 5532 |
if (opaque == true) { |
5533 |
SetBkMode(hDC, OPAQUE); |
|
5534 |
} else { |
|
5535 |
SetBkMode(hDC, TRANSPARENT); |
|
5536 |
} |
|
2232 | 5537 |
hOldFont = SelectObject(hDC, gcData->hFont); |
5538 |
SetTextColor(hDC, gcData->fgColor); |
|
5539 |
SetBkColor(hDC, gcData->bgColor); |
|
1127 | 5540 |
TextOut(hDC, pX, pY, (char *)cp, l); |
2232 | 5541 |
SelectObject(hDC, hOldFont); |
5542 |
goto ret; |
|
1127 | 5543 |
} |
5544 |
} |
|
5545 |
||
5546 |
#ifdef NOTDEF |
|
5547 |
/* TWOBYTESTRINGS */ |
|
5548 |
if (__isWords(aString)) { |
|
5549 |
n = (__byteArraySize(aString) - nInstBytes) / 2; |
|
5550 |
||
5551 |
if (i2 < n) { |
|
5552 |
union { |
|
5553 |
char b[2]; |
|
5554 |
unsigned short s; |
|
5555 |
} u; |
|
5556 |
int i; |
|
5557 |
XChar2b *cp2 = (XChar2b *)0; |
|
5558 |
int mustFree = 0; |
|
5559 |
||
5560 |
cp += (i1 * 2); |
|
5561 |
if (l > 1000) l = 1000; |
|
5562 |
||
5563 |
/* |
|
5564 |
* ST/X TwoByteStrings store the asciiValue in native byteOrder; |
|
5565 |
* X expects them MSB first |
|
5566 |
* convert as required |
|
5567 |
*/ |
|
5568 |
||
5569 |
u.s = 0x1234; |
|
5570 |
if (u.b[0] != 0x12) { |
|
5571 |
if (l <= NLOCALBUFFER) { |
|
5572 |
cp2 = xlatebuffer; |
|
5573 |
} else { |
|
5574 |
cp2 = (XChar2b *)(malloc(l * 2)); |
|
5575 |
mustFree = 1; |
|
5576 |
} |
|
5577 |
for (i=0; i<l; i++) { |
|
5578 |
cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2; |
|
5579 |
cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1; |
|
5580 |
} |
|
5581 |
cp = (char *) cp2; |
|
5582 |
} |
|
5583 |
||
5584 |
if (opaque == true) |
|
5585 |
XDrawImageString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l); |
|
5586 |
else |
|
5587 |
XDrawString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l); |
|
5588 |
||
5589 |
if (mustFree) { |
|
5590 |
free(cp2); |
|
5591 |
} |
|
5592 |
||
2232 | 5593 |
goto ret; |
1127 | 5594 |
} |
5595 |
} |
|
5596 |
#endif |
|
5597 |
} |
|
2232 | 5598 |
ret: |
5599 |
_releaseDC(gcData); |
|
1127 | 5600 |
} |
5601 |
#undef NLOCALBUFFER |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5602 |
%} |
2232 | 5603 |
! |
5604 |
||
2151 | 5605 |
drawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd |
5606 |
width:imageWidth height:imageHeight |
|
1127 | 5607 |
x:srcx y:srcy |
2151 | 5608 |
into:aDrawableId |
5609 |
x:dstx y:dsty |
|
5610 |
width:w height:h |
|
1127 | 5611 |
with:aGCId |
5612 |
||
5613 |
"draw a bitImage which has depth id, width iw and height ih into |
|
5614 |
the drawable. draw a region of w/h pixels from srcx/srcy to dstx/dsty. |
|
5615 |
Individual source pixels have bitsPerPixel bits, allowing to draw |
|
5616 |
depth and pixel-units to be different. |
|
5617 |
It has to be checked elsewhere, that the server can do it with the given |
|
5618 |
depth - otherwise, primitive failure will be signalled. |
|
5619 |
Also it is assumed, that the colormap is setup correctly and the |
|
5620 |
colors are allocated - otherwise the colors may be wrong." |
|
5621 |
||
5622 |
" |
|
5623 |
sorry; I had to separate it into 2 methods, since XPutImage needs |
|
5624 |
an unlimited stack, and thus cannot send primitiveFailed |
|
5625 |
" |
|
2151 | 5626 |
(self primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd |
5627 |
width:imageWidth height:imageHeight |
|
5628 |
x:srcx y:srcy |
|
5629 |
into:aDrawableId |
|
5630 |
x:dstx y:dsty |
|
5631 |
width:w height:h |
|
5632 |
with:aGCId) |
|
1127 | 5633 |
ifFalse:[ |
5634 |
" |
|
2151 | 5635 |
also happens, if a segmentation violation occurs in the |
1127 | 5636 |
XPutImage ... |
5637 |
" |
|
5638 |
self primitiveFailed |
|
5639 |
]. |
|
2232 | 5640 |
! |
5641 |
||
1127 | 5642 |
fillArcX:x y:y width:width height:height from:startAngle angle:angle |
5643 |
in:aDrawableId with:aGCId |
|
5644 |
"fill an arc. If any coordinate is not integer, an error is triggered. |
|
5645 |
The angles may be floats or integer - they are given in degrees." |
|
5646 |
||
2270
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
5647 |
%{ |
2232 | 5648 |
int __x, __y, w, h; |
5649 |
float angle1, angle2; |
|
1127 | 5650 |
|
5651 |
if (__isSmallInteger(startAngle)) |
|
2232 | 5652 |
angle1 = (float)(__intVal(startAngle)); |
1127 | 5653 |
else if (__isFloat(startAngle)) { |
2232 | 5654 |
angle1 = __floatVal(startAngle); |
2270
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
5655 |
} else if (__isShortFloat(startAngle)) { |
2297
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
5656 |
angle1 = __shortFloatVal(startAngle); |
2270
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
5657 |
} else goto bad; |
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
5658 |
|
1127 | 5659 |
if (__isSmallInteger(angle)) |
2232 | 5660 |
angle2 = (float)(__intVal(angle)); |
1127 | 5661 |
else if (__isFloat(angle)) { |
2232 | 5662 |
angle2 = __floatVal(angle); |
2270
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
5663 |
} else if (__isShortFloat(angle)) { |
2297
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
5664 |
angle2 = __shortFloatVal(angle); |
2270
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
5665 |
} else goto bad; |
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
5666 |
|
1127 | 5667 |
if (__isExternalAddress(aGCId) |
5668 |
&& __isExternalAddress(aDrawableId) |
|
5669 |
&& __bothSmallInteger(x, y) |
|
2232 | 5670 |
&& __bothSmallInteger(width, height)) |
5671 |
{ |
|
5672 |
struct gcData *gcData = _GCDATA(aGCId); |
|
5673 |
HDC hDC; |
|
5674 |
HBRUSH hBrush; |
|
5675 |
||
1127 | 5676 |
w = __intVal(width); |
5677 |
h = __intVal(height); |
|
2232 | 5678 |
__x = __intVal(x); |
5679 |
__y = __intVal(y); |
|
5680 |
||
5681 |
hDC = _getDC(gcData); |
|
5682 |
||
5683 |
if (!(hBrush = GcDataGetBrush(hDC,gcData))) { |
|
5684 |
DPRINTF(("fillArc: no brush\n")); |
|
5685 |
} |
|
5686 |
else |
|
5687 |
{ |
|
2244 | 5688 |
HBRUSH hSaveBrush = SelectObject(hDC, hBrush); |
5689 |
HPEN hPen = 0; |
|
5690 |
HPEN hSavePen; |
|
2232 | 5691 |
if (__isWinNT) |
5692 |
{ |
|
5693 |
if (!(hPen = GcDataGetPen(hDC,gcData))) |
|
5694 |
{ |
|
5695 |
DPRINTF(("displayArc: no pen\n")); |
|
5696 |
goto failpen; |
|
5697 |
} |
|
2244 | 5698 |
hSavePen = SelectObject(hDC, hPen); |
2232 | 5699 |
} |
5700 |
else |
|
5701 |
{ |
|
5702 |
SelectObject(hDC,GetStockObject(NULL_PEN)); |
|
5703 |
w++; |
|
5704 |
h++; |
|
5705 |
} |
|
5706 |
{ |
|
5707 |
double xB, yB, xE, yE, xR, yR; |
|
5708 |
xR = w / 2; |
|
5709 |
yR = h / 2; |
|
5710 |
if (angle2 - angle1 >= 360) |
|
5711 |
{ |
|
5712 |
xB = xE = __x + xR + 0.5; |
|
5713 |
yB = yE = __y /*+ yR + 0.5*/; |
|
5714 |
} |
|
5715 |
else |
|
5716 |
{ |
|
5717 |
double sin(), cos(); |
|
5718 |
if (angle1 <= 180) |
|
5719 |
angle1 = 180 - angle1; |
|
5720 |
else |
|
5721 |
angle1 = 360 + 180 - angle1; |
|
5722 |
angle2 = angle1 - angle2; |
|
5723 |
/* sigh - compute the intersections ... */ |
|
5724 |
xB = (cos((angle1 * 3.14159265359) / 180.0)*xR); |
|
5725 |
yB = (sin((angle1 * 3.14159265359) / 180.0)*yR); |
|
5726 |
xE = (cos((angle2 * 3.14159265359) / 180.0)*xR); |
|
5727 |
yE = (sin((angle2 * 3.14159265359) / 180.0)*yR); |
|
5728 |
xB = __x + xR - xB+0.5; |
|
5729 |
yB = __y + yR - yB+0.5; |
|
5730 |
xE = __x + xR - xE+0.5; |
|
5731 |
yE = __y + yR - yE+0.5; |
|
5732 |
} |
|
5733 |
DPRINTF(("fillArc x=%d y=%d w=%d h=%d xB=%d xE=%d yB=%d yE=%d a1=%f a2=%f\n",__x,__y,w,h,(int)xB,(int)xE,(int)yB,(int)yE,angle1,angle2)); |
|
5734 |
||
5735 |
Pie(hDC, |
|
5736 |
__x, __y, |
|
5737 |
__x + w, __y + h, |
|
5738 |
(int)xB, (int)yB, |
|
5739 |
(int)xE, (int)yE); |
|
5740 |
||
5741 |
if (hPen) { |
|
2244 | 5742 |
SelectObject(hDC,hSavePen); |
5743 |
DelObject(hPen); |
|
2232 | 5744 |
} |
5745 |
} |
|
5746 |
failpen: |
|
2244 | 5747 |
SelectObject(hDC,hSaveBrush); |
5748 |
DelObject(hBrush); |
|
2232 | 5749 |
} |
5750 |
_releaseDC(gcData); |
|
1127 | 5751 |
RETURN ( self ); |
5752 |
} |
|
2270
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
5753 |
bad: ; |
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
5754 |
%}. |
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
5755 |
self primitiveFailed |
2232 | 5756 |
! |
5757 |
||
1127 | 5758 |
fillPolygon:aPolygon in:aDrawableId with:aGCId |
2232 | 5759 |
"fill a polygon given by its points. |
1127 | 5760 |
If any coordinate is not integer, an error is triggered." |
5761 |
||
5762 |
|numberOfPoints| |
|
5763 |
||
5764 |
numberOfPoints := aPolygon size. |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5765 |
self |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5766 |
primFillPolygon:aPolygon n:numberOfPoints |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5767 |
in:aDrawableId with:aGCId |
2232 | 5768 |
! |
5769 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5770 |
fillRectangleX:x y:y width:width height:height in:aDrawableId with:aGCId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5771 |
"fill a rectangle. If any coordinate is not integer, an error is triggered." |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5772 |
|
2232 | 5773 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5774 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5775 |
int w, h; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5776 |
if (__isExternalAddress(aGCId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5777 |
&& __isExternalAddress(aDrawableId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5778 |
&& __bothSmallInteger(x, y) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5779 |
&& __bothSmallInteger(width, height)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5780 |
w = __intVal(width); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5781 |
h = __intVal(height); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5782 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5783 |
/*DPRINTF(("fillRect %d/%d -> %d/%d\n", __intVal(x), __intVal(y), w, h));*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5784 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5785 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5786 |
* need this check here: some servers simply dump core with bad args |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5787 |
*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5788 |
if ((w >= 0) && (h >= 0)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5789 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5790 |
struct gcData *gcData = _GCDATA(aGCId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5791 |
HDC hDC; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5792 |
HBRUSH hBrush; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5793 |
RECT rct; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5794 |
|
2232 | 5795 |
hDC = _getDC(gcData); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5796 |
hBrush = GcDataGetBrush(hDC,gcData); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5797 |
if (! hBrush) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5798 |
{ |
2232 | 5799 |
PRINTF(("fillRectangle: no brush\n")); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5800 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5801 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5802 |
{ |
2244 | 5803 |
HBRUSH hSaveBrush = SelectObject(hDC, hBrush); |
2232 | 5804 |
rct.left = __intVal(x); |
5805 |
rct.top = __intVal(y); |
|
5806 |
rct.right = rct.left + w + 1; |
|
5807 |
rct.bottom = rct.top + h + 1; |
|
5808 |
||
5809 |
DPRINTF(("fillRectangle:%d.%d -> %d.%d\n",rct.left,rct.top,rct.right,rct.bottom)); |
|
5810 |
SelectObject(hDC, GetStockObject(NULL_PEN)); |
|
5811 |
Rectangle(hDC,rct.left,rct.top,rct.right,rct.bottom); |
|
2244 | 5812 |
SelectObject(hDC,hSaveBrush); |
5813 |
DelObject(hBrush); |
|
2232 | 5814 |
} |
5815 |
_releaseDC(gcData); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5816 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5817 |
RETURN ( self ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5818 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5819 |
%} |
2232 | 5820 |
! |
5821 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5822 |
primDisplayPolygon:aPolygon n:numberOfPoints in:aDrawableId with:aGCId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5823 |
|
2232 | 5824 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1725 | 5825 |
OBJ point, px, py; |
1127 | 5826 |
int i, num; |
5827 |
||
5828 |
if (__isExternalAddress(aGCId) |
|
5829 |
&& __isExternalAddress(aDrawableId) |
|
5830 |
&& __isSmallInteger(numberOfPoints)) { |
|
1725 | 5831 |
struct gcData *gcData = _GCDATA(aGCId); |
2232 | 5832 |
HDC hDC = _getDC(gcData); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5833 |
POINT p; |
2244 | 5834 |
HPEN hPen; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5835 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5836 |
num = __intVal(numberOfPoints); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5837 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5838 |
for (i=0; i<num; i++) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5839 |
point = __AT_(aPolygon, __MKSMALLINT(i+1)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5840 |
if (! __isPoint(point)) goto fail; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5841 |
px = _point_X(point); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5842 |
py = _point_Y(point); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5843 |
if (! __bothSmallInteger(px, py)) |
2232 | 5844 |
{ |
5845 |
_releaseDC(gcData); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5846 |
goto fail; |
2232 | 5847 |
} |
5848 |
} |
|
5849 |
if (!(hPen = GcDataGetPen(hDC,gcData))) { |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5850 |
DPRINTF(("displayPolygon: no pen\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5851 |
} else { |
2244 | 5852 |
HPEN hSavePen = SelectObject(hDC, hPen); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5853 |
for (i=0; i<num; i++) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5854 |
point = __AT_(aPolygon, __MKSMALLINT(i+1)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5855 |
px = _point_X(point); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5856 |
py = _point_Y(point); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5857 |
if (i == 0) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5858 |
MoveToEx(hDC, __intVal(px), __intVal(py), NULL); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5859 |
} else { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5860 |
p.x = __intVal(px); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5861 |
p.y = __intVal(py); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5862 |
if (i == (num-1)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5863 |
PolylineTo(hDC, &p, 1); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5864 |
} else { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5865 |
LineTo(hDC, p.x, p.y); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5866 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5867 |
* end-point ... |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5868 |
*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5869 |
LineTo(hDC, p.x+1, p.y); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5870 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5871 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5872 |
} |
2244 | 5873 |
SelectObject(hDC,hSavePen); |
5874 |
DelObject(hPen); |
|
2232 | 5875 |
} |
5876 |
||
5877 |
_releaseDC(gcData); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5878 |
RETURN ( self ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5879 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5880 |
fail: ; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5881 |
%} |
2232 | 5882 |
! |
5883 |
||
2151 | 5884 |
primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd |
5885 |
width:imageWidth height:imageHeight |
|
5886 |
x:srcx y:srcy |
|
5887 |
into:aDrawableId |
|
5888 |
x:dstx y:dsty |
|
5889 |
width:w height:h |
|
5890 |
with:aGCId |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5891 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5892 |
"since XPutImage may allocate huge amount of stack space |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5893 |
(some implementations use alloca), this must run with unlimited stack." |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5894 |
|
2232 | 5895 |
%{ /* xxLIMITEDSTACK */ |
2151 | 5896 |
unsigned char fastBits[10000]; |
5897 |
unsigned char *b_bits = 0; |
|
5898 |
unsigned char *allocatedBits = 0; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5899 |
struct gcData *gcData = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5900 |
HDC hDC = (HDC)0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5901 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5902 |
if (ISCONNECTED |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5903 |
&& __isExternalAddress(aGCId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5904 |
&& __isExternalAddress(aDrawableId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5905 |
&& __bothSmallInteger(srcx, srcy) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5906 |
&& __bothSmallInteger(dstx, dsty) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5907 |
&& __bothSmallInteger(w, h) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5908 |
&& __bothSmallInteger(imageWidth, imageHeight) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5909 |
&& __bothSmallInteger(imageDepth, bitsPerPixel) |
2151 | 5910 |
&& __isSmallInteger(padd) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5911 |
&& __isByteArray(imageBits)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5912 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5913 |
struct |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5914 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5915 |
BITMAPINFOHEADER bmiHeader; |
2151 | 5916 |
DWORD r; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5917 |
DWORD g; |
2151 | 5918 |
DWORD b; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5919 |
} bitmap; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5920 |
gcData = _GCDATA(aGCId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5921 |
if (! gcData ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5922 |
goto fail; |
2232 | 5923 |
hDC = _getDC(gcData); |
5924 |
DDPRINTF(("hDC = %x\n", hDC)); |
|
2151 | 5925 |
|
5926 |
if (__intVal(padd) != WIN32PADDING) |
|
5927 |
{ |
|
5928 |
int row, col; |
|
5929 |
unsigned char *cp; |
|
5930 |
unsigned char *pBits; |
|
5931 |
int b_width, b_height, bytesPerRowST, bytesPerRowWN, padding, nBytes; |
|
5932 |
int bi = __intVal(bitsPerPixel); |
|
5933 |
b_width = __intVal(w); |
|
5934 |
b_height = __intVal(h); |
|
5935 |
bytesPerRowST = (b_width * bi + (__intVal(padd)-1)) / __intVal(padd); |
|
5936 |
bytesPerRowWN = (b_width * bi + (WIN32PADDING-1)) / WIN32PADDING * (WIN32PADDING/8); |
|
5937 |
padding = bytesPerRowWN - bytesPerRowST; |
|
5938 |
nBytes = b_height * bytesPerRowWN; |
|
5939 |
/*printf("padd %d bs %d bw %d p %d\n",__intVal(padd),bytesPerRowST,bytesPerRowWN,padding);*/ |
|
5940 |
if (padding) |
|
5941 |
{ |
|
5942 |
if (nBytes < sizeof(fastBits)) |
|
5943 |
{ |
|
5944 |
cp = b_bits = fastBits; |
|
5945 |
} |
|
5946 |
else |
|
5947 |
{ |
|
5948 |
cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes); |
|
5949 |
} |
|
5950 |
if (cp) |
|
5951 |
{ |
|
5952 |
pBits = __ByteArrayInstPtr(imageBits)->ba_element; |
|
5953 |
for (row = b_height; row; row--) |
|
5954 |
{ |
|
5955 |
for (col = bytesPerRowST; col; col--) |
|
5956 |
{ |
|
5957 |
*cp++ = ( *pBits++ ); |
|
5958 |
} |
|
5959 |
cp += padding; |
|
5960 |
} |
|
5961 |
} |
|
2232 | 5962 |
else |
5963 |
goto fail; |
|
2151 | 5964 |
} |
5965 |
} |
|
5966 |
if (b_bits == 0) |
|
5967 |
{ |
|
5968 |
b_bits = __ByteArrayInstPtr(imageBits)->ba_element; |
|
5969 |
} |
|
5970 |
||
5971 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5972 |
bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5973 |
bitmap.bmiHeader.biPlanes = 1; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5974 |
if (__intVal(imageDepth) == 24) |
2151 | 5975 |
{ |
5976 |
/*bitmap.bmiHeader.biCompression = BI_BITFIELDS; |
|
5977 |
bitmap.r = 0xff0000; |
|
5978 |
bitmap.g = 0x00ff00; |
|
5979 |
bitmap.b = 0x0000ff;*/ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5980 |
bitmap.bmiHeader.biCompression = BI_RGB; |
2151 | 5981 |
} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5982 |
else if (__intVal(imageDepth) == 16) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5983 |
{ |
2232 | 5984 |
/*bitmap.bmiHeader.biCompression = BI_RGB; |
5985 |
bitmap.bmiHeader.biCompression = BI_BITFIELDS; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5986 |
bitmap.b = 0x001f; |
2232 | 5987 |
bitmap.g = 0x07e0; |
5988 |
bitmap.r = 0xf800;*/ |
|
5989 |
bitmap.b = 0; |
|
5990 |
bitmap.g = 0; |
|
5991 |
bitmap.r = 0; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5992 |
bitmap.bmiHeader.biCompression = BI_RGB; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5993 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5994 |
bitmap.bmiHeader.biSizeImage = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5995 |
bitmap.bmiHeader.biXPelsPerMeter = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5996 |
bitmap.bmiHeader.biYPelsPerMeter = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5997 |
bitmap.bmiHeader.biClrUsed = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5998 |
bitmap.bmiHeader.biClrImportant = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5999 |
bitmap.bmiHeader.biWidth = __intVal(imageWidth); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6000 |
bitmap.bmiHeader.biHeight = -(__intVal(imageHeight)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6001 |
bitmap.bmiHeader.biBitCount = __intVal(bitsPerPixel); |
2151 | 6002 |
/*printf("drawBits depth:%d bitsPerPixel:%d IW%d W:%d H:%d\n",__intVal(imageDepth),bitmap.bmiHeader.biBitCount,bitmap.bmiHeader.biWidth,__intVal(w),bitmap.bmiHeader.biHeight);*/ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6003 |
SetDIBitsToDevice(hDC,__intVal(dstx),__intVal(dsty), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6004 |
__intVal(w), __intVal(h), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6005 |
__intVal(srcx), __intVal(srcy), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6006 |
0,__intVal(h), |
2151 | 6007 |
(void *)b_bits, |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6008 |
(BITMAPINFO*)&bitmap,DIB_RGB_COLORS); |
2151 | 6009 |
if (allocatedBits) |
6010 |
{ |
|
6011 |
free(allocatedBits); |
|
6012 |
} |
|
2232 | 6013 |
_releaseDC(gcData); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6014 |
RETURN ( true ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6015 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6016 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6017 |
fail: ; |
2232 | 6018 |
PRINTF(("create temp bitmap FAILED!!!\n")); |
6019 |
if (allocatedBits) |
|
6020 |
{ |
|
6021 |
PRINTF(("freeing up temp bitmap bits ...\n")); |
|
6022 |
free(allocatedBits); |
|
6023 |
} |
|
6024 |
if (gcData && hDC) |
|
6025 |
_releaseDC(gcData); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6026 |
%} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6027 |
. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6028 |
^ false |
2232 | 6029 |
! |
6030 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6031 |
primFillPolygon:aPolygon n:numberOfPoints in:aDrawableId with:aGCId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6032 |
|
2232 | 6033 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6034 |
OBJ point, px, py; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6035 |
int i, num; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6036 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6037 |
if (__isExternalAddress(aGCId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6038 |
&& __isExternalAddress(aDrawableId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6039 |
&& __isSmallInteger(numberOfPoints)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6040 |
struct gcData *gcData = _GCDATA(aGCId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6041 |
HDC hDC; |
1725 | 6042 |
POINT p; |
2244 | 6043 |
HBRUSH hBrush; |
2232 | 6044 |
|
1127 | 6045 |
num = __intVal(numberOfPoints); |
6046 |
if (num < 3) { |
|
6047 |
RETURN ( self ); |
|
6048 |
} |
|
6049 |
for (i=0; i<num; i++) { |
|
6050 |
point = __AT_(aPolygon, __MKSMALLINT(i+1)); |
|
6051 |
if (! __isPoint(point)) goto fail; |
|
1725 | 6052 |
px = _point_X(point); |
6053 |
py = _point_Y(point); |
|
6054 |
if (! __bothSmallInteger(px, py)) |
|
1127 | 6055 |
goto fail; |
6056 |
} |
|
1725 | 6057 |
|
2232 | 6058 |
hDC = _getDC(gcData); |
6059 |
||
6060 |
if (!(hBrush = GcDataGetBrush(hDC,gcData))) { |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6061 |
DPRINTF(("fillPolygon: no brush\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6062 |
} else { |
2244 | 6063 |
HBRUSH hSaveBrush = SelectObject(hDC, hBrush); |
1725 | 6064 |
BeginPath(hDC); |
6065 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6066 |
for (i=0; i<num; i++) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6067 |
point = __AT_(aPolygon, __MKSMALLINT(i+1)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6068 |
px = _point_X(point); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6069 |
py = _point_Y(point); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6070 |
if (i == 0) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6071 |
MoveToEx(hDC, __intVal(px), __intVal(py), NULL); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6072 |
} else { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6073 |
if (i == (num-1)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6074 |
p.x = __intVal(px); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6075 |
p.y = __intVal(py); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6076 |
PolylineTo(hDC, &p, 1); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6077 |
} else { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6078 |
LineTo(hDC, __intVal(px), __intVal(py)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6079 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6080 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6081 |
} |
1725 | 6082 |
|
6083 |
EndPath(hDC); |
|
6084 |
FillPath(hDC); |
|
2244 | 6085 |
SelectObject(hDC,hSaveBrush); |
6086 |
DelObject(hBrush); |
|
2232 | 6087 |
} |
6088 |
_releaseDC(gcData); |
|
1127 | 6089 |
RETURN ( self ); |
6090 |
||
6091 |
fail: ; |
|
6092 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6093 |
%} |
2232 | 6094 |
! ! |
6095 |
||
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6096 |
!WinWorkstation methodsFor:'event forwarding'! |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6097 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6098 |
fontChange |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6099 |
"the system fonts (users preferences) have changed. |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6100 |
This is a speciality of windows. |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6101 |
TODO: Tell the viewStyle to update itself, |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6102 |
and tell all views to reinit their style. |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6103 |
For now,this is ignored." |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6104 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6105 |
'WinWorkstation [info]: fontChange ignored for now.' infoPrintCR |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6106 |
! |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6107 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6108 |
queryEndSession |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6109 |
"system is about to be shut down. |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6110 |
This is a speciality of windows. |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6111 |
TODO: Tell all views to close themself. |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6112 |
For now,this is ignored." |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6113 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6114 |
'WinWorkstation [info]: queryEndSession ignored for now.' infoPrintCR |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6115 |
! |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6116 |
|
2325 | 6117 |
systemColorChange:aWindowId |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6118 |
"the system colors (users preferences) have changed. |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6119 |
This is a speciality of windows. |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6120 |
TODO: Tell the viewStyle to update itself, |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6121 |
and tell all views to reinit their style. |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6122 |
For now,this is ignored." |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6123 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6124 |
'WinWorkstation [info]: systemColorChange ignored for now.' infoPrintCR |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6125 |
! ! |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6126 |
|
2232 | 6127 |
!WinWorkstation methodsFor:'event handling'! |
6128 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6129 |
configEventProcessedFor:aWindowId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6130 |
%{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6131 |
if (__isExternalAddress(aWindowId)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6132 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6133 |
HWND hWnd = _HWNDVal(aWindowId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6134 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6135 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6136 |
%} |
2232 | 6137 |
! |
6138 |
||
1127 | 6139 |
dispatchEventFor:aViewIdOrNil withMask:eventMask |
6140 |
"central event handling method: |
|
6141 |
get next event and send appropriate message to the sensor or view. |
|
6142 |
If the argument aViewIdOrNil is nil, events for any view are processed, |
|
6143 |
otherwise only events for the view with given id are processed. |
|
6144 |
If the argument aMask is nonNil, only events for this eventMask are |
|
2232 | 6145 |
handled. |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6146 |
WARNING: this may block to wait for an event - you better check for a |
2232 | 6147 |
pending event before calling this." |
6148 |
||
6149 |
(self getEventFor:aViewIdOrNil withMask:eventMask) ifTrue:[ |
|
6150 |
AbortSignal handle:[:ex | |
|
6151 |
ex return |
|
6152 |
] do:[ |
|
6153 |
self dispatchLastEvent. |
|
6154 |
] |
|
6155 |
]. |
|
6156 |
||
6157 |
"Modified: 19.8.1997 / 17:10:42 / cg" |
|
6158 |
! |
|
6159 |
||
1127 | 6160 |
dispatchExposeEventFor:aViewIdOrNil |
6161 |
"get next expose event and send appropriate message to the sensor or view. |
|
6162 |
If the argument aViewIdOrNil is nil, events for any view are processed, |
|
6163 |
otherwise only events for the view with given id are processed." |
|
6164 |
||
6165 |
self dispatchEventFor:aViewIdOrNil withMask:(self eventMaskFor:#expose) |
|
2232 | 6166 |
! |
6167 |
||
6168 |
dispatchLastEvent |
|
1127 | 6169 |
|theView symS arg butt sibling windowID siblingID propertyID selectionID targetID requestorID |
6170 |
eventType| |
|
6171 |
||
2232 | 6172 |
%{ /* xxSTACK: 8000 */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6173 |
struct queuedEvent *ev = 0; |
2232 | 6174 |
struct queuedEvent _ev_buf; |
1127 | 6175 |
struct inlineCache *ipS; |
6176 |
||
6177 |
static struct inlineCache vid = _ILC1; |
|
1723 | 6178 |
static struct inlineCache conf = _ILC5; |
6179 |
static struct inlineCache skp = _ILC4; |
|
6180 |
static struct inlineCache skr = _ILC4; |
|
6181 |
static struct inlineCache exp = _ILC5; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6182 |
static struct inlineCache gexpS = _ILC6; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6183 |
static struct inlineCache nexpS = _ILC1; |
1723 | 6184 |
static struct inlineCache clr = _ILC5; |
6185 |
static struct inlineCache bp = _ILC4; |
|
6186 |
static struct inlineCache br = _ILC4; |
|
6187 |
static struct inlineCache bmp = _ILC4; |
|
6188 |
static struct inlineCache bsp = _ILC4; |
|
6189 |
static struct inlineCache mot = _ILC4; |
|
6190 |
static struct inlineCache unmap = _ILC1; |
|
6191 |
static struct inlineCache map = _ILC1; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6192 |
static struct inlineCache termS = _ILC1; |
1723 | 6193 |
static struct inlineCache destr = _ILC1; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6194 |
static struct inlineCache setCurs = _ILC1; |
1723 | 6195 |
static struct inlineCache focOut = _ILC1; |
6196 |
static struct inlineCache focIn = _ILC1; |
|
6197 |
static struct inlineCache act = _ILC2; |
|
6198 |
static struct inlineCache pe = _ILC4; |
|
6199 |
static struct inlineCache pl = _ILC2; |
|
2232 | 6200 |
static struct inlineCache vis = _ILC1; |
2325 | 6201 |
static struct inlineCache sysClrChg = _ILC1; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6202 |
static struct inlineCache fontChg = _ILC0; |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6203 |
static struct inlineCache qEndSess = _ILC0; |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6204 |
static struct inlineCache powerDown = _ILC0; |
1127 | 6205 |
|
6206 |
int x, y, w, h; |
|
6207 |
int keyCode, modifiers, isDoubleClick = 0; |
|
6208 |
int isDown = 1; |
|
6209 |
int state; |
|
6210 |
OBJ upDown; |
|
2232 | 6211 |
OBJ eB; |
1127 | 6212 |
char nameBuffer[100]; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6213 |
HWND hWnd = 0; |
1127 | 6214 |
DDPRINTF(("dispatchLast\n")); |
6215 |
||
2232 | 6216 |
eB = __INST(eventBuffer); |
6217 |
||
6218 |
if (__isByteArray(eB)) { |
|
6219 |
ev = (struct queuedEvent *)(__ByteArrayInstPtr(eB)->ba_element); |
|
6220 |
} else { |
|
6221 |
printf("DISPLAY: no eventBuffer\n"); |
|
6222 |
RETURN (false); |
|
6223 |
} |
|
6224 |
if (ev) |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6225 |
{ |
2232 | 6226 |
_ev_buf = *ev; |
6227 |
ev = &_ev_buf; |
|
1127 | 6228 |
} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6229 |
hWnd = ev->ev_hWnd; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6230 |
if (!(hWnd /*&& IsWindow(hWnd)*/)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6231 |
DPRINTF(("wrong hWnd in event in dispatchLastEvent\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6232 |
RETURN (false); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6233 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6234 |
{ |
1723 | 6235 |
OBJ t; |
6236 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6237 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6238 |
* very often, its another event for the same view ... |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6239 |
* avoid creation & lookup then. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6240 |
*/ |
2232 | 6241 |
#if 1 |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6242 |
if ((t = __INST(lastId)) != nil) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6243 |
if (__isExternalAddress(t)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6244 |
if (_HWNDVal(t) == hWnd) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6245 |
theView = __INST(lastView); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6246 |
if (__isNonNilObject(theView)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6247 |
if (__qClass(theView) == nil) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6248 |
theView = nil; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6249 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6250 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6251 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6252 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6253 |
} |
2151 | 6254 |
#endif |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6255 |
if (theView == nil) { |
1723 | 6256 |
windowID = __MKOBJ(ev->ev_hWnd); |
6257 |
theView = (*vid.ilc_func)(self, @symbol(viewFromId:), nil, &vid, windowID); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6258 |
} |
1127 | 6259 |
} |
6260 |
||
6261 |
if (theView == nil) { |
|
6262 |
DPRINTF(("nil view [hWnd=%x] in dispatchEvent\n", ev->ev_hWnd)); |
|
6263 |
||
6264 |
RETURN (false); |
|
6265 |
} |
|
6266 |
||
1723 | 6267 |
switch (ev->ev_message) { |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6268 |
#if 1 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6269 |
case WM_WINDOWPOSCHANGED: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6270 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6271 |
RECT rct; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6272 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6273 |
DPRINTF((">>> WM_WINDOWPOSCHANGED -> configureX:y:width:height:view:\n")); |
1723 | 6274 |
|
6275 |
x = ev->ev_x; |
|
6276 |
y = ev->ev_y; |
|
6277 |
w = ev->ev_w; |
|
6278 |
h = ev->ev_h; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6279 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6280 |
/*printf(">>> WM_WINDOWPOSCHANGED -> configureX:%d y:%d width:%d height: %d\n",x,y,w,h);*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6281 |
|
1723 | 6282 |
(*conf.ilc_func)(self, |
6283 |
@symbol(configureX:y:width:height:view:), |
|
6284 |
nil, &conf, |
|
6285 |
__MKSMALLINT(x), |
|
6286 |
__MKSMALLINT(y), |
|
6287 |
__MKSMALLINT(w), |
|
6288 |
__MKSMALLINT(h), |
|
6289 |
theView); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6290 |
} |
1723 | 6291 |
break; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6292 |
#endif |
1127 | 6293 |
case WM_SHOWWINDOW: |
6294 |
if (ev->ev_wParam == TRUE) { |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6295 |
DPRINTF((">>> WM_SHOWWINDOW -> mappedView:\n")); |
2232 | 6296 |
arg = @symbol(unobscured); |
6297 |
(*vis.ilc_func)(theView, @symbol(visibilityChange:), nil, &vis, arg); |
|
1723 | 6298 |
(*map.ilc_func)(self, |
1127 | 6299 |
@symbol(mappedView:), |
1723 | 6300 |
nil, &map, theView); |
1127 | 6301 |
} else { |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6302 |
DPRINTF((">>> WM_SHOWWINDOW -> unMappedView:\n")); |
2232 | 6303 |
arg = @symbol(fullyObscured); |
6304 |
(*vis.ilc_func)(theView, @symbol(visibilityChange:), nil, &vis, arg); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6305 |
(*unmap.ilc_func)(self, |
1127 | 6306 |
@symbol(unmappedView:), |
1723 | 6307 |
nil, &unmap, theView); |
1127 | 6308 |
} |
6309 |
break; |
|
6310 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6311 |
case WM_CLOSE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6312 |
(*termS.ilc_func)(self, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6313 |
@symbol(terminateView:), nil, &termS, theView); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6314 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6315 |
|
1127 | 6316 |
case WM_DESTROY: |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6317 |
DPRINTF((">>> WM_DESTROY -> destroyedView\n")); |
1723 | 6318 |
(*destr.ilc_func)(self, |
1127 | 6319 |
@symbol(destroyedView:), |
1723 | 6320 |
nil, &destr, theView); |
1127 | 6321 |
break; |
6322 |
||
6323 |
case WM_ACTIVATE: |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6324 |
DPRINTF((">>> WM_ACTIVATE h=%x\n", ev->ev_hWnd)); |
1723 | 6325 |
|
1127 | 6326 |
switch (LOWORD(ev->ev_wParam)) { |
6327 |
case WA_INACTIVE: |
|
1723 | 6328 |
(*act.ilc_func)(self, |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6329 |
@symbol(activate:view:), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6330 |
nil, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6331 |
&act, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6332 |
false, |
1723 | 6333 |
theView); |
1127 | 6334 |
break; |
1723 | 6335 |
|
1127 | 6336 |
case WA_ACTIVE: |
6337 |
case WA_CLICKACTIVE: |
|
1723 | 6338 |
(*act.ilc_func)(self, |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6339 |
@symbol(activate:view:), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6340 |
nil, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6341 |
&act, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6342 |
true, |
1723 | 6343 |
theView); |
1127 | 6344 |
break; |
6345 |
default: |
|
6346 |
break; |
|
6347 |
} |
|
6348 |
break; |
|
6349 |
||
6350 |
case WM_MOUSEACTIVATE: |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6351 |
DPRINTF((">>> WM_MOUSEACTIVATE h=%x\n", ev->ev_hWnd)); |
1723 | 6352 |
|
6353 |
(*focIn.ilc_func)(self, |
|
1127 | 6354 |
@symbol(focusInView:), |
6355 |
nil, |
|
1723 | 6356 |
&focIn, |
1127 | 6357 |
theView); |
6358 |
break; |
|
6359 |
||
6360 |
case WM_SETFOCUS: |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6361 |
DPRINTF((">>> WM_SETFOCUS h=%x\n", ev->ev_hWnd)); |
1723 | 6362 |
(*focIn.ilc_func)(self, |
1127 | 6363 |
@symbol(focusInView:), |
6364 |
nil, |
|
1723 | 6365 |
&focIn, |
1127 | 6366 |
theView); |
6367 |
break; |
|
6368 |
||
6369 |
case WM_KILLFOCUS: |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6370 |
DPRINTF((">>> WM_KILLFOCUS h=%x\n", ev->ev_hWnd)); |
1723 | 6371 |
(*focOut.ilc_func)(self, |
1127 | 6372 |
@symbol(focusOutView:), |
6373 |
nil, |
|
1723 | 6374 |
&focOut, |
1127 | 6375 |
theView); |
6376 |
break; |
|
6377 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6378 |
case __WM_GEXPOSE: |
1127 | 6379 |
x = ev->ev_x; |
6380 |
y = ev->ev_y; |
|
6381 |
w = ev->ev_w; |
|
6382 |
h = ev->ev_h; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6383 |
(*gexpS.ilc_func)(self, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6384 |
@symbol(graphicsExposeX:y:width:height:final:view:), nil, &gexpS, |
1127 | 6385 |
__MKSMALLINT(x), |
6386 |
__MKSMALLINT(y), |
|
6387 |
__MKSMALLINT(w), |
|
6388 |
__MKSMALLINT(h), |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6389 |
true, |
1127 | 6390 |
theView); |
2232 | 6391 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6392 |
|
2232 | 6393 |
case __WM_NOGEXPOSE: |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6394 |
(*nexpS.ilc_func)(self, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6395 |
@symbol(noExposeView:), nil, &nexpS, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6396 |
theView); |
2232 | 6397 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6398 |
|
1127 | 6399 |
case WM_PAINT: |
2244 | 6400 |
{ |
6401 |
RECT rec; |
|
6402 |
HDC dc = (HDC)GetDC(ev->ev_hWnd); |
|
6403 |
HBRUSH br = CreateSolidBrush(st2RGB(GetWindow_bgBrush(ev->ev_hWnd),0)); |
|
6404 |
if (br) |
|
6405 |
{ |
|
6406 |
rec.left = ev->ev_x; |
|
6407 |
rec.top = ev->ev_y; |
|
6408 |
rec.right = ev->ev_w; |
|
6409 |
rec.bottom = ev->ev_h; |
|
2253 | 6410 |
//printf("erase %d %d %d %d\n",rec.left,rec.top,rec.right,rec.bottom); |
2244 | 6411 |
SelectClipRgn(dc,0); |
6412 |
FillRect(dc, &rec, br); |
|
6413 |
DelObject(br); |
|
6414 |
} |
|
6415 |
ReleaseDC(ev->ev_hWnd,dc); |
|
6416 |
} |
|
1127 | 6417 |
x = ev->ev_x; |
6418 |
y = ev->ev_y; |
|
6419 |
w = ev->ev_w; |
|
6420 |
h = ev->ev_h; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6421 |
/*printf("paint %x: %d %d %d %d\n",ev->ev_hWnd,x,y,w,h);*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6422 |
/*expose:*/ |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6423 |
DPRINTF((">>> WM_PAINT -> expose %d/%d -> %d/%d\n", x, y, w, h)); |
1723 | 6424 |
(*exp.ilc_func)(self, |
1127 | 6425 |
@symbol(exposeX:y:width:height:view:), |
1723 | 6426 |
nil, &exp, |
1127 | 6427 |
__MKSMALLINT(x), |
6428 |
__MKSMALLINT(y), |
|
2270
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
6429 |
__MKSMALLINT((w - x + 1)), |
b58aa9d04cfe
oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
6430 |
__MKSMALLINT((h - y + 1)), |
1127 | 6431 |
theView); |
6432 |
break; |
|
6433 |
||
6434 |
case WM_LBUTTONDBLCLK: |
|
6435 |
isDoubleClick = 1; |
|
2151 | 6436 |
butt = __MKSMALLINT(Button1); |
1127 | 6437 |
goto commonButtonDown; |
6438 |
||
6439 |
case WM_LBUTTONUP: |
|
6440 |
isDown = 0; |
|
2151 | 6441 |
butt = __MKSMALLINT(Button1); |
1127 | 6442 |
goto commonButtonDown; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6443 |
|
1127 | 6444 |
case WM_LBUTTONDOWN: |
2151 | 6445 |
butt = __MKSMALLINT(Button1); |
1127 | 6446 |
goto commonButtonDown; |
6447 |
||
6448 |
case WM_MBUTTONDBLCLK: |
|
6449 |
isDoubleClick = 1; |
|
2151 | 6450 |
butt = __MKSMALLINT(Button2); |
1127 | 6451 |
goto commonButtonDown; |
6452 |
||
6453 |
case WM_MBUTTONUP: |
|
6454 |
isDown = 0; |
|
2151 | 6455 |
butt = __MKSMALLINT(Button2); |
1127 | 6456 |
goto commonButtonDown; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6457 |
|
1127 | 6458 |
case WM_MBUTTONDOWN: |
2151 | 6459 |
butt = __MKSMALLINT(Button2); |
1127 | 6460 |
goto commonButtonDown; |
6461 |
||
6462 |
case WM_RBUTTONDBLCLK: |
|
6463 |
isDoubleClick = 1; |
|
2151 | 6464 |
butt = __MKSMALLINT(Button3); |
1127 | 6465 |
goto commonButtonDown; |
6466 |
||
6467 |
case WM_RBUTTONUP: |
|
6468 |
isDown = 0; |
|
2151 | 6469 |
butt = __MKSMALLINT(Button3); |
1127 | 6470 |
goto commonButtonDown; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6471 |
|
1127 | 6472 |
case WM_RBUTTONDOWN: |
2151 | 6473 |
butt = __MKSMALLINT(Button3); |
1127 | 6474 |
goto commonButtonDown; |
6475 |
||
6476 |
commonButtonDown: |
|
6477 |
x = ev->ev_x; |
|
6478 |
y = ev->ev_y; |
|
6479 |
modifiers = ev->ev_modifiers; |
|
6480 |
||
6481 |
if (__INST(buttonTranslation) != nil) { |
|
6482 |
butt = __AT_(__INST(buttonTranslation), butt); |
|
6483 |
} |
|
6484 |
arg = butt; |
|
6485 |
||
6486 |
__INST(altDown) = (modifiers & AltMask) ? true : false; |
|
6487 |
__INST(metaDown) = (modifiers & MetaMask) ? true : false; |
|
6488 |
__INST(shiftDown) = (modifiers & ShiftMask) ? true : false; |
|
6489 |
__INST(ctrlDown) = (modifiers & ControlMask) ? true : false; |
|
6490 |
||
2151 | 6491 |
if (isDoubleClick) |
6492 |
{ |
|
6493 |
multiClickState = 1; |
|
6494 |
nextMultiClickTime = lastMSGTime + multiClickTime; |
|
1723 | 6495 |
ipS = &bmp; |
1127 | 6496 |
symS = @symbol(buttonMultiPress:x:y:view:); |
2151 | 6497 |
} |
6498 |
else |
|
6499 |
{ |
|
6500 |
if (isDown) |
|
6501 |
{ |
|
6502 |
if (multiClickState && (lastMSGTime < nextMultiClickTime)) |
|
1705 | 6503 |
{ |
2151 | 6504 |
nextMultiClickTime = lastMSGTime + multiClickTime; |
6505 |
ipS = &bmp; |
|
6506 |
symS = @symbol(buttonMultiPress:x:y:view:); |
|
1127 | 6507 |
} |
2151 | 6508 |
else |
6509 |
{ |
|
6510 |
multiClickState = 0; |
|
6511 |
ipS = &bp; |
|
6512 |
symS = @symbol(buttonPress:x:y:view:); |
|
6513 |
} |
|
6514 |
} |
|
6515 |
else |
|
6516 |
{ |
|
1723 | 6517 |
ipS = &br; |
1127 | 6518 |
symS = @symbol(buttonRelease:x:y:view:); |
6519 |
} |
|
6520 |
} |
|
6521 |
||
6522 |
if (__isSymbol(arg)) { |
|
2151 | 6523 |
DPRINTF(("buttonPress/buttonRelease: %s %d/%d\n", |
1127 | 6524 |
__stringVal(arg), x, y)); |
6525 |
} else { |
|
2151 | 6526 |
DPRINTF(("buttonPress/buttonRelease: %d %d/%d\n", |
1127 | 6527 |
__intVal(arg), x, y)); |
6528 |
} |
|
6529 |
||
6530 |
(*(*ipS).ilc_func)(self, symS, nil, ipS, |
|
6531 |
arg, |
|
6532 |
__MKSMALLINT(x), |
|
6533 |
__MKSMALLINT(y), |
|
6534 |
theView); |
|
6535 |
break; |
|
6536 |
||
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6537 |
case __WM_MOUSEENTER: |
1127 | 6538 |
x = ev->ev_x; |
6539 |
y = ev->ev_y; |
|
1723 | 6540 |
state = ev->ev_modifiers; |
6541 |
DPRINTF((">>> WM_MOUSEENTER: %d/%d %x\n", x, y, state)); |
|
6542 |
(*pe.ilc_func)(self, @symbol(pointerEnter:x:y:view:), |
|
6543 |
nil, &pe, |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6544 |
__MKSMALLINT(state), |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6545 |
__MKSMALLINT(x), |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6546 |
__MKSMALLINT(y), |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6547 |
theView); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6548 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6549 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6550 |
case __WM_MOUSELEAVE: |
1723 | 6551 |
state = ev->ev_modifiers; |
6552 |
DPRINTF((">>> WM_MOUSELEAVE: %d/%d %x\n", x, y, state)); |
|
6553 |
(*pl.ilc_func)(self, @symbol(pointerLeave:view:), |
|
6554 |
nil, &pl, |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6555 |
__MKSMALLINT(state), |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6556 |
theView); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6557 |
break; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6558 |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6559 |
case WM_MOUSEMOVE: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6560 |
x = ev->ev_x; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6561 |
y = ev->ev_y; |
1723 | 6562 |
state = ev->ev_modifiers; |
6563 |
DPRINTF((">>> WM_MOUSEMOVE: %d/%d %x\n", x, y, state)); |
|
1127 | 6564 |
|
1723 | 6565 |
(*mot.ilc_func)(self, @symbol(buttonMotion:x:y:view:), |
6566 |
nil, &mot, |
|
1127 | 6567 |
__MKSMALLINT(state), |
6568 |
__MKSMALLINT(x), |
|
6569 |
__MKSMALLINT(y), |
|
6570 |
theView); |
|
6571 |
break; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6572 |
|
1127 | 6573 |
case WM_CHAR: |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6574 |
DPRINTF((">>> WM_CHAR: %d/%d\n", x, y)); |
1127 | 6575 |
symS = @symbol(keyPress:x:y:view:); |
1723 | 6576 |
ipS = &skp; |
1127 | 6577 |
upDown = true; |
6578 |
goto keyPressAndRelease; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6579 |
|
1127 | 6580 |
case WM_SYSKEYUP: |
6581 |
case WM_KEYUP: |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6582 |
DPRINTF((">>> WM_KEYUP / SYSKEYUP: %d/%d\n", x, y)); |
1127 | 6583 |
symS = @symbol(keyRelease:x:y:view:); |
1723 | 6584 |
ipS = &skr; |
1127 | 6585 |
upDown = false; |
6586 |
goto keyPressAndRelease; |
|
6587 |
||
6588 |
case WM_SYSKEYDOWN: |
|
6589 |
case WM_KEYDOWN: |
|
2232 | 6590 |
#ifdef DEBUG |
6591 |
if (ev->ev_keyCode == 0x11) |
|
6592 |
c_count = 0; |
|
6593 |
#endif |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6594 |
DPRINTF((">>> WM_KEYDOWN / SYSKEYDOWN: %d/%d\n", x, y)); |
1127 | 6595 |
symS = @symbol(keyPress:x:y:view:); |
1723 | 6596 |
ipS = &skp; |
1127 | 6597 |
upDown = true; |
6598 |
/* FALL INTO */ |
|
6599 |
||
6600 |
keyPressAndRelease: ; |
|
6601 |
||
6602 |
x = ev->ev_x; |
|
6603 |
y = ev->ev_y; |
|
6604 |
||
6605 |
#ifdef NOTDEF |
|
6606 |
{ |
|
6607 |
BYTE vKeyState[256]; |
|
6608 |
char buff[5]; |
|
6609 |
||
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6610 |
GetKeyboardState(vKeyState); |
1127 | 6611 |
ToAscii(ev->ev_keyCode, ev->ev_scanCode, vKeyState, &buff; 0); |
6612 |
} |
|
6613 |
#endif |
|
6614 |
||
6615 |
keyCode = ev->ev_keyCode; |
|
6616 |
modifiers = ev->ev_modifiers; |
|
6617 |
||
6618 |
if (modifiers & TRANSLATED_KEY) { |
|
6619 |
if (modifiers & ControlMask) { |
|
6620 |
if (keyCode < 0x20) { |
|
6621 |
keyCode = keyCode + 'a' - 1; |
|
6622 |
if (modifiers & ShiftMask) { |
|
6623 |
keyCode = keyCode - 'a' + 'A'; |
|
6624 |
} |
|
6625 |
} |
|
6626 |
} else if (modifiers & (MetaMask | AltMask)) { |
|
6627 |
if (! (modifiers & ShiftMask)) { |
|
6628 |
if ((keyCode >= 'A') && (keyCode <= 'Z')) { |
|
6629 |
keyCode = keyCode - 'A' + 'a'; |
|
6630 |
} |
|
6631 |
} |
|
6632 |
} |
|
6633 |
arg = __MKCHARACTER(keyCode & 0xFF); |
|
6634 |
} else { |
|
6635 |
switch (keyCode) { |
|
2151 | 6636 |
case VK_F1: |
6637 |
arg = @symbol(F1); |
|
6638 |
break; |
|
6639 |
case VK_F2: |
|
6640 |
arg = @symbol(F2); |
|
6641 |
break; |
|
6642 |
case VK_F3: |
|
6643 |
arg = @symbol(F3); |
|
6644 |
break; |
|
6645 |
case VK_F4: |
|
6646 |
arg = @symbol(F4); |
|
6647 |
break; |
|
6648 |
case VK_F5: |
|
6649 |
arg = @symbol(F5); |
|
6650 |
break; |
|
6651 |
case VK_F6: |
|
6652 |
arg = @symbol(F6); |
|
6653 |
break; |
|
6654 |
case VK_F7: |
|
6655 |
arg = @symbol(F7); |
|
6656 |
break; |
|
6657 |
case VK_F8: |
|
6658 |
arg = @symbol(F8); |
|
6659 |
break; |
|
6660 |
case VK_F9: |
|
6661 |
arg = @symbol(F9); |
|
6662 |
break; |
|
6663 |
case VK_F10: |
|
6664 |
arg = @symbol(F10); |
|
6665 |
break; |
|
6666 |
case VK_F11: |
|
6667 |
arg = @symbol(F11); |
|
6668 |
break; |
|
6669 |
case VK_F12: |
|
6670 |
arg = @symbol(F12); |
|
6671 |
break; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6672 |
case VK_PRIOR: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6673 |
arg = @symbol(Prior); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6674 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6675 |
case VK_NEXT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6676 |
arg = @symbol(Next); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6677 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6678 |
case VK_END: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6679 |
arg = @symbol(End); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6680 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6681 |
case VK_HOME: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6682 |
arg = @symbol(Home); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6683 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6684 |
case VK_LEFT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6685 |
arg = @symbol(CursorLeft); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6686 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6687 |
case VK_RIGHT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6688 |
arg = @symbol(CursorRight); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6689 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6690 |
case VK_UP: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6691 |
arg = @symbol(CursorUp); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6692 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6693 |
case VK_DOWN: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6694 |
arg = @symbol(CursorDown); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6695 |
break; |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6696 |
case VK_MENU: /*alt key with w95 ???*/ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6697 |
arg = @symbol(Menu); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6698 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6699 |
case VK_LMENU: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6700 |
arg = @symbol(Menu_L); |
1127 | 6701 |
break; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6702 |
case VK_RMENU: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6703 |
arg = @symbol(Menu_R); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6704 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6705 |
case VK_PAUSE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6706 |
arg = @symbol(Pause); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6707 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6708 |
case VK_HELP: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6709 |
arg = @symbol(Help); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6710 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6711 |
case VK_EXECUTE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6712 |
arg = @symbol(Execute); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6713 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6714 |
case VK_CANCEL: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6715 |
arg = @symbol(Cancel); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6716 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6717 |
case VK_SELECT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6718 |
arg = @symbol(Select); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6719 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6720 |
case VK_PRINT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6721 |
arg = @symbol(Print); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6722 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6723 |
case VK_SNAPSHOT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6724 |
arg = @symbol(Snapshot); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6725 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6726 |
case VK_INSERT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6727 |
arg = @symbol(Insert); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6728 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6729 |
case VK_DELETE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6730 |
arg = @symbol(Delete); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6731 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6732 |
case VK_BACK: |
1127 | 6733 |
arg = @symbol(BackSpace); |
6734 |
break; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6735 |
case VK_LWIN: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6736 |
arg = @symbol(Win_L); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6737 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6738 |
case VK_RWIN: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6739 |
arg = @symbol(Win_R); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6740 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6741 |
case VK_APPS: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6742 |
arg = @symbol(Appl); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6743 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6744 |
case VK_NUMPAD0: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6745 |
arg = @symbol(KeyPad0); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6746 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6747 |
case VK_NUMPAD1: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6748 |
arg = @symbol(KeyPad1); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6749 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6750 |
case VK_NUMPAD2: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6751 |
arg = @symbol(KeyPad2); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6752 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6753 |
case VK_NUMPAD3: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6754 |
arg = @symbol(KeyPad3); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6755 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6756 |
case VK_NUMPAD4: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6757 |
arg = @symbol(KeyPad4); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6758 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6759 |
case VK_NUMPAD5: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6760 |
arg = @symbol(KeyPad5); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6761 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6762 |
case VK_NUMPAD6: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6763 |
arg = @symbol(KeyPad6); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6764 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6765 |
case VK_NUMPAD7: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6766 |
arg = @symbol(KeyPad7); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6767 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6768 |
case VK_NUMPAD8: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6769 |
arg = @symbol(KeyPad8); |
1127 | 6770 |
break; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6771 |
case VK_NUMPAD9: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6772 |
arg = @symbol(KeyPad9); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6773 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6774 |
case VK_LSHIFT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6775 |
arg = @symbol(Shift_L); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6776 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6777 |
case VK_RSHIFT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6778 |
arg = @symbol(Shift_R); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6779 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6780 |
case VK_LCONTROL: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6781 |
arg = @symbol(Ctrl_L); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6782 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6783 |
case VK_RCONTROL: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6784 |
arg = @symbol(Ctrl_R); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6785 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6786 |
case VK_CONTROL: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6787 |
arg = @symbol(Ctrl); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6788 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6789 |
case VK_SHIFT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6790 |
arg = @symbol(Shift); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6791 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6792 |
case VK_TAB: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6793 |
arg = @symbol(Tab); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6794 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6795 |
case VK_ESCAPE: |
1127 | 6796 |
arg = @symbol(Escape); |
6797 |
break; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6798 |
case VK_NUMLOCK: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6799 |
arg = @symbol(NumLock); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6800 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6801 |
case VK_SCROLL: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6802 |
arg = @symbol(ScrollLock); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6803 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6804 |
case VK_RETURN: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6805 |
arg = @symbol(Return); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6806 |
break; |
1127 | 6807 |
default: |
6808 |
nameBuffer[0] = 0; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6809 |
/*GetKeyNameText(ev->ev_scanCode, nameBuffer, sizeof(nameBuffer));*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6810 |
DPRINTF(("char is <%d>\n", keyCode)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6811 |
arg = __MKCHARACTER(keyCode & 0xFF); |
1127 | 6812 |
break; |
6813 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6814 |
} |
1127 | 6815 |
|
6816 |
DPRINTF(("%s: code=%x mod=%x\n", __stringVal(symS), |
|
6817 |
keyCode, modifiers)); |
|
6818 |
||
6819 |
__INST(altDown) = (modifiers & AltMask) ? true : false; |
|
6820 |
__INST(metaDown) = (modifiers & MetaMask) ? true : false; |
|
6821 |
__INST(shiftDown) = (modifiers & ShiftMask) ? true : false; |
|
6822 |
__INST(ctrlDown) = (modifiers & ControlMask) ? true : false; |
|
6823 |
||
6824 |
(*(*ipS).ilc_func)(self, symS, nil, ipS, |
|
6825 |
arg, |
|
6826 |
__MKSMALLINT(x), |
|
6827 |
__MKSMALLINT(y), |
|
6828 |
theView); |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6829 |
break; |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6830 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6831 |
case WM_SYSCOLORCHANGE: |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6832 |
DPRINTF((">>> WM_SYSCOLORCHANGE\n")); |
2325 | 6833 |
(*sysClrChg.ilc_func)(self, @symbol(systemColorChange:), nil, &sysClrChg, theView); |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6834 |
break; |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6835 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6836 |
case WM_FONTCHANGE: |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6837 |
DPRINTF((">>> WM_FONTCHANGE\n")); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6838 |
(*fontChg.ilc_func)(self, @symbol(fontChange), nil, &fontChg); |
1127 | 6839 |
break; |
6840 |
||
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6841 |
case WM_QUERYENDSESSION: |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6842 |
DPRINTF((">>> WM_QUERYENDSESSION\n")); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6843 |
(*qEndSess.ilc_func)(self, @symbol(queryEndSession), nil, &qEndSess); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6844 |
break; |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6845 |
|
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6846 |
#ifdef LATER |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6847 |
case WM_POWER: |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6848 |
DPRINTF((">>> WM_POWER\n")); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6849 |
(*power.ilc_func)(self, @symbol(powerDown), nil, &power); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6850 |
break; |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6851 |
#endif |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6852 |
|
1127 | 6853 |
default: |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
6854 |
UNHANDLED_EVENT_PRINTF(("WinWorkstat [info]: >>> unhandled event: %x\n", ev->ev_message)); |
1127 | 6855 |
break; |
6856 |
} |
|
6857 |
%}. |
|
6858 |
^ true |
|
2232 | 6859 |
! |
6860 |
||
6861 |
dispatchPendingEvents |
|
6862 |
"central event handling method for modal operation. |
|
6863 |
(i.e. this is now only used in the modal debugger) |
|
6864 |
Dispatch any pending events; return when no more are pending. |
|
6865 |
This code is somewhat special, since X has a concept of graphic |
|
6866 |
expose events (which are sent after a bitblt). After such a bitblt, |
|
6867 |
we only handle exposes until the graphicsExpose arrives. |
|
6868 |
Other systems may not need such a kludge" |
|
6869 |
||
6870 |
"interested in exposes only ?" |
|
6871 |
dispatchingExpose notNil ifTrue:[ |
|
6872 |
[self exposeEventPendingFor:dispatchingExpose withSync:false] whileTrue:[ |
|
6873 |
self dispatchExposeEventFor:dispatchingExpose |
|
6874 |
]. |
|
6875 |
^ self |
|
6876 |
]. |
|
6877 |
||
6878 |
[self eventPendingWithSync:false] whileTrue:[ |
|
6879 |
(self getEventFor:nil withMask:nil) ifTrue:[ |
|
6880 |
AbortSignal handle:[:ex | |
|
6881 |
ex return |
|
6882 |
] do:[ |
|
6883 |
self dispatchLastEvent |
|
6884 |
] |
|
6885 |
]. |
|
6886 |
] |
|
6887 |
||
6888 |
"Modified: 19.8.1997 / 17:11:18 / cg" |
|
6889 |
! |
|
6890 |
||
1127 | 6891 |
disposeEventsWithMask:aMask for:aWindowIdOrNil |
6892 |
"dispose (throw away) specific events. If aWindowId is nil, |
|
6893 |
events matching the mask are thrown away regardless of which |
|
2232 | 6894 |
view they are for. Otherwise, only matching events for that |
1127 | 6895 |
view are flushed." |
6896 |
||
6897 |
%{ /* NOCONTEXT */ |
|
2232 | 6898 |
PRINTF(("disposeEventsWithMask:for: not yet implemented.\n")); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6899 |
RETURN ( self ); |
1127 | 6900 |
%}. |
6901 |
self primitiveFailed |
|
2232 | 6902 |
! |
6903 |
||
1127 | 6904 |
eventMaskFor:anEventSymbol |
6905 |
"return the eventMask bit-constant corresponding to an event symbol" |
|
6906 |
||
6907 |
%{ /* NOCONTEXT */ |
|
6908 |
||
6909 |
int m = 0; |
|
6910 |
||
6911 |
if (anEventSymbol == @symbol(keyPress)) m = KeyPressMask; |
|
6912 |
else if (anEventSymbol == @symbol(keyRelease)) m = KeyReleaseMask; |
|
6913 |
else if (anEventSymbol == @symbol(buttonPress)) m = ButtonPressMask; |
|
6914 |
else if (anEventSymbol == @symbol(buttonRelease)) m = ButtonReleaseMask; |
|
6915 |
else if (anEventSymbol == @symbol(buttonMotion)) m = ButtonMotionMask; |
|
6916 |
else if (anEventSymbol == @symbol(pointerMotion)) m = PointerMotionMask; |
|
6917 |
else if (anEventSymbol == @symbol(expose)) m = ExposureMask; |
|
6918 |
else if (anEventSymbol == @symbol(focusChange)) m = FocusChangeMask; |
|
6919 |
else if (anEventSymbol == @symbol(enter)) m = EnterWindowMask; |
|
6920 |
else if (anEventSymbol == @symbol(leave)) m = LeaveWindowMask; |
|
6921 |
else if (anEventSymbol == @symbol(keymapState)) m = KeymapStateMask; |
|
6922 |
else if (anEventSymbol == @symbol(visibilityChange)) m = VisibilityChangeMask; |
|
6923 |
else if (anEventSymbol == @symbol(structureNotify)) m = StructureNotifyMask; |
|
6924 |
else if (anEventSymbol == @symbol(resizeRedirect)) m = ResizeRedirectMask; |
|
6925 |
else if (anEventSymbol == @symbol(propertyChange)) m = PropertyChangeMask; |
|
6926 |
else if (anEventSymbol == @symbol(colormapChange)) m = ColormapChangeMask; |
|
6927 |
RETURN (__MKSMALLINT(m)); |
|
6928 |
%} |
|
2232 | 6929 |
! |
6930 |
||
1127 | 6931 |
eventPending |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6932 |
"return true, if any event is pending. |
1127 | 6933 |
This looks for both the internal queue and the display connection." |
6934 |
||
2232 | 6935 |
ConservativeSyncing == true ifTrue:[self sync]. |
6936 |
||
6937 |
dispatchingExpose notNil ifTrue:[ |
|
6938 |
^ self exposeEventPendingFor:dispatchingExpose withSync:false |
|
6939 |
]. |
|
6940 |
^ self eventPendingWithSync:false |
|
6941 |
! |
|
6942 |
||
6943 |
eventPending:anEventSymbol for:aWindowIdOrNil |
|
6944 |
"return true, if a specific event is pending" |
|
6945 |
||
6946 |
^ self eventsPending:(self eventMaskFor:anEventSymbol) for:aWindowIdOrNil withSync:false |
|
6947 |
! |
|
6948 |
||
6949 |
eventPendingWithSync:doSync |
|
6950 |
"return true, if any event is pending. |
|
6951 |
The doSync argument is ignored here - in windows, all drawing is synchronous." |
|
6952 |
doSync notNil ifTrue:[self flush]. |
|
6953 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
|
1723 | 6954 |
MSG msg; |
6955 |
||
6956 |
if (__INST(inRecursiveDispatch) == true) { |
|
6957 |
RETURN (false); |
|
6958 |
} |
|
6959 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6960 |
if (isInputEvent()) { |
1723 | 6961 |
RETURN (true); |
6962 |
} |
|
6963 |
%}. |
|
2232 | 6964 |
! |
6965 |
||
1127 | 6966 |
eventQueued |
6967 |
"return true, if any event is queued" |
|
6968 |
||
6969 |
^ self eventQueuedAlready |
|
6970 |
||
6971 |
"Created: 12.12.1995 / 21:43:00 / stefan" |
|
2232 | 6972 |
! |
6973 |
||
1127 | 6974 |
eventQueuedAlready |
6975 |
"return true, if any event is queued internally. |
|
6976 |
(i.e. in X's internal event queue, which is both filled by explicit |
|
6977 |
nextEvent calls AND whenever drawing is done and events are pending on |
|
6978 |
the display connection)." |
|
6979 |
||
2232 | 6980 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 6981 |
|
6982 |
DDPRINTF(("peek q - ")); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6983 |
if (isInputEvent()) { |
1127 | 6984 |
DDPRINTF(("true\n")); |
6985 |
RETURN (true); |
|
6986 |
} |
|
6987 |
DDPRINTF(("false\n")); |
|
6988 |
RETURN ( false ); |
|
6989 |
%} |
|
2232 | 6990 |
! |
6991 |
||
1127 | 6992 |
eventsPending:anEventMask for:aWindowIdOrNil withSync:doSync |
1705 | 6993 |
"return true, if any of the masked events is pending. |
6994 |
The doSync argument is ignored here - in windows, all drawing is synchronous." |
|
1127 | 6995 |
|
6996 |
%{ /* NOCONTEXT */ |
|
6997 |
||
2232 | 6998 |
DPRINTF(("eventsPending mask %x - not implemented\n", __intVal(anEventMask))); |
1127 | 6999 |
%}. |
7000 |
^ false |
|
2232 | 7001 |
! |
7002 |
||
1127 | 7003 |
exposeEventPendingFor:aWindowIdOrNil withSync:doSync |
7004 |
"return true, if any expose event is pending for a specific view, |
|
7005 |
or any view (if the arg is nil). |
|
1705 | 7006 |
This is an X specific interface - not used on windows (scrolling is synchronous)" |
2232 | 7007 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7008 |
%}. |
1127 | 7009 |
^ false |
2232 | 7010 |
! |
7011 |
||
1127 | 7012 |
getEventFor:aViewIdOrNil withMask:eventMask |
2232 | 7013 |
"read next event - put into local eventBuffer. |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7014 |
If aViewIdOrNil is nil, events for any view are fetched; |
1127 | 7015 |
otherwise only events for that specific view will be fetched. |
7016 |
Returns true, if there was an event, false otherwise." |
|
7017 |
||
2232 | 7018 |
%{ /* xxLIMITEDSTACK */ |
7019 |
HWND win, wWanted; |
|
7020 |
int evMask; |
|
7021 |
OBJ eB; |
|
7022 |
struct queuedEvent *ev; |
|
7023 |
struct queuedEvent *qev; |
|
7024 |
eB = __INST(eventBuffer); |
|
7025 |
if (__isByteArray(eB)) { |
|
7026 |
ev = (struct queuedEvent *)(__ByteArrayInstPtr(eB)->ba_element); |
|
7027 |
} else { |
|
7028 |
printf("DISPLAY: no eventBuffer\n"); |
|
7029 |
RETURN (false); |
|
7030 |
} |
|
7031 |
ev->ev_message = 0; |
|
7032 |
||
7033 |
if (__isSmallInteger(eventMask)) { |
|
7034 |
evMask = __intVal(eventMask); |
|
7035 |
} else { |
|
7036 |
evMask = ~0; |
|
7037 |
} |
|
7038 |
||
7039 |
if (__isExternalAddress(aViewIdOrNil)) |
|
7040 |
{ |
|
7041 |
if (deqEvent(ev,_HWNDVal(aViewIdOrNil),evMask)) |
|
7042 |
{ |
|
7043 |
RETURN ( true ); |
|
7044 |
} |
|
7045 |
} |
|
7046 |
else |
|
7047 |
{ |
|
7048 |
if (deqEvent(ev,0,evMask)) |
|
7049 |
{ |
|
7050 |
RETURN ( true ); |
|
7051 |
} |
|
7052 |
} |
|
1127 | 7053 |
%}. |
7054 |
^ false |
|
2232 | 7055 |
! |
7056 |
||
1127 | 7057 |
handleAllEvents |
2232 | 7058 |
"from now on, handle any kind of event" |
7059 |
||
7060 |
dispatchingExpose := nil |
|
7061 |
! |
|
7062 |
||
1127 | 7063 |
handleExposeOnlyFor:aView |
2232 | 7064 |
"from now on, handle expose events only" |
7065 |
||
2253 | 7066 |
"/ dispatchingExpose := aView id |
7067 |
'handleExposeOnlyFor: not yet implemented' printCR. |
|
2232 | 7068 |
! |
7069 |
||
1127 | 7070 |
mappingChanged:what event:eB |
7071 |
"One of Keyboard-, Modifier- or PointerMap has change, probably by xmodmap. |
|
7072 |
Tell xlib about the fact." |
|
7073 |
||
7074 |
(what == #mappingKeyboard or:[what == #mappingModifier]) ifTrue:[ |
|
7075 |
self refreshKeyboardMapping:eB. |
|
7076 |
"Maybe some of our modifiers have been changed" |
|
7077 |
self initializeModifierMappings. |
|
7078 |
]. |
|
7079 |
||
7080 |
"Created: 1.12.1995 / 16:28:23 / stefan" |
|
2232 | 7081 |
! |
7082 |
||
1127 | 7083 |
setEventMask:aMask in:aWindowId |
7084 |
"tell X that we are only interested in events from aMask, which |
|
7085 |
is the bitwise or of the eventMask bits (see 'eventMaskFor:')" |
|
7086 |
||
2151 | 7087 |
%{ /* NOCONTEXT */ |
7088 |
||
7089 |
if (__isExternalAddress(aWindowId) |
|
7090 |
&& __isSmallInteger(aMask)) |
|
7091 |
{ |
|
7092 |
HWND hWnd = _HWNDVal(aWindowId); |
|
7093 |
int mask = __intVal(aMask); |
|
7094 |
if (GETLOCALWINDOWINFOPTR(hWnd)) |
|
7095 |
{ |
|
7096 |
DPRINTF(("new eventMask %x\n",mask)); |
|
7097 |
#ifdef DEBUGMASK |
|
2232 | 7098 |
PRINTF(("new eventMask %x\n",mask)); |
2151 | 7099 |
printMask(mask); |
7100 |
#endif |
|
7101 |
GETLOCALWINDOWINFOPTR(hWnd)->eventMask = mask; |
|
7102 |
RETURN ( self ); |
|
7103 |
} |
|
7104 |
} |
|
7105 |
%}. |
|
7106 |
self primitiveFailed |
|
2232 | 7107 |
! ! |
7108 |
||
7109 |
!WinWorkstation methodsFor:'event sending'! |
|
7110 |
||
1127 | 7111 |
sendKeyOrButtonEvent:typeSymbol x:xPos y:yPos keyOrButton:keySymCodeOrButtonNr state:stateMask toViewId:targetId |
7112 |
"send a keyPress/Release or buttonPress/Release event to some (possibly alien) view. |
|
7113 |
TypeSymbol must be one of: #keyPress, #keyRelease, #buttonPress , #buttonRelease. |
|
7114 |
For buttonEvents, the keySymCodeOrButtonNr must be the buttons number (1, 2 ...); |
|
7115 |
for key events, it can be either a symbol (as listen in X's keySyms) |
|
7116 |
or a numeric keysym code. If state is nil, the modifier bits (shift & control) |
|
7117 |
are computed from the keyboardMap - if non-nil, these are passed as modifierbits. |
|
7118 |
The non-nil case is the lowlevel entry, where state must include any shift/ctrl information |
|
7119 |
(not very user friendly)" |
|
7120 |
||
7121 |
^ false |
|
2232 | 7122 |
! |
7123 |
||
1127 | 7124 |
simulateKeyboardInput:aCharacterOrString inViewId:viewId |
7125 |
"send input to some other view, by simulating keyPress/keyRelease |
|
2151 | 7126 |
events. |
1127 | 7127 |
Only a few control characters are supported. |
7128 |
Notice: not all alien views allow this kind of synthetic input; |
|
7129 |
some simply ignore it." |
|
7130 |
||
7131 |
|control code state| |
|
7132 |
||
7133 |
aCharacterOrString isString ifTrue:[ |
|
7134 |
aCharacterOrString do:[:char | |
|
7135 |
self simulateKeyboardInput:char inViewId:viewId |
|
7136 |
]. |
|
7137 |
^ self |
|
7138 |
]. |
|
7139 |
||
7140 |
control := false. |
|
7141 |
code := aCharacterOrString asciiValue. |
|
7142 |
||
7143 |
(aCharacterOrString == Character cr) ifTrue:[ |
|
7144 |
code := #Return |
|
7145 |
] ifFalse:[ |
|
7146 |
(aCharacterOrString == Character tab) ifTrue:[ |
|
2151 | 7147 |
code := #Tab |
1127 | 7148 |
] ifFalse:[ |
7149 |
(aCharacterOrString == Character esc) ifTrue:[ |
|
2151 | 7150 |
code := #Escape |
1127 | 7151 |
] |
7152 |
] |
|
7153 |
]. |
|
7154 |
||
7155 |
control ifTrue:[ |
|
7156 |
state := self controlMask |
|
7157 |
]. |
|
7158 |
||
7159 |
||
7160 |
"/ the stuff below should not be needed |
|
7161 |
"/ (sendKeyOrButtonevent should be able to figure out things itself) |
|
7162 |
"/ however, on some linux systems it seems to not work correctly. |
|
7163 |
"/ Hopefully, this is correct ... |
|
7164 |
||
7165 |
code isNumber ifTrue:[ |
|
7166 |
code >= $A asciiValue ifTrue:[ |
|
7167 |
code <= $Z asciiValue ifTrue:[ |
|
7168 |
state := self shiftMask |
|
7169 |
] |
|
7170 |
] |
|
7171 |
]. |
|
7172 |
||
7173 |
self sendKeyOrButtonEvent:#keyPress x:0 y:0 keyOrButton:code state:state toViewId:viewId. |
|
7174 |
self sendKeyOrButtonEvent:#keyRelease x:0 y:0 keyOrButton:code state:state toViewId:viewId |
|
7175 |
||
7176 |
" |
|
7177 |
sending input to some (possibly alien) view: |
|
7178 |
||
7179 |
|point id| |
|
7180 |
||
7181 |
point := Display pointFromUser. |
|
7182 |
id := Display viewIdFromPoint:point. |
|
7183 |
Display simulateKeyboardInput:'Hello_world' inViewId:id |
|
7184 |
" |
|
7185 |
||
7186 |
"Modified: 11.6.1996 / 10:59:42 / cg" |
|
2232 | 7187 |
! ! |
7188 |
||
7189 |
!WinWorkstation methodsFor:'font stuff'! |
|
7190 |
||
1127 | 7191 |
createFontFor:aFontName |
7192 |
"a basic method for font allocation; this method allows |
|
7193 |
any font to be aquired (even those not conforming to |
|
7194 |
standard naming conventions, such as cursor, fixed or k14)" |
|
7195 |
||
2232 | 7196 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 7197 |
HGDIOBJ hFont; |
7198 |
char *fn; |
|
7199 |
||
7200 |
if (__isString(aFontName)) { |
|
7201 |
fn = __stringVal(aFontName); |
|
7202 |
if (strcmp(fn, "fixed") == 0) { |
|
7203 |
hFont = GetStockObject(ANSI_FIXED_FONT); |
|
7204 |
} else if (strcmp(fn, "variable") == 0) { |
|
7205 |
hFont = GetStockObject(ANSI_VAR_FONT); |
|
7206 |
} else { |
|
7207 |
hFont = GetStockObject(ANSI_FIXED_FONT); |
|
7208 |
} |
|
7209 |
if (hFont) { |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7210 |
DPRINTF(("createFontFor:aFontName: %s -> %x\n", fn, hFont)); |
1127 | 7211 |
RETURN ( __MKOBJ(hFont) ); |
7212 |
} |
|
7213 |
} |
|
7214 |
%}. |
|
7215 |
^ nil |
|
2232 | 7216 |
! |
7217 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7218 |
fontMetricsOf:fontId into:aBlock |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7219 |
"evaluate aBlock, passing a fonts metrics as arguments" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7220 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7221 |
|data| |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7222 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7223 |
data := Array new:10. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7224 |
(self primFontMetricsOf:fontId intoArray:data) isNil ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7225 |
self primitiveFailed. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7226 |
^ self |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7227 |
]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7228 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7229 |
aBlock value:#iso8859 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7230 |
value:(data at:1) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7231 |
value:(data at:2) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7232 |
value:(data at:3) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7233 |
value:(data at:4) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7234 |
value:(data at:5) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7235 |
value:(data at:6) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7236 |
value:(data at:7) |
2232 | 7237 |
! |
7238 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7239 |
fontsInFamily:aFamilyName face:aFaceName filtering:filter |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7240 |
"return a set of all available fonts in aFamily/aFace on this display. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7241 |
On WinWorkStations there is curently Face |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7242 |
But only thise matching filter (if nonNil)." |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7243 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7244 |
|allFonts fonts| |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7245 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7246 |
allFonts := self listOfAvailableFonts. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7247 |
allFonts isNil ifTrue:[^ nil]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7248 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7249 |
fonts := Set new. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7250 |
allFonts do:[:fntDescr | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7251 |
(aFamilyName sameAs:(fntDescr family)) ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7252 |
(filter isNil or:[filter value:fntDescr]) ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7253 |
fonts add:fntDescr |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7254 |
] |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7255 |
] |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7256 |
]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7257 |
^ fonts |
2232 | 7258 |
! |
7259 |
||
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7260 |
fontsInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7261 |
"return a set of all available font in aFamily/aFace/aStyle |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7262 |
on this display. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7263 |
On WinWorkStations there is curently no style or Face |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7264 |
But only those matching filter (if nonNIl)." |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7265 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7266 |
|allFonts fonts| |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7267 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7268 |
allFonts := self listOfAvailableFonts. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7269 |
allFonts isNil ifTrue:[^ nil]. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7270 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7271 |
fonts := Set new. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7272 |
allFonts do:[:fntDescr | |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7273 |
(aFamilyName sameAs:(fntDescr family)) ifTrue:[ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7274 |
(filter isNil or:[filter value:fntDescr]) ifTrue:[ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7275 |
fonts add:fntDescr |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7276 |
] |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7277 |
] |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7278 |
]. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7279 |
^ fonts |
2232 | 7280 |
! |
7281 |
||
1127 | 7282 |
fullNameOf:aFontId |
7283 |
"the fonts fullName - this is very device specific and should only be |
|
7284 |
used for user feed-back (for example: in the fontPanel). |
|
7285 |
If the display/font do not provide that info, return nil." |
|
7286 |
^ nil |
|
2232 | 7287 |
! |
7288 |
||
1127 | 7289 |
getAvailableFontsMatching:pattern |
7290 |
"return an Array filled with font names matching aPattern" |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7291 |
self halt. |
1127 | 7292 |
^ nil |
2232 | 7293 |
! |
7294 |
||
1127 | 7295 |
getDefaultFont |
7296 |
"return a default font id - used when class Font cannot |
|
7297 |
find anything usable" |
|
7298 |
||
7299 |
^ self createFontFor:'fixed' |
|
2232 | 7300 |
! |
7301 |
||
1127 | 7302 |
getFontWithFamily:familyString face:faceString |
7303 |
style:styleArgString size:sizeArg encoding:encodingSym |
|
7304 |
||
7305 |
"try to get the specified font, if not available, try next smaller |
|
7306 |
font. Access to X-fonts by name is possible, by passing the X font name |
|
7307 |
as family and the other parameters as nil. For example, the cursor font |
|
7308 |
can be aquired that way." |
|
7309 |
||
7310 |
|styleString theName theId xlatedStyle id spacing| |
|
7311 |
||
7312 |
styleString := styleArgString. |
|
7313 |
||
7314 |
"special: if face is nil, allow access to X-fonts" |
|
7315 |
faceString isNil ifTrue:[ |
|
7316 |
sizeArg notNil ifTrue:[ |
|
7317 |
theName := familyString , '-' , sizeArg printString |
|
7318 |
] ifFalse:[ |
|
7319 |
theName := familyString |
|
7320 |
]. |
|
7321 |
theName isNil ifTrue:[ |
|
7322 |
" |
|
7323 |
mhmh - fall back to the default font |
|
7324 |
" |
|
7325 |
theName := 'fixed' |
|
7326 |
]. |
|
7327 |
theId := self createFontFor:theName. |
|
7328 |
theId isNil ifTrue:[ |
|
7329 |
theId := self getDefaultFont |
|
7330 |
]. |
|
7331 |
^ theId |
|
7332 |
]. |
|
7333 |
||
7334 |
"/ spacing other than 'normal' is contained as last component |
|
7335 |
"/ in style |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7336 |
styleString notNil ifTrue:[ |
2232 | 7337 |
((styleString endsWith:'-narrow') |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7338 |
or:[styleString endsWith:'-semicondensed']) ifTrue:[ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7339 |
|i| |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7340 |
i := styleString lastIndexOf:$-. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7341 |
spacing := styleString copyFrom:(i+1). |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7342 |
styleString := styleString copyTo:(i-1). |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7343 |
] ifFalse:[ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7344 |
spacing := 'normal'. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7345 |
]. |
1127 | 7346 |
]. |
7347 |
||
7348 |
xlatedStyle := styleString. |
|
7349 |
xlatedStyle notNil ifTrue:[ |
|
7350 |
xlatedStyle := xlatedStyle first asString |
|
7351 |
]. |
|
7352 |
||
2232 | 7353 |
id := self |
1127 | 7354 |
getFontWithFoundry:'*' |
7355 |
family:familyString asLowercase |
|
7356 |
weight:faceString |
|
7357 |
slant:xlatedStyle |
|
7358 |
spacing:spacing |
|
7359 |
pixelSize:nil |
|
2232 | 7360 |
size:sizeArg |
1127 | 7361 |
registry:encodingSym |
7362 |
encoding:'*'. |
|
7363 |
||
7364 |
id isNil ifTrue:[ |
|
7365 |
(encodingSym notNil and:[encodingSym ~= '*']) ifTrue:[ |
|
7366 |
"/ too stupid: encodings come in both cases |
|
7367 |
"/ and X does not ignore case |
|
7368 |
"/ |
|
2232 | 7369 |
id := self |
1127 | 7370 |
getFontWithFoundry:'*' |
7371 |
family:familyString asLowercase |
|
7372 |
weight:faceString |
|
7373 |
slant:xlatedStyle |
|
7374 |
spacing:spacing |
|
7375 |
pixelSize:nil |
|
2232 | 7376 |
size:sizeArg |
1127 | 7377 |
registry:encodingSym asUppercase |
7378 |
encoding:'*'. |
|
7379 |
id isNil ifTrue:[ |
|
2232 | 7380 |
id := self |
1127 | 7381 |
getFontWithFoundry:'*' |
7382 |
family:familyString asLowercase |
|
7383 |
weight:faceString |
|
7384 |
slant:xlatedStyle |
|
7385 |
spacing:spacing |
|
7386 |
pixelSize:nil |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7387 |
size:sizeArg |
1127 | 7388 |
registry:encodingSym asLowercase |
7389 |
encoding:'*'. |
|
7390 |
] |
|
7391 |
] |
|
7392 |
]. |
|
7393 |
^ id |
|
7394 |
||
7395 |
"Modified: 24.2.1996 / 22:37:24 / cg" |
|
7396 |
"Modified: 4.7.1996 / 11:38:47 / stefan" |
|
2232 | 7397 |
! |
7398 |
||
1127 | 7399 |
getFontWithFoundry:foundry family:family weight:weight |
2232 | 7400 |
slant:slant spacing:spc pixelSize:pSize size:size |
1127 | 7401 |
registry:registry encoding:encoding |
7402 |
||
7403 |
"get the specified font, if not available, return nil. |
|
7404 |
This is the new font creation method - all others will be changed to |
|
7405 |
use this entry. |
|
7406 |
Individual attributes can be left empty (i.e. '') or nil to match any. |
|
7407 |
||
7408 |
foundry: 'adobe', 'misc', 'dec', 'schumacher' ... usually '*' |
|
7409 |
family: 'helvetica' 'courier' 'times' ... |
|
7410 |
weight: 'bold' 'medium' 'demi' ... |
|
7411 |
slant: 'r(oman)' 'i(talic)' 'o(blique)' |
|
7412 |
spacing: 'narrow' 'normal' semicondensed' ... usually '*' |
|
7413 |
pixelSize: 16,18 ... usually left empty |
|
7414 |
size: size in point (1/72th of an inch) |
|
7415 |
registry: iso8859, sgi ... '*' |
|
7416 |
encoding: vendor specific encoding (usually '*') |
|
7417 |
" |
|
2151 | 7418 |
" |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7419 |
Windows 95 allows the creation of a font with the following parameters |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7420 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7421 |
nHeight |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7422 |
nWidth |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7423 |
nEscapement |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7424 |
nOrientation |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7425 |
fnWeight FW_DONTCARE, FW_NORMAL, FW_MEDIUM, FW_BOLD, ... |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7426 |
fdwItalic TRUE or FALSE |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7427 |
fdwUnderline TRUE or FALSE |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7428 |
fdwStrikeOut TRUE or FALSE |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7429 |
fdwCharSet ANSI_CHARSET, UNICODE_, SYMBOL_, SHIFTJIS_,... |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7430 |
fdwOutputPrecision DEFAULT, STRING, CHAR, ... |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7431 |
fdwClipPrecision DEFAULT, CHAR, STROKE, MASK, ... |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7432 |
fdwQuality DEFAULT, DRAFT, or PROOF. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7433 |
fdwPitchAndFamily |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7434 |
DEFAULT, FIXED or VARIABLE pitch |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7435 |
DECORATIVE, DONTCASE, MODERN, ROMAN, SCRIPT, or SWISS. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7436 |
lpszFace |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7437 |
Typeface Name |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7438 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7439 |
These two above descriptions will be matched as follows: |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7440 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7441 |
foundry - ignored |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7442 |
family - mapped to type face name. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7443 |
weight - mapped to fnWeight |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7444 |
slant - NOT USED INITIALLY user for style |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7445 |
spacing - NOT USED INITIALLY |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7446 |
pixelSize - NOT USED INITIALLY |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7447 |
size - mapped to nHeight |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7448 |
registry - NOT USED INITIALLY |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7449 |
encoding - NOT USED INITIALLY used for dwType device, raster or truetype |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7450 |
" |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7451 |
|
2232 | 7452 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7453 |
HGDIOBJ hFont; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7454 |
int nHeight, nWidth, nEscapement, nOrientation; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7455 |
char* work; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7456 |
char* work2; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7457 |
DWORD fnWeight; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7458 |
DWORD fdwItalic; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7459 |
DWORD fdwUnderline; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7460 |
DWORD fdwStrikeOut; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7461 |
DWORD fdwCharSet; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7462 |
DWORD fdwOutputPrecision; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7463 |
DWORD fdwClipPrecision; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7464 |
DWORD fdwQuality; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7465 |
DWORD fdwPitchAndFamily; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7466 |
LPCTSTR lpszFace; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7467 |
static char temp[33]; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7468 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7469 |
/* INITIALIZE */ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7470 |
strcpy( temp, " " ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7471 |
lpszFace = &temp[0]; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7472 |
strcpy( (char *)lpszFace, "NULL" ); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7473 |
nHeight = 0; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7474 |
nWidth = 0; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7475 |
nEscapement = 0; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7476 |
nOrientation = 0; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7477 |
fnWeight = FW_NORMAL; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7478 |
fdwItalic = FALSE; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7479 |
fdwUnderline = FALSE; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7480 |
fdwStrikeOut = FALSE; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7481 |
fdwCharSet = ANSI_CHARSET; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7482 |
fdwOutputPrecision = OUT_DEFAULT_PRECIS; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7483 |
fdwClipPrecision = CLIP_DEFAULT_PRECIS; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7484 |
fdwQuality = DEFAULT_QUALITY; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7485 |
fdwPitchAndFamily = FF_DONTCARE; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7486 |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7487 |
/* SET VALUES */ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7488 |
if ( __isString( family ) ) { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7489 |
work = __stringVal( family ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7490 |
if ( strcmp( work, "nil" ) != 0 ) { |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7491 |
strncpy( (char *)lpszFace, work, 32 ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7492 |
} |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7493 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7494 |
if( __isString( weight ) ) { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7495 |
work = __stringVal( weight ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7496 |
if( strcmp( work, "bold" ) == 0 ) { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7497 |
fnWeight = FW_BOLD; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7498 |
} else { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7499 |
if( strcmp( work, "medium" ) == 0 ) { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7500 |
fnWeight = FW_MEDIUM; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7501 |
} else { |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7502 |
if( strcmp( work, "demi" ) == 0 ) |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7503 |
fnWeight = FW_LIGHT; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7504 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7505 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7506 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7507 |
if(__isSmallInteger( size ) ) |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7508 |
{ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7509 |
nHeight = __intVal( size ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7510 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7511 |
work2 = __stringVal( slant ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7512 |
work = __stringVal( slant ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7513 |
if( strncmp( work2, "italic", 6 ) == 0 ) |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7514 |
{ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7515 |
fdwItalic = TRUE; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7516 |
if( work2[6] = '-' ) |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7517 |
strncpy( work, &work2[7], ( strlen( work2 ) - 7 ) ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7518 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7519 |
if( strncmp( work, "underline", 9 ) == 0 ) |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7520 |
{ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7521 |
fdwUnderline = TRUE; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7522 |
if( work[10] == '-' ) |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7523 |
strncpy( work2, &work[11], ( strlen( work ) - 10 ) ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7524 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7525 |
if( strncmp( work2, "strikeOut", 9 ) == 0 ) |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7526 |
fdwStrikeOut = TRUE; |
2232 | 7527 |
nHeight = -MulDiv(nHeight, __logPixelSY, 72); |
7528 |
||
7529 |
DPRINTF(("CreateFont %s h=%d\n",lpszFace,nHeight)); |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7530 |
hFont = CreateFont( nHeight, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7531 |
nWidth, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7532 |
nEscapement, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7533 |
nOrientation, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7534 |
fnWeight, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7535 |
fdwItalic, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7536 |
fdwUnderline, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7537 |
fdwStrikeOut, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7538 |
fdwCharSet, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7539 |
fdwOutputPrecision, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7540 |
fdwClipPrecision, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7541 |
fdwQuality, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7542 |
fdwPitchAndFamily, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7543 |
lpszFace ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7544 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7545 |
if( hFont != NULL ) |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7546 |
{ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7547 |
DPRINTF(("createFontWithFoundry: %x\n", hFont)); |
2232 | 7548 |
#ifdef COUNT_RESOURCES |
7549 |
__cnt_font++; |
|
7550 |
RES1PRINTF(("CreateFont %d\n",__cnt_font)); |
|
7551 |
#endif |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7552 |
RETURN ( __MKOBJ(hFont) ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7553 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7554 |
DPRINTF(("***** ERROR createFontWithFoundry failed ERROR *****\n" )); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7555 |
%}. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7556 |
^ nil |
1127 | 7557 |
|
7558 |
" |
|
7559 |
Display getFontWithFoundry:'*' |
|
7560 |
family:'courier' |
|
7561 |
weight:'medium' |
|
7562 |
slant:'r' |
|
7563 |
spacing:nil |
|
7564 |
pixelSize:nil |
|
7565 |
size:13 |
|
7566 |
registry:'iso8859' |
|
7567 |
encoding:'*' |
|
7568 |
" |
|
7569 |
||
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7570 |
"new NT Version: 20.2.1997 / 22:33:29 / dq" |
2232 | 7571 |
! |
7572 |
||
1127 | 7573 |
listOfAvailableFonts |
7574 |
"return a list with all available fonts on this display. |
|
7575 |
Since this takes a long time, keep the result of the query for the |
|
7576 |
next time. The elements of the returned collection are instances of |
|
7577 |
FontDescription." |
|
7578 |
||
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7579 |
|list typeFaceList| |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7580 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7581 |
listOfFonts notNil ifTrue:[^ listOfFonts]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7582 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7583 |
list := OrderedCollection new. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7584 |
typeFaceList := OrderedCollection new. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7585 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7586 |
[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7587 |
self primEnumFontTypesInto:typeFaceList. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7588 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7589 |
"/Transcript showCR:typeFaceList. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7590 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7591 |
typeFaceList do:[:typeFace | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7592 |
self primEnumFontsIn:typeFace into:list. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7593 |
0 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7594 |
]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7595 |
] valueUninterruptably. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7596 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7597 |
"/Transcript showCR:list. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7598 |
listOfFonts := list |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7599 |
collect:[:anArray | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7600 |
| fntDescr family face style size encoding | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7601 |
family := anArray at:14. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7602 |
face := anArray at:5. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7603 |
style := anArray at:16. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7604 |
size := anArray at:1. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7605 |
encoding := anArray at:15. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7606 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7607 |
fntDescr := FontDescription |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7608 |
family:family |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7609 |
face:face |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7610 |
style:style |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7611 |
size:size |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7612 |
encoding:encoding. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7613 |
fntDescr |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7614 |
]. |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7615 |
|
1127 | 7616 |
^ listOfFonts |
7617 |
||
7618 |
" |
|
7619 |
Display listOfAvailableFonts. |
|
7620 |
||
7621 |
Display getAvailableFontsMatching:'*'. |
|
7622 |
" |
|
7623 |
||
7624 |
"Modified: 27.9.1995 / 10:54:47 / stefan" |
|
7625 |
"Modified: 17.4.1996 / 15:27:57 / cg" |
|
2232 | 7626 |
! |
7627 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7628 |
primEnumFontTypesInto:typeFaceList |
2232 | 7629 |
%{ /* xxLIMITEDSTACK (WIN95) */ |
2151 | 7630 |
if (tmpDC) |
7631 |
{ |
|
7632 |
if ( EnumFontFamilies( tmpDC, NULL, EnumFPTypeFaceProc, (DWORD)&(typeFaceList))) { |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7633 |
DPRINTF(("EnumFonts successful\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7634 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7635 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7636 |
%} |
2232 | 7637 |
! |
7638 |
||
2151 | 7639 |
primEnumFontsIn:typeFace into:fontList |
2232 | 7640 |
%{ /* xxLIMITEDSTACK (WIN95) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7641 |
char *cp; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7642 |
|
2151 | 7643 |
if (__isString(typeFace)) |
7644 |
{ |
|
7645 |
if (tmpDC) { |
|
7646 |
if (EnumFontFamilies(tmpDC, __stringVal(typeFace), EnumFontsProc, (DWORD)&(fontList))) { |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7647 |
DPRINTF(("EnumFonts Successful\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7648 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7649 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7650 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7651 |
%}. |
2232 | 7652 |
! |
7653 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7654 |
primFontMetricsOf:fontId intoArray:data |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7655 |
"evaluate aBlock, passing a fonts metrics as arguments" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7656 |
|
2232 | 7657 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
7658 |
||
7659 |
if (__isExternalAddress(fontId)) |
|
7660 |
{ |
|
7661 |
SIZE size; |
|
7662 |
int avgWidth; |
|
7663 |
HGDIOBJ hFont; |
|
7664 |
HGDIOBJ prevFont; |
|
7665 |
TEXTMETRIC tmet; |
|
7666 |
int len; |
|
7667 |
hFont = _HGDIOBJVal(fontId); |
|
7668 |
/* |
|
7669 |
* temporarily set this font in the root context |
|
7670 |
*/ |
|
7671 |
prevFont = SelectObject(tmpDC, hFont); |
|
7672 |
GetTextMetrics(tmpDC, &tmet); |
|
7673 |
GetTextExtentPoint32(tmpDC,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrst" |
|
7674 |
"uvwxyz",52,&size); |
|
7675 |
SelectObject(tmpDC, prevFont); |
|
7676 |
avgWidth = (size.cx/26+1)/2; |
|
7677 |
||
7678 |
__ArrayInstPtr(data)->a_element[0] = __MKSMALLINT(tmet.tmAscent); |
|
7679 |
__ArrayInstPtr(data)->a_element[1] = __MKSMALLINT(tmet.tmDescent); |
|
7680 |
__ArrayInstPtr(data)->a_element[2] = __MKSMALLINT(tmet.tmAscent); |
|
7681 |
__ArrayInstPtr(data)->a_element[3] = __MKSMALLINT(tmet.tmDescent); |
|
7682 |
__ArrayInstPtr(data)->a_element[4] = __MKSMALLINT(avgWidth); |
|
7683 |
__ArrayInstPtr(data)->a_element[5] = __MKSMALLINT(tmet.tmMaxCharWidth); |
|
7684 |
__ArrayInstPtr(data)->a_element[6] = __MKSMALLINT(avgWidth); |
|
7685 |
DPRINTF(("textMetrics h=%x avgAsc=%d avgDesc=%d minW=%d maxW=%d avgW=%d\n", |
|
7686 |
hFont, tmet.tmAscent, tmet.tmDescent, avgWidth, tmet.tmMaxCharWidth, |
|
7687 |
tmet.tmAveCharWidth)); |
|
7688 |
RETURN (self); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7689 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7690 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7691 |
%} |
2232 | 7692 |
! |
7693 |
||
1127 | 7694 |
releaseFont:aFontId |
7695 |
||
2232 | 7696 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7697 |
if (__isExternalAddress(aFontId)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7698 |
HGDIOBJ hFont = _HGDIOBJVal(aFontId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7699 |
if (hFont) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7700 |
{ |
2232 | 7701 |
#ifdef COUNT_RESOURCES |
7702 |
__cnt_font--; |
|
7703 |
RES1PRINTF(("DestroyFont %d\n",__cnt_font)); |
|
7704 |
#endif |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7705 |
DelObject(hFont); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7706 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7707 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7708 |
%} |
2232 | 7709 |
! |
7710 |
||
1127 | 7711 |
sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter |
7712 |
"return a set of all available font sizes in aFamily/aFace/aStyle |
|
7713 |
on this display. |
|
7714 |
Redefined to handle X's special case of 0-size (which stands for any)" |
|
7715 |
||
7716 |
|sizes| |
|
7717 |
||
7718 |
sizes := super sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter. |
|
7719 |
(sizes notNil and:[sizes includes:0]) ifTrue:[ |
|
7720 |
"special: in X11R5 and above, size 0 means: |
|
7721 |
there are scaled versions in all sizes available" |
|
7722 |
||
7723 |
^ #(4 5 6 7 8 9 10 11 12 14 16 18 20 22 24 28 32 48 64) |
|
7724 |
]. |
|
7725 |
^ sizes |
|
7726 |
||
7727 |
" |
|
7728 |
Display sizesInFamily:'courier' face:'bold' style:'roman' |
|
7729 |
" |
|
7730 |
||
7731 |
"Created: 27.2.1996 / 01:38:15 / cg" |
|
2232 | 7732 |
! |
7733 |
||
1127 | 7734 |
widthOf:aString from:index1 to:index2 inFont:aFontId |
7735 |
||
2232 | 7736 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 7737 |
char *cp; |
7738 |
int len, n, i1, i2, l; |
|
7739 |
OBJ cls; |
|
7740 |
int nInstBytes; |
|
7741 |
||
7742 |
if (__bothSmallInteger(index1, index2) |
|
7743 |
&& __isExternalAddress(aFontId) |
|
7744 |
&& __isNonNilObject(aString)) { |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7745 |
HGDIOBJ hFont,prevFont; |
1127 | 7746 |
SIZE tsize; |
7747 |
||
7748 |
hFont = _HGDIOBJVal(aFontId); |
|
7749 |
||
7750 |
i1 = __intVal(index1) - 1; |
|
7751 |
cls = __qClass(aString); |
|
7752 |
||
7753 |
if (i1 >= 0) { |
|
7754 |
i2 = __intVal(index2) - 1; |
|
7755 |
if (i2 < i1) { |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7756 |
RETURN ( __MKSMALLINT( 0 ) ); |
1127 | 7757 |
} |
7758 |
||
7759 |
cp = (char *) _stringVal(aString); |
|
7760 |
l = i2 - i1 + 1; |
|
7761 |
||
7762 |
if ((cls == @global(String)) || (cls == @global(Symbol))) { |
|
7763 |
n = _stringSize(aString); |
|
2151 | 7764 |
if (i2 < n) |
7765 |
{ |
|
1127 | 7766 |
cp += i1; |
7767 |
||
2151 | 7768 |
prevFont = SelectObject(tmpDC, hFont); |
7769 |
GetTextExtentPoint32(tmpDC, cp, l, &tsize); |
|
2253 | 7770 |
#ifdef xxDEBUG |
2151 | 7771 |
if (__debug__) |
7772 |
{ |
|
7773 |
char buf[80]; |
|
7774 |
GetTextFace(tmpDC,80,buf); |
|
7775 |
printf("font1 %x %s >%s< l=%d dx=%d\n",hFont,buf,cp,l,tsize.cx); |
|
7776 |
} |
|
7777 |
#endif |
|
7778 |
SelectObject(tmpDC, prevFont); |
|
1127 | 7779 |
RETURN ( __MKSMALLINT(tsize.cx) ); |
7780 |
} |
|
7781 |
} |
|
7782 |
||
7783 |
nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars)); |
|
7784 |
cp += nInstBytes; |
|
7785 |
||
7786 |
if (__isBytes(aString)) { |
|
7787 |
n = __byteArraySize(aString) - nInstBytes; |
|
2151 | 7788 |
if (i2 < n) |
7789 |
{ |
|
1127 | 7790 |
cp += i1; |
7791 |
||
2151 | 7792 |
prevFont = SelectObject(tmpDC, hFont); |
7793 |
GetTextExtentPoint32(tmpDC, cp, l, &tsize); |
|
2253 | 7794 |
#ifdef xxDEBUG |
2151 | 7795 |
if (__debug__) |
7796 |
{ |
|
7797 |
char buf[80]; |
|
7798 |
GetTextFace(tmpDC,80,buf); |
|
7799 |
printf("font1 %x %s >%s< l=%d dx=%d\n",hFont,buf,cp,l,tsize.cx); |
|
7800 |
} |
|
7801 |
#endif |
|
7802 |
SelectObject(tmpDC, prevFont); |
|
1127 | 7803 |
RETURN ( __MKSMALLINT(tsize.cx) ); |
7804 |
} |
|
7805 |
} |
|
7806 |
} |
|
7807 |
} |
|
7808 |
#undef NLOCALBUFFER |
|
7809 |
%}. |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7810 |
"/ 'no stringlen' printCR. |
1127 | 7811 |
^ nil |
2232 | 7812 |
! ! |
7813 |
||
7814 |
!WinWorkstation methodsFor:'grabbing '! |
|
7815 |
||
1127 | 7816 |
allowEvents:mode |
2232 | 7817 |
! |
7818 |
||
1127 | 7819 |
grabKeyboardIn:aWindowId |
7820 |
"grab the keyboard" |
|
2232 | 7821 |
%{ |
7822 |
if (__isExternalAddress(aWindowId)) |
|
7823 |
{ |
|
7824 |
HWND hWnd = _HWNDVal(aWindowId); |
|
7825 |
CPRINTF(("grabKeyboard in %x\n",hWnd)); |
|
7826 |
} |
|
7827 |
%} |
|
7828 |
||
7829 |
! |
|
7830 |
||
1127 | 7831 |
grabPointerIn:aWindowId withCursor:aCursorId pointerMode:pMode keyboardMode:kMode confineTo:confineId |
7832 |
"grap the pointer - return true if ok" |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7833 |
|
2232 | 7834 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 7835 |
if (__isExternalAddress(aWindowId)) { |
7836 |
HWND hWnd = _HWNDVal(aWindowId); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7837 |
{ |
2244 | 7838 |
HCURSOR hCursor = 0; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7839 |
if (currentCapture != CAPTURE_NONE) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7840 |
{ |
2244 | 7841 |
PostMessage(currentPointerView,WM_THREADSETCAPTURE,0,0); |
2232 | 7842 |
//ReleaseCapture(); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7843 |
} |
2232 | 7844 |
#if 1 |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7845 |
if (hWnd == __rootWin) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7846 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7847 |
hWnd = __rootWinSpezial; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7848 |
ShowWindow(hWnd,SW_SHOWNOACTIVATE); |
2260 | 7849 |
//EnableWindow(hWnd,TRUE); |
2253 | 7850 |
SetWindowPos(hWnd, HWND_TOP, |
2260 | 7851 |
0, 0, 0, 0,SWP_NOREDRAW|SWP_NOSENDCHANGING|SWP_NOCOPYBITS |
7852 |
|SWP_NOACTIVATE |SWP_NOMOVE|SWP_NOSIZE); |
|
2232 | 7853 |
CPRINTF(("setRootCapture %x\n",hWnd)); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7854 |
} |
2232 | 7855 |
#endif |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7856 |
if (__isExternalAddress(aCursorId)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7857 |
{ |
2232 | 7858 |
hCursor = _HCURSORVal(aCursorId); |
7859 |
} |
|
2244 | 7860 |
CPRINTF(("grabPointerIn SetCapture %x\n",hWnd)); |
7861 |
PostMessage(hWnd,WM_THREADSETCAPTURE,(INT)hWnd,(INT)hCursor); |
|
2232 | 7862 |
if (__isExternalAddress(aCursorId)) |
7863 |
{ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7864 |
RETURN ( self ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7865 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7866 |
} |
1127 | 7867 |
} |
7868 |
%}. |
|
7869 |
^ true |
|
2232 | 7870 |
! |
7871 |
||
1127 | 7872 |
ungrabKeyboard |
7873 |
"release the keyboard" |
|
7874 |
||
2232 | 7875 |
activeKeyboardGrab := nil. |
7876 |
%{ |
|
7877 |
CPRINTF(("ungrabKeyboard\n")); |
|
7878 |
%} |
|
7879 |
! |
|
7880 |
||
1127 | 7881 |
ungrabPointer |
7882 |
"release the pointer" |
|
7883 |
||
2232 | 7884 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
7885 |
CPRINTF(("ungrabPointer 1\n")); |
|
7886 |
PostThreadMessage(_dispatchThreadId,WM_THREADSETCAPTURE,0,0); |
|
1127 | 7887 |
%}. |
7888 |
activePointerGrab := nil |
|
2232 | 7889 |
! ! |
7890 |
||
7891 |
!WinWorkstation methodsFor:'graphic context stuff'! |
|
7892 |
||
1723 | 7893 |
noClipIn:aWindowId gc:aGCId |
1127 | 7894 |
"disable clipping rectangle" |
7895 |
||
2232 | 7896 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7897 |
|
1723 | 7898 |
if (__isExternalAddress(aWindowId) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7899 |
&& __isExternalAddress(aGCId)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7900 |
{ |
1723 | 7901 |
struct gcData *gcData = _GCDATA(aGCId); |
2232 | 7902 |
gcData->clipping = FALSE; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7903 |
RETURN (self); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7904 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7905 |
%} |
2232 | 7906 |
! |
7907 |
||
1127 | 7908 |
setBackground:bgColorIndex in:aGCId |
7909 |
"set background color to be drawn with" |
|
7910 |
||
2232 | 7911 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 7912 |
|
7913 |
HDC hDC; |
|
7914 |
||
7915 |
if (__isExternalAddress(aGCId)) { |
|
7916 |
struct gcData *gcData = _GCDATA(aGCId); |
|
7917 |
COLORREF bgColor; |
|
7918 |
||
2232 | 7919 |
//hDC = _getDC(gcData); |
2151 | 7920 |
bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData); |
1127 | 7921 |
if (bgColor != gcData->bgColor) { |
7922 |
gcData->bgColor = bgColor; |
|
2251
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
7923 |
// SetBkColor(hDC, bgColor); |
1127 | 7924 |
} |
7925 |
||
7926 |
DPRINTF(("setBackground: %x\n", bgColor)); |
|
2232 | 7927 |
//_releaseDC(gcData); |
1127 | 7928 |
RETURN (self); |
7929 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7930 |
%} |
2232 | 7931 |
! |
7932 |
||
1127 | 7933 |
setBitmapMask:aBitmapId in:aGCId |
7934 |
"set or clear the drawing mask - a bitmap mask using current fg/bg" |
|
7935 |
||
2232 | 7936 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 7937 |
|
2327 | 7938 |
if (__isExternalAddress(aGCId)) { |
2151 | 7939 |
struct gcData *gcData = _GCDATA(aGCId); |
2327 | 7940 |
|
2151 | 7941 |
if (__isExternalAddress(aBitmapId)) |
2327 | 7942 |
gcData->hMask = _HBITMAPVAL(aBitmapId); |
2151 | 7943 |
else |
2327 | 7944 |
gcData->hMask = 0; |
2151 | 7945 |
|
7946 |
DPRINTF(("masks set to %x\n",gcData->hMask)); |
|
1127 | 7947 |
RETURN (self); |
7948 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7949 |
%} |
2232 | 7950 |
! |
7951 |
||
1685 | 7952 |
setClipByChildren:aBool in:aWindowId gc:aGCId |
1127 | 7953 |
"enable/disable drawing into child views" |
7954 |
||
2232 | 7955 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7956 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7957 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7958 |
if (ISCONNECTED && __isExternalAddress(aGCId)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7959 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7960 |
struct gcData *gcData = _GCDATA(aGCId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7961 |
if (gcData && gcData->hWnd) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7962 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7963 |
if( aBool == true ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7964 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7965 |
/* set clip by child */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7966 |
if (gcData->hWnd) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7967 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7968 |
gcData->clipByChild = TRUE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7969 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7970 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7971 |
} else { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7972 |
if (gcData->hWnd) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7973 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7974 |
gcData->clipByChild = FALSE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7975 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7976 |
} |
1685 | 7977 |
} else { |
7978 |
DPRINTF(("clipping by child failed - invalid win\n" )); |
|
7979 |
} |
|
7980 |
} |
|
1127 | 7981 |
%}. |
1723 | 7982 |
^ self |
2232 | 7983 |
! |
7984 |
||
1723 | 7985 |
setClipX:clipX y:clipY width:clipWidth height:clipHeight in:aDrawableId gc:aGCId |
1127 | 7986 |
"clip to a rectangle" |
7987 |
||
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
7988 |
" |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
7989 |
p--w--- |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
7990 |
| | |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
7991 |
h | the clipping rectangle |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
7992 |
| | |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
7993 |
------- |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
7994 |
where p = ( clipX, clipY ), w = clipWidth, h = clipHeight |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
7995 |
" |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
7996 |
|
2232 | 7997 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7998 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7999 |
/*RETURN (self);*/ |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
8000 |
if ( __isExternalAddress(aGCId) |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
8001 |
&& __bothSmallInteger(clipX, clipY) |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
8002 |
&& __bothSmallInteger(clipWidth, clipHeight) ) { |
1723 | 8003 |
struct gcData *gcData = _GCDATA(aGCId); |
2232 | 8004 |
gcData->clipping = TRUE; |
8005 |
gcData->clipX = __intVal(clipX); |
|
8006 |
gcData->clipY = __intVal(clipY); |
|
8007 |
gcData->clipW = __intVal(clipWidth); |
|
8008 |
gcData->clipH = __intVal(clipHeight); |
|
1127 | 8009 |
RETURN (self); |
8010 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8011 |
%} |
2232 | 8012 |
! |
8013 |
||
1127 | 8014 |
setDashes:dashList dashOffset:offset in:aGCId |
8015 |
"set line attributes" |
|
8016 |
||
2232 | 8017 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 8018 |
|
8019 |
if (__isExternalAddress(aGCId)) { |
|
2232 | 8020 |
PRINTF(("dashes not yet implemented\n")); |
1127 | 8021 |
RETURN (self); |
8022 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8023 |
%} |
2232 | 8024 |
! |
8025 |
||
1127 | 8026 |
setFont:aFontId in:aGCId |
8027 |
"set font to be drawn in" |
|
8028 |
||
2232 | 8029 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 8030 |
|
8031 |
if (__isExternalAddress(aGCId) |
|
2151 | 8032 |
&& __isExternalAddress(aFontId)) |
8033 |
{ |
|
1127 | 8034 |
struct gcData *gcData = _GCDATA(aGCId); |
8035 |
HDC hDC; |
|
8036 |
HGDIOBJ hFont; |
|
8037 |
TEXTMETRIC tmet; |
|
8038 |
||
2232 | 8039 |
hDC = _getDC(gcData); |
1127 | 8040 |
hFont = _HGDIOBJVal(aFontId); |
2232 | 8041 |
gcData->hFont = hFont; |
8042 |
hFont = SelectObject(hDC, hFont); |
|
1127 | 8043 |
GetTextMetrics(hDC, &tmet); |
8044 |
gcData->fontAscent = tmet.tmAscent; |
|
2151 | 8045 |
#ifdef DEBUG |
8046 |
if (__debug__) |
|
8047 |
{ |
|
8048 |
char buf[80]; |
|
8049 |
GetTextFace(hDC,80,buf); |
|
8050 |
PRINTF(("setFont: %x %s\n", hFont,buf)); |
|
8051 |
} |
|
8052 |
#endif |
|
2232 | 8053 |
SelectObject(hDC, hFont); |
8054 |
_releaseDC(gcData); |
|
1127 | 8055 |
RETURN ( self ); |
8056 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8057 |
%} |
2232 | 8058 |
! |
8059 |
||
1127 | 8060 |
setForeground:fgColorIndex background:bgColorIndex in:aGCId |
8061 |
"set foreground and background colors to be drawn with" |
|
8062 |
||
2232 | 8063 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 8064 |
|
2327 | 8065 |
if (__isExternalAddress(aGCId)) { |
1127 | 8066 |
struct gcData *gcData = _GCDATA(aGCId); |
2327 | 8067 |
|
2232 | 8068 |
gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData); |
8069 |
gcData->bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData); |
|
2264 | 8070 |
DDPRINTF(("setForeground: %x background: %x\n", gcData->fgColor, gcData->bgColor)); |
1127 | 8071 |
RETURN (self); |
8072 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8073 |
%} |
2232 | 8074 |
! |
8075 |
||
1127 | 8076 |
setForeground:fgColorIndex background:bgColorIndex mask:aBitmapId in:aGCId |
8077 |
"set foreground and background colors to be drawn with using mask or |
|
8078 |
solid (if aBitmapId is nil)" |
|
8079 |
||
2232 | 8080 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8081 |
|
2327 | 8082 |
if (__isExternalAddress(aGCId)) { |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8083 |
struct gcData *gcData = _GCDATA(aGCId); |
2327 | 8084 |
|
2232 | 8085 |
gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData); |
8086 |
gcData->bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData); |
|
2151 | 8087 |
if (__isExternalAddress(aBitmapId)) |
2327 | 8088 |
gcData->hMask = _HBITMAPVAL(aBitmapId); |
2151 | 8089 |
else |
2327 | 8090 |
gcData->hMask = 0; |
2264 | 8091 |
DDPRINTF(("setForeground: %x background: %x mask: %x\n", gcData->fgColor, gcData->bgColor,gcData->hMask)); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8092 |
RETURN (self); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8093 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8094 |
%} |
2232 | 8095 |
! |
8096 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8097 |
setForeground:fgColorIndex background:bgColorIndex mask:aBitmapId lineWidth:lw in:aGCId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8098 |
"set foreground and background colors to be drawn with using mask or |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8099 |
solid (if aBitmapId is nil); also set lineWidth" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8100 |
|
2232 | 8101 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 8102 |
|
2327 | 8103 |
if (__isExternalAddress(aGCId)) { |
1127 | 8104 |
struct gcData *gcData = _GCDATA(aGCId); |
2327 | 8105 |
|
2232 | 8106 |
gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData); |
8107 |
gcData->bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData); |
|
8108 |
gcData->lineWidth = __intVal(lw); |
|
2151 | 8109 |
if (__isExternalAddress(aBitmapId)) |
2327 | 8110 |
gcData->hMask = _HBITMAPVAL(aBitmapId); |
2151 | 8111 |
else |
2327 | 8112 |
gcData->hMask = 0; |
2264 | 8113 |
DDPRINTF(("setForeground: %x background: %x mask: %x linewidth: %d\n", gcData->fgColor, gcData->bgColor,gcData->hMask,gcData->lineWidth)); |
1127 | 8114 |
RETURN (self); |
8115 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8116 |
%} |
2232 | 8117 |
! |
8118 |
||
1127 | 8119 |
setForeground:fgColorIndex in:aGCId |
8120 |
"set foreground color to be drawn with" |
|
8121 |
||
2232 | 8122 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 8123 |
|
8124 |
HDC hDC; |
|
8125 |
||
2327 | 8126 |
if (__isExternalAddress(aGCId)) { |
1127 | 8127 |
struct gcData *gcData = _GCDATA(aGCId); |
2327 | 8128 |
|
2232 | 8129 |
gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData); |
2264 | 8130 |
DDPRINTF(("setForeground: %x\n", gcData->fgColor)); |
1127 | 8131 |
RETURN (self); |
8132 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8133 |
%} |
2232 | 8134 |
! |
8135 |
||
1127 | 8136 |
setFunction:aFunctionSymbol in:aGCId |
8137 |
"set alu function to be drawn with" |
|
8138 |
||
2232 | 8139 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
8140 |
||
8141 |
||
2327 | 8142 |
if (__isExternalAddress(aGCId)) { |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8143 |
struct gcData *gcData = _GCDATA(aGCId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8144 |
int fun = -1; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8145 |
int bfun = -1; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8146 |
|
2327 | 8147 |
if (aFunctionSymbol == @symbol(copy)) { |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8148 |
fun = R2_COPYPEN; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8149 |
bfun = BITBLT_COPY; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8150 |
} |
2327 | 8151 |
else if (aFunctionSymbol == @symbol(copyInverted)) { |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8152 |
fun = R2_NOTCOPYPEN; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8153 |
bfun = BITBLT_COPYINVERTED; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8154 |
} |
2327 | 8155 |
else if (aFunctionSymbol == @symbol(xor)) { |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8156 |
fun = R2_XORPEN; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8157 |
bfun = BITBLT_XOR; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8158 |
} |
2327 | 8159 |
else if (aFunctionSymbol == @symbol(and)) { |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8160 |
fun = R2_MASKPEN; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8161 |
bfun = BITBLT_AND; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8162 |
} |
2327 | 8163 |
else if (aFunctionSymbol == @symbol(or)) { |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8164 |
fun = R2_MERGEPEN; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8165 |
bfun = BITBLT_OR; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8166 |
} |
2327 | 8167 |
if (fun != -1) { |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8168 |
#if 0 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8169 |
printf("set func to"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8170 |
switch (bfun) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8171 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8172 |
case BITBLT_COPY: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8173 |
printf("BITBLT_COPY\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8174 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8175 |
case BITBLT_COPYINVERTED: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8176 |
printf("BITBLT_COPYINVERTED\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8177 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8178 |
case BITBLT_XOR: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8179 |
printf("BITBLT_XOR\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8180 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8181 |
case BITBLT_AND: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8182 |
printf("BITBLT_AND\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8183 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8184 |
case BITBLT_OR: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8185 |
printf("BITBLT_OR\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8186 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8187 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8188 |
#endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8189 |
gcData->rop2 = fun; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8190 |
gcData->bitbltrop2 = bfun; |
1127 | 8191 |
} |
2327 | 8192 |
else { |
8193 |
if (@global(InfoPrinting) == true) { |
|
2329 | 8194 |
__win32_fprintf(stderr, "WinWorkstat [warning]: unsuported Rasterfunction\n"); |
2327 | 8195 |
} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8196 |
gcData->rop2 = R2_COPYPEN; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8197 |
gcData->bitbltrop2 = BITBLT_COPY; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8198 |
} |
1127 | 8199 |
RETURN (self); |
8200 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8201 |
else |
2327 | 8202 |
printf("Rasterfunction no GC\n"); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8203 |
%} |
2232 | 8204 |
! |
8205 |
||
1127 | 8206 |
setGraphicsExposures:aBoolean in:aGCId |
8207 |
"set or clear the graphics exposures flag" |
|
8208 |
||
2232 | 8209 |
! |
8210 |
||
1127 | 8211 |
setLineWidth:aNumber style:lineStyle cap:capStyle join:joinStyle in:aGCId |
8212 |
"set line attributes" |
|
8213 |
||
2232 | 8214 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 8215 |
|
8216 |
HDC hDC; |
|
8217 |
||
8218 |
if (__isExternalAddress(aGCId) |
|
8219 |
&& __isSmallInteger(aNumber)) { |
|
8220 |
struct gcData *gcData = _GCDATA(aGCId); |
|
8221 |
||
8222 |
gcData->lineWidth = __intVal(aNumber); |
|
8223 |
if (lineStyle == @symbol(solid)) { |
|
8224 |
gcData->lineStyle = PS_SOLID; |
|
8225 |
} else if (lineStyle == @symbol(dashed)) { |
|
2232 | 8226 |
gcData->lineStyle = PS_DASH; |
1127 | 8227 |
} else |
2151 | 8228 |
gcData->lineStyle = PS_SOLID; |
1127 | 8229 |
|
8230 |
if (capStyle == @symbol(round)) { |
|
8231 |
gcData->capStyle = PS_ENDCAP_ROUND; |
|
8232 |
} else if (capStyle == @symbol(square)) { |
|
8233 |
gcData->capStyle = PS_ENDCAP_SQUARE; |
|
8234 |
} else if (capStyle == @symbol(flat)) { |
|
8235 |
gcData->capStyle = PS_ENDCAP_FLAT; |
|
8236 |
} else |
|
8237 |
gcData->capStyle = PS_ENDCAP_FLAT; |
|
8238 |
||
8239 |
if (joinStyle == @symbol(bevel)) { |
|
8240 |
gcData->joinStyle = PS_JOIN_BEVEL; |
|
8241 |
} else if (joinStyle == @symbol(miter)) { |
|
8242 |
gcData->joinStyle = PS_JOIN_MITER; |
|
8243 |
} else if (joinStyle == @symbol(round)) { |
|
8244 |
gcData->joinStyle = PS_JOIN_ROUND; |
|
8245 |
} else |
|
8246 |
gcData->joinStyle = PS_JOIN_MITER; |
|
8247 |
||
8248 |
RETURN (self); |
|
8249 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8250 |
%} |
2232 | 8251 |
! |
8252 |
||
1127 | 8253 |
setMaskOriginX:orgX y:orgY in:aGCId |
8254 |
"set the mask origin" |
|
8255 |
||
2232 | 8256 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
8257 |
||
2327 | 8258 |
if (__isExternalAddress(aGCId)) { |
8259 |
if (__bothSmallInteger(orgX,orgY)) { |
|
8260 |
struct gcData *gcData = _GCDATA(aGCId); |
|
8261 |
||
8262 |
gcData->maskOrgX = __intVal(orgX); |
|
8263 |
gcData->maskOrgY = __intVal(orgY);; |
|
8264 |
RETURN (self); |
|
8265 |
} |
|
2232 | 8266 |
} |
8267 |
%} |
|
8268 |
! |
|
8269 |
||
8270 |
setPixmapMask:aPixmapId in:aGCId |
|
8271 |
"set or clear the drawing mask - a pixmap mask providing full color" |
|
8272 |
||
8273 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
|
2327 | 8274 |
if (__isExternalAddress(aGCId)) { |
2232 | 8275 |
struct gcData *gcData = _GCDATA(aGCId); |
2327 | 8276 |
|
2232 | 8277 |
if (__isExternalAddress(aPixmapId)) |
2327 | 8278 |
gcData->hMask = _HBITMAPVAL(aPixmapId); |
2232 | 8279 |
else |
2327 | 8280 |
gcData->hMask = 0; |
2232 | 8281 |
|
8282 |
DPRINTF(("PixmapMasks set to %x\n",gcData->hMask)); |
|
1127 | 8283 |
RETURN (self); |
8284 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8285 |
%} |
2232 | 8286 |
! ! |
8287 |
||
8288 |
!WinWorkstation methodsFor:'initialize / release'! |
|
8289 |
||
1127 | 8290 |
close |
8291 |
"close down the connection to the X-server" |
|
8292 |
||
2232 | 8293 |
! |
8294 |
||
1127 | 8295 |
initializeDefaultValues |
1723 | 8296 |
focusMode := #activeWindow. |
8297 |
||
1127 | 8298 |
buttonTranslation := ButtonTranslation. |
8299 |
multiClickTimeDelta := MultiClickTimeDelta. |
|
8300 |
||
8301 |
self initializeModifierMappings |
|
2232 | 8302 |
! |
8303 |
||
1127 | 8304 |
initializeEventBuffer |
2232 | 8305 |
|sz| |
8306 |
||
8307 |
%{ |
|
8308 |
sz = __MKSMALLINT(sizeof(struct queuedEvent) + 100); |
|
8309 |
%}. |
|
8310 |
eventBuffer isNil ifTrue:[ |
|
8311 |
eventBuffer := ByteArray new:sz. |
|
8312 |
]. |
|
8313 |
! |
|
8314 |
||
1127 | 8315 |
initializeFor:aDisplayName |
8316 |
"initialize the receiver for a connection to an X-Server; |
|
8317 |
the argument, aDisplayName may be nil (for the default server from |
|
2232 | 8318 |
DISPLAY-variable or command line argument) or the name of the server |
1127 | 8319 |
as hostname:number" |
8320 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8321 |
displayId notNil ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8322 |
"/ already connected - trying to trick me ? |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8323 |
^ self |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8324 |
]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8325 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8326 |
displayId := self primInitializeFor:aDisplayName. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8327 |
displayId isNil ifTrue:[^ self]. |
1127 | 8328 |
|
8329 |
dispatching := false. |
|
8330 |
isSlow := false. |
|
8331 |
shiftDown := false. |
|
8332 |
ctrlDown := false. |
|
8333 |
metaDown := false. |
|
8334 |
altDown := false. |
|
8335 |
motionEventCompression := true. |
|
8336 |
buttonsPressed := 0. |
|
8337 |
||
8338 |
self initializeScreenProperties. |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
8339 |
self initializeDeviceResourceTables. |
1127 | 8340 |
|
8341 |
self initializeDefaultValues. |
|
8342 |
self initializeEventBuffer. |
|
8343 |
self initializeSpecialFlags. |
|
8344 |
self initializeKeyboardMap. |
|
2232 | 8345 |
! |
8346 |
||
1127 | 8347 |
initializeModifierMappings |
8348 |
shiftModifiers := #(#'Shift_L' #'Shift_R' #'Shift'). |
|
8349 |
ctrlModifiers := #(#'Ctrl_L' #'Ctrl_R' #'Ctrl'). |
|
8350 |
metaModifiers := #(#'Alt_L' #'Alt'). |
|
8351 |
altModifiers := #(#'Alt_R'). |
|
2232 | 8352 |
! |
8353 |
||
1127 | 8354 |
initializeScreenProperties |
8355 |
super initializeScreenProperties. |
|
8356 |
||
2232 | 8357 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 8358 |
|
8359 |
int scr; |
|
8360 |
int maxRGBDepth; |
|
8361 |
int rgbRedMask, rgbGreenMask, rgbBlueMask; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8362 |
int nvi, i, val, capabilities,__planes,__numcolors,__numpens,__ras; |
1127 | 8363 |
char *type, *nm; |
8364 |
int dummy; |
|
8365 |
int mask, shift, nBits; |
|
8366 |
RECT rect; |
|
8367 |
HDC _rootDC; |
|
8368 |
OBJ id; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8369 |
if (firstInstance) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8370 |
{ |
2232 | 8371 |
OSVERSIONINFO osvi; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8372 |
WNDCLASS wc; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8373 |
firstInstance = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8374 |
DPRINTF(("first create - registerClass\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8375 |
|
2232 | 8376 |
memset(&osvi, 0, sizeof(OSVERSIONINFO)); |
8377 |
osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); |
|
8378 |
GetVersionEx (&osvi); |
|
8379 |
||
8380 |
if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) |
|
8381 |
{ |
|
8382 |
__isWinNT = 1; |
|
8383 |
} |
|
8384 |
else |
|
8385 |
{ |
|
8386 |
__isWinNT = 0; |
|
8387 |
} |
|
8388 |
||
8389 |
wc.style = /* CS_HREDRAW | CS_VREDRAW | CS_OWNDC |*/ CS_DBLCLKS; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8390 |
wc.lpfnWndProc = (WNDPROC) MainWndProc; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8391 |
wc.cbClsExtra = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8392 |
wc.cbWndExtra = N_WINDOW_PRIVATE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8393 |
wc.hInstance = (HANDLE) __getHInstance(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8394 |
wc.hIcon = NULL; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8395 |
wc.hCursor = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8396 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8397 |
wc.hbrBackground = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8398 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8399 |
wc.lpszMenuName = NULL; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8400 |
wc.lpszClassName = app_name; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8401 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8402 |
if (!RegisterClass(&wc)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8403 |
DPRINTF(("RegisterClass failed\n")); |
2151 | 8404 |
/* return NULL; */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8405 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8406 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8407 |
wc.style = 0; |
2253 | 8408 |
wc.lpfnWndProc = (WNDPROC) MainWndProc;// Root; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8409 |
wc.cbClsExtra = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8410 |
wc.cbWndExtra = N_WINDOW_PRIVATE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8411 |
wc.hInstance = (HANDLE) __getHInstance(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8412 |
wc.hIcon = NULL; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8413 |
wc.hCursor = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8414 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8415 |
wc.hbrBackground = GetStockObject(HOLLOW_BRUSH); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8416 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8417 |
wc.lpszMenuName = NULL; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8418 |
wc.lpszClassName = app_nameroot; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8419 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8420 |
if (!RegisterClass(&wc)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8421 |
DPRINTF(("RegisterClass failed\n")); |
2151 | 8422 |
/* return NULL; */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8423 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8424 |
hCreateEvent = CreateEvent( |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8425 |
NULL, /* no security attributes */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8426 |
FALSE, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8427 |
FALSE, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8428 |
THREADEVENTNAME); /* name of mutex */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8429 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8430 |
if (hCreateEvent == NULL) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8431 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8432 |
DPRINTF(("CreateEvent failed\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8433 |
/* return NULL; */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8434 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8435 |
hInputEvent = CreateEvent( |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8436 |
NULL, /* no security attributes */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8437 |
FALSE, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8438 |
FALSE, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8439 |
THREADINPUTEVENTNAME); /* name of mutex */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8440 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8441 |
if (hInputEvent == NULL) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8442 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8443 |
DPRINTF(("InputEvent failed\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8444 |
/* return NULL; */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8445 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8446 |
hdispatchMutex = CreateMutex( |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8447 |
NULL, /* no security attributes */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8448 |
FALSE, /* initially not owned */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8449 |
THREADMUTEXNAME); /* name of mutex */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8450 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8451 |
if (hdispatchMutex == NULL) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8452 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8453 |
DPRINTF(("CreateMutex failed\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8454 |
/* return NULL; */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8455 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8456 |
DuplicateHandle(GetCurrentProcess(),hdispatchMutex,GetCurrentProcess(),&hdispatchMutex,DUPLICATE_SAME_ACCESS,FALSE,DUPLICATE_SAME_ACCESS); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8457 |
|
2232 | 8458 |
/*__setWaitInputEvent(waitInputEvent);*/ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8459 |
bdispatchThreadState = TRUE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8460 |
_masterThreadId = GetCurrentThreadId(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8461 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8462 |
DuplicateHandle(GetCurrentProcess(),GetCurrentThread(),GetCurrentProcess(),&_masterThread,DUPLICATE_SAME_ACCESS,FALSE,DUPLICATE_SAME_ACCESS); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8463 |
|
2244 | 8464 |
initqueue(); |
2284 | 8465 |
__beginthread(dispatchThread, 4096, 0); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8466 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8467 |
DWORD dwWaitResult; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8468 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8469 |
/* Request ownership of mutex. */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8470 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8471 |
dwWaitResult = WaitForSingleObject( |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8472 |
hCreateEvent, /* handle of mutex */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8473 |
5000L); /* time-out interval */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8474 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8475 |
} |
2151 | 8476 |
multiClickTime = GetDoubleClickTime(); |
8477 |
DPRINTF(("multiClickTime = %d\n",multiClickTime)); |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
8478 |
|
2232 | 8479 |
#if 0 |
8480 |
__rootDesk = OpenDesktop ("Desktop0", 0, FALSE, GENERIC_ALL); |
|
8481 |
if (!__rootDesk) |
|
8482 |
{ |
|
8483 |
PRINTF(("OpenDesktop fail\n")); |
|
8484 |
__rootDesk = CreateDesktop ("Desktop0", NULL,NULL,0,DESKTOP_WRITEOBJECTS,NULL); |
|
8485 |
if (!__rootDesk) |
|
8486 |
{ |
|
8487 |
PRINTF(("CreateDesktop fail\n")); |
|
8488 |
} |
|
8489 |
} |
|
8490 |
#endif |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8491 |
__rootWin = GetDesktopWindow(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8492 |
__PROTECT__(self); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8493 |
id = __MKOBJ(__rootWin); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8494 |
__UNPROTECT__(self); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8495 |
__INST(rootWin) = id; __STORE(self, id); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8496 |
|
2232 | 8497 |
_rootDC = CreateDC("DISPLAY", NULL, NULL, NULL); |
2151 | 8498 |
|
8499 |
tmpDC = CreateCompatibleDC(_rootDC); |
|
8500 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8501 |
__PROTECT__(self); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8502 |
id = __MKOBJ(_rootDC); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8503 |
__UNPROTECT__(self); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8504 |
__INST(rootDC) = id; __STORE(self, id); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8505 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8506 |
GetWindowRect(__rootWin, &rect); |
1127 | 8507 |
__INST(width) = __MKSMALLINT(rect.right-rect.left); |
8508 |
__INST(height) = __MKSMALLINT(rect.bottom-rect.top); |
|
2151 | 8509 |
DPRINTF(("screen is %d/%d\n", __intVal(__INST(width)), __intVal(__INST(height)))); |
1127 | 8510 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8511 |
__planes = GetDeviceCaps(_rootDC, PLANES); |
2232 | 8512 |
|
8513 |
#ifndef ALWAYSTRUECOLOR |
|
1127 | 8514 |
__depth = GetDeviceCaps(_rootDC, BITSPIXEL); |
2232 | 8515 |
#else |
8516 |
__depth = 24; /* its a hack */ |
|
8517 |
#endif |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8518 |
if (__depth == 15) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8519 |
__depth = 16; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8520 |
|
2232 | 8521 |
#if 0 |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8522 |
__numcolors = GetDeviceCaps(_rootDC, NUMCOLORS); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8523 |
__numpens = GetDeviceCaps(_rootDC, NUMPENS); |
2151 | 8524 |
DPRINTF(("screen has %d planes\n",__planes)); |
8525 |
DPRINTF(("numcolors is %d\n",__numcolors)); |
|
8526 |
DPRINTF(("numpens is %d\n",__numpens)); |
|
2232 | 8527 |
#endif |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8528 |
__ras = GetDeviceCaps(_rootDC, RASTERCAPS); |
2151 | 8529 |
#if 0 |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8530 |
printf("device support:\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8531 |
if (__ras & RC_BANDING) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8532 |
printf(" RC_BANDING"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8533 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8534 |
if (__ras & RC_BITBLT) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8535 |
printf(" RC_BITBLT"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8536 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8537 |
if (__ras & RC_BITMAP64) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8538 |
printf(" RC_BITMAP64"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8539 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8540 |
if (__ras & RC_DI_BITMAP) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8541 |
printf(" RC_DI_BITMAP"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8542 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8543 |
if (__ras & RC_DIBTODEV) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8544 |
printf(" RC_DIBTODEV"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8545 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8546 |
if (__ras & RC_FLOODFILL) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8547 |
printf(" RC_FLOODFILL"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8548 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8549 |
if (__ras & RC_PALETTE) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8550 |
printf(" RC_PALETTE"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8551 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8552 |
if (__ras & RC_SCALING) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8553 |
printf(" RC_SCALING"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8554 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8555 |
if (__ras & RC_STRETCHBLT) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8556 |
printf(" RC_STRETCHBLT"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8557 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8558 |
if (__ras & RC_STRETCHDIB) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8559 |
printf(" RC_STRETCHDIB"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8560 |
printf("\n"); |
2151 | 8561 |
printf("cursor size %d %d\n",GetSystemMetrics(SM_CXCURSOR),GetSystemMetrics(SM_CYCURSOR)); |
8562 |
||
8563 |
#endif |
|
8564 |
||
1127 | 8565 |
__INST(depth) = __MKSMALLINT(__depth); |
8566 |
__INST(ncells) = __MKSMALLINT(1<<__depth); |
|
8567 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8568 |
|
1127 | 8569 |
val = GetDeviceCaps(_rootDC, HORZSIZE); |
2151 | 8570 |
DPRINTF(("HORSIZE=%d\n",val)); |
1127 | 8571 |
__INST(widthMM) = __MKSMALLINT(val); |
8572 |
val = GetDeviceCaps(_rootDC, VERTSIZE); |
|
2151 | 8573 |
DPRINTF(("VERTSIZE=%d\n",val)); |
1127 | 8574 |
__INST(heightMM) = __MKSMALLINT(val); |
8575 |
||
8576 |
||
2232 | 8577 |
__logPixelSY = GetDeviceCaps(_rootDC, LOGPIXELSY); |
1127 | 8578 |
capabilities = GetDeviceCaps(_rootDC, RASTERCAPS); |
8579 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8580 |
__INST(whitepixel) = __MKSMALLINT(WhitePixel); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8581 |
__INST(blackpixel) = __MKSMALLINT(BlackPixel); |
1127 | 8582 |
|
2232 | 8583 |
#ifndef ALWAYSTRUECOLOR |
8584 |
if (! (capabilities & RC_PALETTE)) |
|
8585 |
#endif |
|
8586 |
{ |
|
1127 | 8587 |
DPRINTF(("no palette\n")); |
8588 |
if (__depth == 1) { |
|
8589 |
__INST(visualType) = @symbol(GrayScale); |
|
8590 |
__INST(hasColors) = false; |
|
8591 |
__INST(hasGreyscales) = false; |
|
8592 |
__INST(monitorType) = @symbol(monochrome); |
|
8593 |
} else { |
|
8594 |
__INST(hasColors) = true; |
|
8595 |
__INST(hasGreyscales) = true; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8596 |
if ((__depth == 16) || (__depth == 15)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8597 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8598 |
__INST(visualType) = @symbol(TrueColor); |
2232 | 8599 |
__INST(blueShift) = __MKSMALLINT(0); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8600 |
__INST(greenShift) = __MKSMALLINT(5); |
2232 | 8601 |
__INST(redShift) = __MKSMALLINT(11); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8602 |
__INST(bitsPerRGB) = __MKSMALLINT(5); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8603 |
__INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(5); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8604 |
__INST(blueMask) = __MKSMALLINT(0x1f); |
2232 | 8605 |
__INST(greenMask) = __MKSMALLINT(0x7e0); |
8606 |
__INST(redMask) = __MKSMALLINT(0xf800); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8607 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8608 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8609 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8610 |
__INST(visualType) = @symbol(TrueColor); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8611 |
__INST(redShift) = __MKSMALLINT(0); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8612 |
__INST(greenShift) = __MKSMALLINT(8); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8613 |
__INST(blueShift) = __MKSMALLINT(16); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8614 |
__INST(bitsPerRGB) = __MKSMALLINT(8); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8615 |
__INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(8); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8616 |
__INST(redMask) = __MKSMALLINT(0xFF); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8617 |
__INST(greenMask) = __MKSMALLINT(0xFF00); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8618 |
__INST(blueMask) = __MKSMALLINT(0xFF0000); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8619 |
} |
1127 | 8620 |
} |
2232 | 8621 |
} |
8622 |
#ifndef ALWAYSTRUECOLOR |
|
8623 |
else |
|
8624 |
{ |
|
1127 | 8625 |
val = GetDeviceCaps(_rootDC, SIZEPALETTE); /* First two entries are black and white. */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8626 |
printf("SizeofPalette %d\n",val); |
1127 | 8627 |
__INST(ncells) = __MKSMALLINT(val); |
8628 |
__INST(blackpixel) = __MKSMALLINT(0); |
|
8629 |
__INST(whitepixel) = __MKSMALLINT(1); |
|
8630 |
__INST(hasColors) = true; |
|
8631 |
__INST(hasGreyscales) = true; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8632 |
__INST(usingSystemPalette) = true; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8633 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8634 |
__INST(redShift) = __MKSMALLINT(0); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8635 |
__INST(greenShift) = __MKSMALLINT(2); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8636 |
__INST(blueShift) = __MKSMALLINT(4); |
2232 | 8637 |
__INST(bitsPerRGB) = __MKSMALLINT(2); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8638 |
__INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(2); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8639 |
__INST(redMask) = __MKSMALLINT(0x3); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8640 |
__INST(greenMask) = __MKSMALLINT(0xc); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8641 |
__INST(blueMask) = __MKSMALLINT(0x30); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8642 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8643 |
} |
2232 | 8644 |
#endif |
1127 | 8645 |
__INST(monitorType) = @symbol(unknown); |
8646 |
||
8647 |
%}. |
|
2232 | 8648 |
! |
8649 |
||
1127 | 8650 |
initializeSpecialFlags |
8651 |
"perform additional special server implementation flags" |
|
2232 | 8652 |
! |
8653 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8654 |
primInitializeFor:aDisplayName |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8655 |
"initialize the receiver for a connection to an X-Server; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8656 |
the argument, aDisplayName may be nil (for the default server from |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8657 |
DISPLAY-variable or command line argument) or the name of the server |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8658 |
as hostname:number" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8659 |
|
2232 | 8660 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8661 |
RETURN ( __MKSMALLINT(1) ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8662 |
%}. |
2232 | 8663 |
! |
8664 |
||
1127 | 8665 |
reinitialize |
8666 |
rootWin := rootDC := nil. |
|
8667 |
super reinitialize. |
|
2232 | 8668 |
! ! |
8669 |
||
8670 |
!WinWorkstation methodsFor:'keyboard mapping'! |
|
8671 |
||
1127 | 8672 |
altModifierMask |
8673 |
"return the mask (in motionEvents) for the alt-key modifier. |
|
8674 |
Notice: ST/X may use the left ALT key as CMD/Meta key, |
|
8675 |
therefore return a variable here, which can be changed during startup." |
|
8676 |
||
8677 |
%{ /* NOCONTEXT */ |
|
8678 |
RETURN (__MKSMALLINT(AltMask)); |
|
8679 |
%} |
|
8680 |
||
8681 |
"Created: 23.3.1996 / 12:43:22 / cg" |
|
8682 |
"Modified: 23.3.1996 / 12:44:56 / cg" |
|
2232 | 8683 |
! |
8684 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8685 |
leftAltMask |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8686 |
"return the mask bit for the left Alt modifier key. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8687 |
See comment in altModifierMask: / metaModifierMask: for what |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8688 |
this could be used." |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8689 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8690 |
%{ /* NOCONTEXT */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8691 |
RETURN (__MKSMALLINT(LeftAltMask)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8692 |
%} |
2232 | 8693 |
! |
8694 |
||
1127 | 8695 |
metaModifierMask |
8696 |
"return the mask (in motionEvents) for the meta-key modifier. |
|
8697 |
Notice: ST/X may use the left ALT key as CMD/Meta key, |
|
8698 |
therefore return a variable here, which can be changed during startup." |
|
8699 |
||
8700 |
%{ /* NOCONTEXT */ |
|
8701 |
RETURN (__MKSMALLINT(MetaMask)); |
|
8702 |
%} |
|
8703 |
||
8704 |
"Created: 23.3.1996 / 12:43:39 / cg" |
|
8705 |
"Modified: 23.3.1996 / 12:45:09 / cg" |
|
2232 | 8706 |
! |
8707 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8708 |
modifierMapping |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8709 |
"Get the Modifier Mapping. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8710 |
We return an array of arrays of keycodes" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8711 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8712 |
^ nil |
2232 | 8713 |
! |
8714 |
||
1127 | 8715 |
rightAltMask |
8716 |
"return the mask bit for the right Alt modifier key. |
|
8717 |
See comment in altModifierMask: / metaModifierMask: for what |
|
8718 |
this could be used." |
|
8719 |
||
8720 |
%{ /* NOCONTEXT */ |
|
8721 |
RETURN (__MKSMALLINT(RightAltMask)); |
|
8722 |
%} |
|
2232 | 8723 |
! |
8724 |
||
1127 | 8725 |
stringFromKeycode:code |
8726 |
"Get a KeySymbol (a smalltalk symbol) from the keycode." |
|
8727 |
||
8728 |
^ '' |
|
8729 |
||
8730 |
" |
|
8731 |
Display stringFromKeycode:28 |
|
8732 |
" |
|
2232 | 8733 |
! ! |
8734 |
||
8735 |
!WinWorkstation methodsFor:'misc'! |
|
8736 |
||
1127 | 8737 |
beep |
8738 |
"output an audible beep" |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8739 |
|
2325 | 8740 |
%{ |
8741 |
__STX_API_CALL1( |
|
8742 |
MessageBeep, MB_ICONEXCLAMATION |
|
8743 |
); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8744 |
%} |
2232 | 8745 |
! |
8746 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8747 |
flush |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8748 |
"send all buffered drawing to the display. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8749 |
This may be required to make certain, that all previous operations |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8750 |
are really sent to the display before continuing. For example, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8751 |
after a cursor-change with a followup long computation. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8752 |
(otherwise, the cursor change request may still be in the output buffer) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8753 |
See also #sync, which even waits until the request has been processed." |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8754 |
|
2232 | 8755 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8756 |
GdiFlush(); |
1127 | 8757 |
%} |
2232 | 8758 |
! |
8759 |
||
1127 | 8760 |
refreshKeyboardMapping:eB |
2232 | 8761 |
! |
8762 |
||
1127 | 8763 |
setInputFocusTo:aWindowId |
8764 |
self setInputFocusTo:aWindowId revertTo:nil |
|
2232 | 8765 |
! |
8766 |
||
1127 | 8767 |
setInputFocusTo:aWindowId revertTo:revertSymbol |
8768 |
"set the focus to the view as defined by aWindowId. |
|
8769 |
Passing nil set the focus to no window and lets the display discard all |
|
8770 |
input until a new focus is set. |
|
8771 |
RevertSymbol specifies what should happen if the view becomes invisible; |
|
8772 |
passing one of #parent, #root or nil specifies that the focus should be |
|
8773 |
given to the parent view, the root view or no view." |
|
8774 |
||
2232 | 8775 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
8776 |
if (__isExternalAddress(aWindowId)) |
|
8777 |
{ |
|
1127 | 8778 |
HWND hWnd = _HWNDVal(aWindowId); |
2244 | 8779 |
int r = 0; |
8780 |
if (revertSymbol == @symbol(parent)) |
|
8781 |
{ |
|
8782 |
r = 1; |
|
8783 |
} |
|
8784 |
else if (revertSymbol == @symbol(root)) |
|
8785 |
{ |
|
8786 |
r = 2; |
|
8787 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8788 |
if (hWnd) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8789 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8790 |
if (GetFocus() != hWnd) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8791 |
{ |
2232 | 8792 |
CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r)); |
8793 |
PostMessage(hWnd,WM_THREADSETFOCUS,(INT)hWnd,GetCurrentThreadId()); |
|
8794 |
#if 0 |
|
8795 |
if (SetFocus(hWnd) == 0) |
|
8796 |
PRINTF(("SetFocus to %x failed.\n",hWnd)); |
|
8797 |
#endif |
|
8798 |
} |
|
2244 | 8799 |
else |
8800 |
{ |
|
2232 | 8801 |
CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r)); |
2244 | 8802 |
} |
1127 | 8803 |
} |
8804 |
RETURN ( self ); |
|
8805 |
} |
|
8806 |
%} |
|
2232 | 8807 |
! ! |
8808 |
||
8809 |
!WinWorkstation methodsFor:'pointer queries '! |
|
8810 |
||
1127 | 8811 |
anyButtonStateMask |
8812 |
"return an integer for masking out any button from a |
|
8813 |
buttonStates value." |
|
8814 |
||
8815 |
"/ should use ``Display buttonXMotionMask bitOr:....'' |
|
8816 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8817 |
|s | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8818 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8819 |
%{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8820 |
s = __MKSMALLINT(Button1Mask|Button2Mask|Button3Mask); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8821 |
%}. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8822 |
^ s |
1127 | 8823 |
|
8824 |
"Modified: 23.3.1996 / 12:41:33 / cg" |
|
8825 |
"Created: 23.3.1996 / 12:46:35 / cg" |
|
2232 | 8826 |
! |
8827 |
||
1127 | 8828 |
buttonStates |
8829 |
"return an integer representing the state of the pointer buttons; |
|
8830 |
a one-bit in positions 0.. represent a pressed button. |
|
8831 |
See the button1Mask/button2Mask/button3Mask, |
|
8832 |
shiftMask/controlMask and modifierMask methods for the meaning of the bits." |
|
8833 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8834 |
|s | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8835 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8836 |
%{ |
2253 | 8837 |
int modifiers = 0; |
8838 |
int b1m = Button1Mask; |
|
8839 |
int b3m = Button3Mask; |
|
8840 |
if (GetSystemMetrics(SM_SWAPBUTTON)) |
|
8841 |
{ |
|
8842 |
b3m = Button1Mask; |
|
8843 |
b1m = Button3Mask; |
|
8844 |
} |
|
8845 |
||
8846 |
if (GetAsyncKeyState(VK_LBUTTON) & 0x8000) |
|
8847 |
modifiers |= b1m; |
|
8848 |
if (GetAsyncKeyState(VK_MBUTTON) & 0x8000) |
|
8849 |
modifiers |= Button2Mask; |
|
8850 |
if (GetAsyncKeyState(VK_RBUTTON) & 0x8000) |
|
8851 |
modifiers |= b3m; |
|
8852 |
||
8853 |
s = __MKSMALLINT(modifiers); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8854 |
%}. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8855 |
^ s |
1127 | 8856 |
|
8857 |
" |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8858 |
Display buttonStates |
1127 | 8859 |
" |
8860 |
||
8861 |
"is the control-key pressed ? |
|
8862 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8863 |
Display buttonStates bitTest:(Display controlMask) |
1127 | 8864 |
" |
8865 |
||
8866 |
"is the alt/meta-key pressed ? |
|
8867 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8868 |
Display buttonStates bitTest:(Display altModifierMask) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8869 |
Display buttonStates bitTest:(Display metaModifierMask) |
1127 | 8870 |
" |
2232 | 8871 |
! |
8872 |
||
1127 | 8873 |
leftButtonStateMask |
8874 |
"return an integer for masking out the left button from a |
|
8875 |
buttonStates value" |
|
8876 |
||
8877 |
"/ should use ``Display button1MotionMask'' |
|
8878 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8879 |
|s | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8880 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8881 |
%{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8882 |
s = __MKSMALLINT(Button1Mask); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8883 |
%}. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8884 |
^ s |
1127 | 8885 |
|
8886 |
"Modified: 23.3.1996 / 12:41:33 / cg" |
|
2232 | 8887 |
! |
8888 |
||
1127 | 8889 |
middleButtonStateMask |
8890 |
"return an integer for masking out the middle button from a |
|
8891 |
buttonStates value" |
|
8892 |
||
8893 |
"/ should use ``Display button2MotionMask'' |
|
8894 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8895 |
|s | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8896 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8897 |
%{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8898 |
s = __MKSMALLINT(Button2Mask); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8899 |
%}. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8900 |
^ s |
1127 | 8901 |
|
8902 |
"Modified: 23.3.1996 / 12:41:43 / cg" |
|
2232 | 8903 |
! |
8904 |
||
1127 | 8905 |
pointerPosition |
8906 |
"return the current pointer position in root-window coordinates" |
|
8907 |
||
2232 | 8908 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 8909 |
POINT p; |
8910 |
||
8911 |
if (GetCursorPos(&p)) { |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8912 |
RETURN (__MKPOINT_INT(p.x, p.y)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8913 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8914 |
RETURN (__MKPOINT_INT(0, 0)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8915 |
%} |
2232 | 8916 |
! |
8917 |
||
1127 | 8918 |
rightButtonStateMask |
8919 |
"return an integer for masking out the right button from a |
|
8920 |
buttonStates value" |
|
8921 |
||
8922 |
"/ should use ``Display button3MotionMask'' |
|
8923 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8924 |
|s | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8925 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8926 |
%{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8927 |
s = __MKSMALLINT(Button3Mask); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8928 |
%}. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8929 |
^ s |
1127 | 8930 |
|
8931 |
"Modified: 23.3.1996 / 12:41:52 / cg" |
|
2232 | 8932 |
! |
8933 |
||
1127 | 8934 |
rootPositionOfLastEvent |
8935 |
"return the position in root-window coordinates |
|
8936 |
of the last button, key or pointer event" |
|
8937 |
||
8938 |
|x y| |
|
8939 |
||
8940 |
%{ |
|
8941 |
x = __MKSMALLINT(evRootX); |
|
8942 |
y = __MKSMALLINT(evRootY); |
|
8943 |
%}. |
|
8944 |
^ x @ y |
|
2232 | 8945 |
! |
8946 |
||
1723 | 8947 |
setPointerPosition:newPosition |
8948 |
"change the pointer position in root-window coordinates." |
|
8949 |
||
2232 | 8950 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8951 |
if (__isPoint(newPosition)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8952 |
OBJ xpos, ypos; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8953 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8954 |
xpos = __point_X(newPosition); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8955 |
ypos = __point_Y(newPosition); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8956 |
SetCursorPos(__intVal(xpos), __intVal(ypos)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8957 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8958 |
%} |
2232 | 8959 |
! |
8960 |
||
1723 | 8961 |
setPointerPosition:newPosition in:aWindowId |
8962 |
"change the pointer position to a new position relative to the |
|
8963 |
given windows origin (which may be the rootWindow). |
|
8964 |
Be careful with this - its usually not very ergonimically |
|
8965 |
to change the mousePointer position. |
|
8966 |
This interface is provided for special applications (presentation |
|
8967 |
playback) and should not be used in normal applications." |
|
8968 |
||
8969 |
self setCursorPosition:(self translatePoint:newPosition from:aWindowId to:rootView id). |
|
2232 | 8970 |
! ! |
8971 |
||
8972 |
!WinWorkstation methodsFor:'retrieving pixels'! |
|
8973 |
||
1461
6d8b022bfcd8
renamed getBitsFrom to getBitsFromId
Claus Gittinger <cg@exept.de>
parents:
1426
diff
changeset
|
8974 |
getBitsFromId:aDrawableId x:srcx y:srcy width:w height:h into:imageBits |
1127 | 8975 |
"get bits from a drawable into the imageBits. The storage for the bits |
8976 |
must be big enough for the data to fit. If ok, returns an array with some |
|
8977 |
info and the bits in imageBits. The info contains the depth, bitOrder and |
|
8978 |
number of bytes per scanline. The number of bytes per scanline is not known |
|
8979 |
in advance, since the X-server is free to return whatever it thinks is a good padding." |
|
8980 |
||
8981 |
|rawInfo info| |
|
8982 |
||
8983 |
((w <= 0) or:[h <= 0]) ifTrue:[ |
|
8984 |
self primitiveFailed. |
|
8985 |
^ nil |
|
8986 |
]. |
|
8987 |
||
8988 |
rawInfo := Array new:8. |
|
8989 |
"1 -> bit order" |
|
8990 |
"2 -> depth" |
|
8991 |
"3 -> bytes_per_line" |
|
8992 |
"4 -> byte_order" |
|
8993 |
"5 -> format" |
|
8994 |
"6 -> bitmap_unit" |
|
8995 |
"7 -> bitmap_pad" |
|
8996 |
"8 -> bits_per_pixel" |
|
8997 |
||
8998 |
"/ had to extract the getPixel call into a separate method, to specify |
|
8999 |
"/ unlimitedStack (some implementations use alloca and require huge amounts |
|
9000 |
"/ of temporary stack space |
|
9001 |
||
9002 |
(self primGetBitsFrom:aDrawableId x:srcx y:srcy width:w height:h into:imageBits infoInto:rawInfo) ifTrue:[ |
|
9003 |
info := IdentityDictionary new. |
|
9004 |
info at:#bitOrder put:(rawInfo at:1). |
|
9005 |
info at:#depth put:(rawInfo at:2). |
|
9006 |
info at:#bytesPerLine put:(rawInfo at:3). |
|
9007 |
info at:#byteOrder put:(rawInfo at:4). |
|
9008 |
info at:#format put:(rawInfo at:5). |
|
9009 |
info at:#bitmapUnit put:(rawInfo at:6). |
|
9010 |
info at:#bitmapPad put:(rawInfo at:7). |
|
9011 |
info at:#bitsPerPixel put:(rawInfo at:8). |
|
9012 |
^ info |
|
9013 |
]. |
|
9014 |
" |
|
9015 |
some error occured - either args are not smallintegers, imageBits is not a ByteArray |
|
9016 |
or is too small to hold the bits |
|
9017 |
" |
|
9018 |
^ self primitiveFailed |
|
2232 | 9019 |
! |
9020 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9021 |
getBitsFromPixmapId:aDrawableId x:srcx y:srcy width:w height:h into:imageBits |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9022 |
"get bits from a drawable into the imageBits. The storage for the bits |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9023 |
must be big enough for the data to fit. If ok, returns an array with some |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9024 |
info and the bits in imageBits. The info contains the depth, bitOrder and |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9025 |
number of bytes per scanline. The number of bytes per scanline is not known |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9026 |
in advance, since the X-server is free to return whatever it thinks is a good padding." |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9027 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9028 |
|rawInfo info| |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9029 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9030 |
((w <= 0) or:[h <= 0]) ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9031 |
self primitiveFailed. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9032 |
^ nil |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9033 |
]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9034 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9035 |
rawInfo := Array new:8. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9036 |
"1 -> bit order" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9037 |
"2 -> depth" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9038 |
"3 -> bytes_per_line" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9039 |
"4 -> byte_order" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9040 |
"5 -> format" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9041 |
"6 -> bitmap_unit" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9042 |
"7 -> bitmap_pad" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9043 |
"8 -> bits_per_pixel" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9044 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9045 |
"/ had to extract the getPixel call into a separate method, to specify |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9046 |
"/ unlimitedStack (some implementations use alloca and require huge amounts |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9047 |
"/ of temporary stack space |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9048 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9049 |
(self primGetBitsFromPixmap:aDrawableId x:srcx y:srcy width:w height:h into:imageBits infoInto:rawInfo) ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9050 |
info := IdentityDictionary new. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9051 |
info at:#bitOrder put:(rawInfo at:1). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9052 |
info at:#depth put:(rawInfo at:2). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9053 |
info at:#bytesPerLine put:(rawInfo at:3). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9054 |
info at:#byteOrder put:(rawInfo at:4). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9055 |
info at:#format put:(rawInfo at:5). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9056 |
info at:#bitmapUnit put:(rawInfo at:6). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9057 |
info at:#bitmapPad put:(rawInfo at:7). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9058 |
info at:#bitsPerPixel put:(rawInfo at:8). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9059 |
^ info |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9060 |
]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9061 |
" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9062 |
some error occured - either args are not smallintegers, imageBits is not a ByteArray |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9063 |
or is too small to hold the bits |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9064 |
" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9065 |
^ self primitiveFailed |
2232 | 9066 |
! |
9067 |
||
1127 | 9068 |
getPixelX:x y:y from:aDrawableId |
9069 |
"return the pixel value at x/y; coordinates start at 0/0 for the upper left. |
|
9070 |
Nil is returned for invalid coordinates or if any other problem arises." |
|
9071 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9072 |
'getPixelX:y:from: not yet implemented' printCR. |
1127 | 9073 |
^ nil |
2232 | 9074 |
! |
9075 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9076 |
primGetBitsFrom:aDrawableId x:srcX y:srcY width:w height:h into:imageBits infoInto:info |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9077 |
"since XGetImage may allocate huge amount of stack space |
1127 | 9078 |
(some implementations use alloca), this must run with unlimited stack." |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9079 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9080 |
"'primGetBitsFrom:x:y:width:height:into:infoInto: not yet implemented' printCR. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9081 |
^ false" |
2232 | 9082 |
%{ /* xxLIMITEDSTACK */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9083 |
int height, width; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9084 |
int numBytes; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9085 |
HWND hWnd; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9086 |
HBITMAP hBitmap = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9087 |
HDC bDC = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9088 |
struct |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9089 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9090 |
BITMAPINFOHEADER bmiHeader; |
2232 | 9091 |
DWORD r; |
9092 |
DWORD g; |
|
9093 |
DWORD b; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9094 |
} bitmap; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9095 |
|
2232 | 9096 |
if (__isExternalAddress(aDrawableId) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9097 |
&& __bothSmallInteger(srcX, srcY) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9098 |
&& __bothSmallInteger(w, h) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9099 |
&& __isArray(info) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9100 |
&& __isByteArray(imageBits)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9101 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9102 |
hWnd = _HWNDVal( aDrawableId ); |
2151 | 9103 |
DPRINTF(("primGetBits %x\n",hWnd)); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9104 |
if( hWnd != 0 ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9105 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9106 |
HDC wDC = GetDC(hWnd); |
2232 | 9107 |
bDC = CreateCompatibleDC(__rootDC); |
2325 | 9108 |
PRINTF(("srcX %d srcY %d w %d h %d\n",__intVal(srcX),__intVal(srcY),__intVal(w),__intVal(h))); |
2232 | 9109 |
height = __intVal(h); |
9110 |
width = __intVal(w); |
|
2151 | 9111 |
DPRINTF(("width %d height %d\n",width,height)); |
2325 | 9112 |
hBitmap = CreateCompatibleBitmap(__rootDC,(width + 3 )/ 4 * 4 /*width*/,height); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9113 |
if (!hBitmap) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9114 |
goto fail; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9115 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9116 |
bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9117 |
bitmap.bmiHeader.biPlanes = 1; |
2232 | 9118 |
if (__depth == 24) |
9119 |
{ |
|
9120 |
bitmap.bmiHeader.biCompression = BI_RGB; |
|
9121 |
} |
|
9122 |
else if (__depth == 16) |
|
9123 |
{ |
|
9124 |
/*bitmap.bmiHeader.biCompression = BI_RGB; |
|
9125 |
bitmap.bmiHeader.biCompression = BI_BITFIELDS; |
|
9126 |
bitmap.b = 0x001f; |
|
9127 |
bitmap.g = 0x07e0; |
|
9128 |
bitmap.r = 0xf800;*/ |
|
9129 |
bitmap.b = 0; |
|
9130 |
bitmap.g = 0; |
|
9131 |
bitmap.r = 0; |
|
9132 |
bitmap.bmiHeader.biCompression = BI_RGB; |
|
9133 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9134 |
bitmap.bmiHeader.biSizeImage = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9135 |
bitmap.bmiHeader.biXPelsPerMeter = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9136 |
bitmap.bmiHeader.biYPelsPerMeter = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9137 |
bitmap.bmiHeader.biClrUsed = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9138 |
bitmap.bmiHeader.biClrImportant = 0; |
2232 | 9139 |
bitmap.bmiHeader.biBitCount = __depth; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9140 |
|
2325 | 9141 |
bitmap.bmiHeader.biWidth = (width + 3 )/ 4 * 4; // width; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9142 |
bitmap.bmiHeader.biHeight = -height; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9143 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9144 |
SelectObject(bDC,hBitmap); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9145 |
if (BitBlt(bDC, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9146 |
0,0, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9147 |
width,height, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9148 |
wDC, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9149 |
__intVal(srcX), __intVal(srcY), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9150 |
SRCCOPY) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9151 |
== 0 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9152 |
) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9153 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9154 |
printf("ERROR in GetBitsFrom: BitBlt\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9155 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9156 |
ReleaseDC(hWnd,wDC); |
2151 | 9157 |
if (GetDIBits(bDC,hBitmap,0,height,0,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9158 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9159 |
printf("noinfo returned\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9160 |
goto fail; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9161 |
} |
2151 | 9162 |
DPRINTF(("bitmap info:%d %d %d %d\n",bitmap.bmiHeader.biWidth,bitmap.bmiHeader.biHeight,bitmap.bmiHeader.biBitCount,bitmap.bmiHeader.biSizeImage)); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9163 |
numBytes = bitmap.bmiHeader.biSizeImage; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9164 |
if( numBytes != 0 ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9165 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9166 |
if (numBytes > __byteArraySize(imageBits)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9167 |
/* imageBits too small */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9168 |
printf("provided byteArray too small\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9169 |
goto fail; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9170 |
} |
2151 | 9171 |
DPRINTF(("numBytes %d\n",numBytes)); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9172 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9173 |
bitmap.bmiHeader.biHeight = -height; |
2151 | 9174 |
if (GetDIBits(bDC,hBitmap,0,height,__ByteArrayInstPtr(imageBits)->ba_element,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9175 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9176 |
printf("zero bits returned\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9177 |
goto fail; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9178 |
} |
2232 | 9179 |
else |
9180 |
{ |
|
9181 |
char *c = __ByteArrayInstPtr(imageBits)->ba_element; |
|
9182 |
int n = numBytes; |
|
9183 |
for (;n > 0;n -= 3,c += 3) |
|
9184 |
{ |
|
9185 |
char b = c[0]; |
|
9186 |
c[0] = c[2]; |
|
9187 |
c[2] = b; |
|
9188 |
} |
|
9189 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9190 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9191 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9192 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9193 |
printf("unacceptable bitmap\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9194 |
goto fail; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9195 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9196 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9197 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9198 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9199 |
printf("unacceptable bitmap\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9200 |
goto fail; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9201 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9202 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9203 |
__ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9204 |
__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(1); |
2232 | 9205 |
__ArrayInstPtr(info)->a_element[2] = __MKSMALLINT(numBytes/height); //__MKSMALLINT((width * 3 + 3 )/ 4 * 4); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9206 |
__ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9207 |
__ArrayInstPtr(info)->a_element[4] = @symbol(XYPixmap); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9208 |
__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(0); |
2232 | 9209 |
__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(WIN32PADDING); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9210 |
__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(bitmap.bmiHeader.biBitCount); |
2232 | 9211 |
if (bDC) |
9212 |
DeleteDC(bDC); |
|
9213 |
if (hBitmap) |
|
9214 |
DelObject(hBitmap); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9215 |
RETURN ( true ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9216 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9217 |
fail: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9218 |
if (bDC) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9219 |
DeleteDC(bDC); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9220 |
if (hBitmap) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9221 |
DelObject(hBitmap); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9222 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9223 |
%}. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9224 |
^ false |
2232 | 9225 |
! |
9226 |
||
9227 |
primGetBitsFromPixmap:aDrawableId x:srcX y:srcY width:w height:h into:imageBits infoInto:info |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9228 |
"since XGetImage may allocate huge amount of stack space |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9229 |
(some implementations use alloca), this must run with unlimited stack." |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9230 |
|
2232 | 9231 |
%{ /* xxLIMITEDSTACK */ |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9232 |
int height, width; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9233 |
int numBytes; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9234 |
unsigned char* ep = 0; |
2232 | 9235 |
HBITMAP xBitmap; |
9236 |
HBITMAP hBitmap = 0; |
|
9237 |
HDC bDC = 0; |
|
9238 |
HDC xDC = 0; |
|
9239 |
struct |
|
9240 |
{ |
|
9241 |
BITMAPINFOHEADER bmiHeader; |
|
9242 |
DWORD rgb[2]; |
|
9243 |
} bitmap; |
|
9244 |
BITMAP bitmapInfo; |
|
9245 |
||
9246 |
if (__isExternalAddress(aDrawableId) |
|
9247 |
&& __bothSmallInteger(srcX, srcY) |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9248 |
&& __bothSmallInteger(w, h) |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9249 |
&& __isArray(info) |
2232 | 9250 |
&& __isByteArray(imageBits)) |
9251 |
{ |
|
9252 |
xBitmap = _HBITMAPVAL( aDrawableId ); |
|
9253 |
DPRINTF(("primGetBitsFromPixmap %x\n",xBitmap)); |
|
9254 |
if( xBitmap != 0 ) |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9255 |
{ |
2232 | 9256 |
xDC = GetDC(0); |
9257 |
SelectObject(xDC,xBitmap); |
|
9258 |
GetObject(xBitmap,sizeof(bitmapInfo),&bitmapInfo); |
|
9259 |
||
9260 |
bDC = CreateCompatibleDC(__rootDC); |
|
9261 |
DPRINTF(("srcX %d srcY %d w %d h %d\n",__intVal(srcX),__intVal(srcY),__intVal(w),__intVal(h))); |
|
9262 |
height = __intVal(h); |
|
9263 |
width = __intVal(w); |
|
9264 |
DPRINTF(("width %d height %d\n",width,height)); |
|
9265 |
||
9266 |
hBitmap = CreateCompatibleBitmap(xDC,width,height); |
|
9267 |
if (!hBitmap) |
|
9268 |
goto fail; |
|
9269 |
||
9270 |
SelectObject(bDC,hBitmap); |
|
9271 |
if (BitBlt(bDC, |
|
9272 |
0,0, |
|
9273 |
width,height, |
|
9274 |
xDC, |
|
9275 |
__intVal(srcX), __intVal(srcY), |
|
9276 |
SRCCOPY) |
|
9277 |
== 0 |
|
9278 |
) |
|
9279 |
{ |
|
9280 |
DPRINTF(("ERROR in primGetBitsFromPixmap: BitBlt\n")); |
|
9281 |
goto fail; |
|
9282 |
} |
|
9283 |
bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); |
|
9284 |
bitmap.bmiHeader.biPlanes = 1; |
|
9285 |
if (__depth == 24) |
|
9286 |
{ |
|
9287 |
/*bitmap.bmiHeader.biCompression = BI_BITFIELDS; |
|
9288 |
bitmap.r = 0xff0000; |
|
9289 |
bitmap.g = 0x00ff00; |
|
9290 |
bitmap.b = 0x0000ff;*/ |
|
9291 |
bitmap.bmiHeader.biCompression = BI_RGB; |
|
9292 |
} |
|
9293 |
else if (__depth == 16) |
|
9294 |
{ |
|
9295 |
/*bitmap.bmiHeader.biCompression = BI_RGB; |
|
9296 |
bitmap.bmiHeader.biCompression = BI_BITFIELDS; |
|
9297 |
bitmap.b = 0x001f; |
|
9298 |
bitmap.g = 0x07e0; |
|
9299 |
bitmap.r = 0xf800;*/ |
|
9300 |
bitmap.bmiHeader.biCompression = BI_RGB; |
|
9301 |
} |
|
9302 |
bitmap.bmiHeader.biSizeImage = 0; |
|
9303 |
bitmap.bmiHeader.biXPelsPerMeter = 0; |
|
9304 |
bitmap.bmiHeader.biYPelsPerMeter = 0; |
|
9305 |
bitmap.bmiHeader.biClrUsed = 0; |
|
9306 |
bitmap.bmiHeader.biClrImportant = 0; |
|
9307 |
||
9308 |
bitmap.bmiHeader.biWidth = width; |
|
9309 |
bitmap.bmiHeader.biHeight = -height; |
|
9310 |
bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel; |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9311 |
/* XXX - this seems to overwrite by stack frame .... |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9312 |
* check args |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9313 |
*/ |
2232 | 9314 |
if (GetDIBits(bDC,hBitmap,0,height,0,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0) |
9315 |
{ |
|
9316 |
DPRINTF(("noinfo returned\n")); |
|
9317 |
goto fail; |
|
9318 |
} |
|
9319 |
DPRINTF(("bitmap info:%d %d %d %d\n",bitmap.bmiHeader.biWidth,bitmap.bmiHeader.biHeight,bitmap.bmiHeader.biBitCount,bitmap.bmiHeader.biSizeImage)); |
|
9320 |
numBytes = bitmap.bmiHeader.biSizeImage; |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9321 |
if( numBytes != 0 ) |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9322 |
{ |
2232 | 9323 |
if (numBytes > __byteArraySize(imageBits)) { |
9324 |
/* imageBits too small */ |
|
9325 |
DPRINTF(("provided byteArray too small\n")); |
|
9326 |
goto fail; |
|
9327 |
} |
|
9328 |
DPRINTF(("numBytes %d\n",numBytes)); |
|
9329 |
||
9330 |
bitmap.bmiHeader.biHeight = -height; |
|
9331 |
bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel; /*__depth;*/ |
|
9332 |
bitmap.rgb[0] = 0; |
|
9333 |
bitmap.rgb[1] = 0xffffff; |
|
9334 |
if (GetDIBits(xDC,xBitmap,0,height,__ByteArrayInstPtr(imageBits)->ba_element,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0) |
|
9335 |
{ |
|
9336 |
DPRINTF(("zero bits returned\n")); |
|
9337 |
goto fail; |
|
9338 |
} |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9339 |
} |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9340 |
else |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9341 |
{ |
2232 | 9342 |
DPRINTF(("unacceptable bitmap\n")); |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9343 |
goto fail; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9344 |
} |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9345 |
} |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9346 |
else |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9347 |
{ |
2232 | 9348 |
DPRINTF(("unacceptable bitmap\n")); |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9349 |
goto fail; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9350 |
} |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9351 |
__ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9352 |
__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(1); |
2232 | 9353 |
__ArrayInstPtr(info)->a_element[2] = __MKSMALLINT(numBytes/height); |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9354 |
__ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst); |
2232 | 9355 |
__ArrayInstPtr(info)->a_element[4] = (bitmap.bmiHeader.biBitCount == 1) ? @symbol(ZPixmap) : @symbol(XYPixmap); |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9356 |
__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(0); |
2232 | 9357 |
__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(WIN32PADDING); |
9358 |
__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(bitmap.bmiHeader.biBitCount); |
|
9359 |
if (bDC) |
|
9360 |
DeleteDC(bDC); |
|
9361 |
if (xDC) |
|
9362 |
ReleaseDC(0,xDC);//DeleteDC(xDC); |
|
9363 |
if (hBitmap) |
|
9364 |
DelObject(hBitmap); |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9365 |
RETURN ( true ); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9366 |
} |
2232 | 9367 |
fail: |
9368 |
if (bDC) |
|
9369 |
DeleteDC(bDC); |
|
9370 |
if (xDC) |
|
9371 |
ReleaseDC(0,xDC);//DeleteDC(xDC); |
|
9372 |
if (hBitmap) |
|
9373 |
DelObject(hBitmap); |
|
9374 |
||
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9375 |
%}. |
1127 | 9376 |
^ false |
2232 | 9377 |
! ! |
9378 |
||
9379 |
!WinWorkstation methodsFor:'selections'! |
|
9380 |
||
2297
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
9381 |
getClipboardData |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
9382 |
%{ |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
9383 |
HANDLE hClip; |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
9384 |
HANDLE hData; |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
9385 |
|
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
9386 |
hClip = OpenClipboard(NULL); |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
9387 |
hData = GetClipboardData(CF_TEXT); |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
9388 |
CloseClipboard(); |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
9389 |
printf("%s\n", (char *)hData); |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
9390 |
%} |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
9391 |
! |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
9392 |
|
2151 | 9393 |
getSelectionFor:drawableId |
9394 |
'getSelectionFor: not yet implemented' errorPrintCR. |
|
9395 |
^ nil |
|
9396 |
||
9397 |
||
2232 | 9398 |
! ! |
9399 |
||
9400 |
!WinWorkstation methodsFor:'style defaults'! |
|
9401 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9402 |
defaultStyleValueFor:aKey |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9403 |
"return a default style value, given a key. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9404 |
These defaults are used if nothing is specified |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9405 |
in the style sheet |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9406 |
This allows for empty values in style sheets, and defaults |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9407 |
being provided by the display (which makes sense with Windows, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9408 |
where the systemDefaults are used ..." |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9409 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9410 |
<resource: #style (#viewSpacing |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9411 |
#borderColor #borderWidth |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9412 |
#viewBackground #shadowColor #lightColor |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9413 |
)> |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9414 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9415 |
|clr| |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9416 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9417 |
"/ aKey == #shadowColor ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9418 |
"/ ^ Color black |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9419 |
"/ ]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9420 |
"/ aKey == #lightColor ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9421 |
"/ ^ Color white |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9422 |
"/ ]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9423 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9424 |
aKey == #viewBackgroundColor ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9425 |
clr := self getSystemColor:#COLOR_WINDOW. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9426 |
]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9427 |
aKey == #textForegroundColor ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9428 |
clr := self getSystemColor:#COLOR_WINDOWTEXT |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9429 |
]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9430 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9431 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9432 |
"/ aKey == #scrollerViewBackgroundColor ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9433 |
"/ ^ Color white |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9434 |
"/ ]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9435 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9436 |
"/ aKey == #textForegroundColor ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9437 |
"/ ^ Color black. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9438 |
"/ ]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9439 |
"/ aKey == #textBackgroundColor ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9440 |
"/ ^ Color white. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9441 |
"/ ]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9442 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9443 |
clr notNil ifTrue:[^ clr]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9444 |
^ super defaultStyleValueFor:aKey |
2232 | 9445 |
! ! |
9446 |
||
9447 |
!WinWorkstation methodsFor:'window stuff'! |
|
9448 |
||
1127 | 9449 |
clearRectangleX:x y:y width:width height:height in:aWindowId |
9450 |
"clear a rectangular area to viewbackground" |
|
9451 |
%{ |
|
9452 |
DPRINTF(("clearRect\n")); |
|
9453 |
%}. |
|
9454 |
super clearRectangleX:x y:y width:width height:height in:aWindowId |
|
2232 | 9455 |
! |
9456 |
||
1127 | 9457 |
clearWindow:aWindowId |
9458 |
"clear a window to viewbackground" |
|
9459 |
||
9460 |
%{ |
|
9461 |
DPRINTF(("clearWin\n")); |
|
9462 |
%}. |
|
9463 |
super clearWindow:aWindowId |
|
2232 | 9464 |
! |
9465 |
||
1127 | 9466 |
configureWindow:aWindowId sibling:siblingId stackMode:modeSymbol |
9467 |
"configure stacking operation of aWindowId w.r.t siblingId" |
|
9468 |
||
2232 | 9469 |
! |
9470 |
||
1127 | 9471 |
lowerWindow:aWindowId |
9472 |
"bring a window to back" |
|
9473 |
||
2232 | 9474 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 9475 |
|
9476 |
if (__isExternalAddress(aWindowId)) { |
|
9477 |
HWND win = _HWNDVal(aWindowId); |
|
9478 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9479 |
if (win) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9480 |
{ |
2244 | 9481 |
CPRINTF(("lowerWindow %x\n",win)); |
2232 | 9482 |
SetWindowPos(win, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE|SWP_NOSIZE); |
1127 | 9483 |
} |
9484 |
RETURN ( self ); |
|
9485 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9486 |
%} |
2232 | 9487 |
! |
9488 |
||
2151 | 9489 |
mapView:aView id:aWindowId iconified:aBoolean atX:x y:y width:w height:h minExtent:minExt maxExtent:maxExt |
9490 |
||
1127 | 9491 |
"make a window visible - either as icon or as a real view - needed for restart" |
9492 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9493 |
"/ 'mapView:id:iconified:...height: not yet implemented' errorPrintCR. |
2232 | 9494 |
%{ /* xxLIMITEDSTACK */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9495 |
RECT rec; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9496 |
if (__isExternalAddress(aWindowId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9497 |
&& __bothSmallInteger(x, y) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9498 |
&& __bothSmallInteger(w, h)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9499 |
HWND win = _HWNDVal(aWindowId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9500 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9501 |
if (win) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9502 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9503 |
rec.left = __intVal(x); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9504 |
rec.top = __intVal(y); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9505 |
rec.right = rec.left + __intVal(w); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9506 |
rec.bottom = rec.top + __intVal(h); |
2232 | 9507 |
#ifdef ADJUSTWINDOW |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9508 |
AdjustWindowRectEx(&rec,GetWindowLong(win,GWL_STYLE),0,GetWindowLong(win,GWL_EXSTYLE)); |
2232 | 9509 |
#endif |
9510 |
CPRINTF(("mapView %x x:%d y:%d w:%d h:%d -> x:%d y:%d w:%d h:%d\n",win,__intVal(x),__intVal(y),__intVal(w),__intVal(h),rec.left,rec.top, |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9511 |
rec.right - rec.left, rec.bottom - rec.top)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9512 |
SetWindowPos(win, (HWND)0, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9513 |
rec.left, rec.top, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9514 |
rec.right - rec.left, rec.bottom - rec.top, |
2253 | 9515 |
SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOZORDER|SWP_NOOWNERZORDER); |
2232 | 9516 |
if (aBoolean == true) |
9517 |
{ |
|
9518 |
ShowWindow(win, SW_SHOWMINIMIZED); |
|
9519 |
enqEvent(0,win, WM_SHOWWINDOW, FALSE, 0, 0, 0, 0); |
|
9520 |
} |
|
9521 |
else |
|
9522 |
{ |
|
9523 |
enqEvent(0,win, WM_SHOWWINDOW, TRUE, 0, 0, 0, 0); |
|
2253 | 9524 |
//ShowWindow(win, SW_RESTORE); |
9525 |
ShowWindow(win, SW_SHOWNOACTIVATE); |
|
2232 | 9526 |
} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9527 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9528 |
RETURN ( self ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9529 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9530 |
%} |
2232 | 9531 |
! |
9532 |
||
1127 | 9533 |
mapWindow:aWindowId |
9534 |
"make a window visible" |
|
9535 |
||
2232 | 9536 |
%{ /* xxLIMITEDSTACK */ |
1127 | 9537 |
|
9538 |
if (__isExternalAddress(aWindowId)) { |
|
9539 |
HWND win = _HWNDVal(aWindowId); |
|
9540 |
||
9541 |
if (win) { |
|
2244 | 9542 |
CPRINTF(("mapWindow %x\n",win)); |
2232 | 9543 |
ShowWindow(win, SW_SHOWNOACTIVATE); |
9544 |
//ShowWindow(win, SW_SHOW); |
|
2260 | 9545 |
SetWindowPos(win, HWND_TOP, 0, 0, 0, 0, SWP_NOSENDCHANGING|/*SWP_SHOWWINDOW|*/SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE/*|SWP_NOZORDER|SWP_NOOWNERZORDER */ ); |
2232 | 9546 |
//enqEvent(0,win, WM_SHOWWINDOW, TRUE, 0, 0, 0, 0); |
1127 | 9547 |
} |
9548 |
RETURN ( self ); |
|
9549 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9550 |
%} |
2232 | 9551 |
! |
9552 |
||
2251
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9553 |
activateWindow:aWindowId |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9554 |
"make a window active" |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9555 |
|
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9556 |
%{ /* xxLIMITEDSTACK */ |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9557 |
|
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9558 |
if (__isExternalAddress(aWindowId)) { |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9559 |
HWND win = _HWNDVal(aWindowId); |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9560 |
|
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9561 |
if (win) { |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9562 |
CPRINTF(("activateWindow %x\n",win)); |
2253 | 9563 |
ShowWindowAsync(win, SW_SHOW | SW_SHOWNORMAL); |
2251
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9564 |
//ShowWindow(win, SW_SHOW); |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9565 |
//SetWindowPos(_thread_newWinHandle, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW|/*SWP_NOACTIVATE|*/SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER); |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9566 |
//enqEvent(0,win, WM_SHOWWINDOW, TRUE, 0, 0, 0, 0); |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9567 |
} |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9568 |
RETURN ( self ); |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9569 |
} |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9570 |
%} |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9571 |
! |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9572 |
|
1127 | 9573 |
moveResizeWindow:aWindowId x:x y:y width:w height:h |
9574 |
"move and resize a window" |
|
9575 |
||
2232 | 9576 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9577 |
RECT rec; |
1127 | 9578 |
if (__isExternalAddress(aWindowId) |
9579 |
&& __bothSmallInteger(x, y) |
|
9580 |
&& __bothSmallInteger(w, h)) { |
|
9581 |
HWND win = _HWNDVal(aWindowId); |
|
9582 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9583 |
if (win) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9584 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9585 |
rec.left = __intVal(x); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9586 |
rec.top = __intVal(y); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9587 |
rec.right = rec.left + __intVal(w); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9588 |
rec.bottom = rec.top + __intVal(h); |
2232 | 9589 |
#ifdef ADJUSTWINDOW |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9590 |
AdjustWindowRectEx(&rec,GetWindowLong(win,GWL_STYLE),0,GetWindowLong(win,GWL_EXSTYLE)); |
2232 | 9591 |
#endif |
9592 |
CPRINTF(("moveresize %x x:%d y:%d w:%d h:%d -> x:%d y:%d w:%d h:%d\n",win,__intVal(x),__intVal(y),__intVal(w),__intVal(h),rec.left,rec.top, |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9593 |
rec.right - rec.left, rec.bottom - rec.top)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9594 |
SetWindowPos(win, (HWND)0, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9595 |
rec.left, rec.top, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9596 |
rec.right - rec.left, rec.bottom - rec.top, |
2253 | 9597 |
SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOZORDER|SWP_NOOWNERZORDER); |
1127 | 9598 |
} |
9599 |
RETURN ( self ); |
|
9600 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9601 |
%} |
2232 | 9602 |
! |
9603 |
||
1127 | 9604 |
moveWindow:aWindowId x:x y:y |
9605 |
"move a window" |
|
9606 |
||
2232 | 9607 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9608 |
RECT rec; |
1127 | 9609 |
|
9610 |
if (__isExternalAddress(aWindowId) |
|
9611 |
&& __bothSmallInteger(x, y)) { |
|
9612 |
HWND win = _HWNDVal(aWindowId); |
|
9613 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9614 |
if (win) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9615 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9616 |
rec.left = __intVal(x); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9617 |
rec.top = __intVal(y); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9618 |
rec.right = rec.left + 10; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9619 |
rec.bottom = rec.top + 10; |
2232 | 9620 |
#ifdef ADJUSTWINDOW |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9621 |
AdjustWindowRectEx(&rec,GetWindowLong(win,GWL_STYLE),0,GetWindowLong(win,GWL_EXSTYLE)); |
2232 | 9622 |
#endif |
9623 |
CPRINTF(("move %x x:%d y:%d -> x:%d y:%d\n",win,__intVal(x),__intVal(y),rec.left,rec.top)); |
|
1127 | 9624 |
SetWindowPos(win, (HWND)0, |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9625 |
rec.left, rec.top, |
1127 | 9626 |
0, 0, |
2253 | 9627 |
SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER|SWP_NOOWNERZORDER); |
1127 | 9628 |
} |
9629 |
RETURN ( self ); |
|
9630 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9631 |
%} |
2232 | 9632 |
! |
9633 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9634 |
primSetWindowIconId:wiconId width:wiconWidth height:wiconHeight in:aWindowId |
2232 | 9635 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9636 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9637 |
unsigned char* cp; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9638 |
unsigned char* ep; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9639 |
HBITMAP xBitMap, maskBitmap; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9640 |
ICONINFO iconInfo; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9641 |
int height, width; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9642 |
int nBytes, nBits; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9643 |
int index; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9644 |
HICON xIcon = (HICON)0, yIcon = (HICON)0; |
2232 | 9645 |
unsigned char *allocatedBits = 0; |
9646 |
unsigned char fastBits[10000]; |
|
2151 | 9647 |
DPRINTF(("primSetWindowIconId\n")); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9648 |
if (__isExternalAddress(aWindowId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9649 |
&& __isExternalAddress(wiconId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9650 |
&& __bothSmallInteger(wiconWidth, wiconHeight)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9651 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9652 |
HWND win = _HWNDVal(aWindowId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9653 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9654 |
xBitMap = _HBITMAPVAL( wiconId ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9655 |
if( xBitMap != 0 ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9656 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9657 |
BITMAP bm; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9658 |
if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9659 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9660 |
int d = bm.bmPlanes * bm.bmBitsPixel; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9661 |
BYTE *ep,*bp; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9662 |
|
2151 | 9663 |
DPRINTF(("Bitmap w:%d h:%d p:%d d:%d\n",bm.bmWidth,bm.bmHeight,bm.bmPlanes,bm.bmBitsPixel)); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9664 |
height = __intVal( wiconHeight ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9665 |
width = __intVal( wiconWidth ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9666 |
nBytes = ( width + 31 ) / 8; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9667 |
nBytes = height * nBytes; |
2232 | 9668 |
if (nBytes < sizeof(fastBits)) |
9669 |
{ |
|
9670 |
ep = fastBits; |
|
9671 |
} |
|
9672 |
else |
|
9673 |
{ |
|
9674 |
ep = allocatedBits = (unsigned char *) malloc(nBytes); |
|
9675 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9676 |
if( ep != 0 ) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9677 |
memset(ep,0,nBytes); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9678 |
maskBitmap = CreateBitmap(width, height, 1, 1, ep ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9679 |
if( maskBitmap != NULL ) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9680 |
DPRINTF(( "BITMAP mask CREATED!!!\n" )); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9681 |
iconInfo.fIcon = TRUE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9682 |
iconInfo.hbmMask =maskBitmap; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9683 |
iconInfo.hbmColor = xBitMap; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9684 |
xIcon = CreateIconIndirect( &iconInfo ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9685 |
DPRINTF(( "ICON CREATED!!!\n" )); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9686 |
DelObject( maskBitmap ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9687 |
} else { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9688 |
DPRINTF(( "BITMAP mask CREATION failed!!!\n" )); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9689 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9690 |
} else { |
2232 | 9691 |
PRINTF(( " malloc failed\n" )); |
9692 |
} |
|
2244 | 9693 |
if (allocatedBits) |
2232 | 9694 |
free(allocatedBits); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9695 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9696 |
} else { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9697 |
DPRINTF((" xBitMap is zero \n" )); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9698 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9699 |
if (xIcon) { |
2260 | 9700 |
#ifndef TOPWINDOWCLASS |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9701 |
yIcon = (HICON)GetClassLong(win,GCL_HICON); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9702 |
SetClassLong(win,GCL_HICON,(DWORD)xIcon); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9703 |
/* It has to be checked whether thia can be deleted!!!!! */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9704 |
if( yIcon ) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9705 |
if( DestroyIcon( yIcon ) ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9706 |
DPRINTF(( "Old icon deleted\n" )); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9707 |
} |
2260 | 9708 |
#else |
2297
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
9709 |
SendMessage(_thread_newWinHandle,WM_SETICON,ICON_SMALL,(LPARAM)xIcon); |
3443e454a52d
preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents:
2284
diff
changeset
|
9710 |
SendMessage(_thread_newWinHandle,WM_SETICON,ICON_BIG,(LPARAM)xIcon); |
2260 | 9711 |
#endif |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9712 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9713 |
RETURN (self); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9714 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9715 |
%} |
2232 | 9716 |
! |
9717 |
||
2151 | 9718 |
raiseWindow:aWindowId |
9719 |
"bring a window to front" |
|
9720 |
||
2232 | 9721 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2151 | 9722 |
|
9723 |
if (__isExternalAddress(aWindowId)) { |
|
9724 |
HWND hWnd = _HWNDVal(aWindowId); |
|
9725 |
||
9726 |
if (hWnd) { |
|
2244 | 9727 |
CPRINTF(("raiseWindow %x\n",hWnd)); |
2253 | 9728 |
SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, /*SWP_NOOWNERZORDER |*/SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOMOVE|SWP_NOSIZE); |
2151 | 9729 |
} |
9730 |
RETURN ( self ); |
|
9731 |
} |
|
9732 |
%} |
|
2232 | 9733 |
! |
9734 |
||
2151 | 9735 |
resizeWindow:aWindowId width:w height:h |
9736 |
"resize a window" |
|
9737 |
||
2232 | 9738 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2151 | 9739 |
RECT rec; |
9740 |
if (__isExternalAddress(aWindowId) |
|
9741 |
&& __bothSmallInteger(w, h)) { |
|
9742 |
HWND hWnd = _HWNDVal(aWindowId); |
|
9743 |
||
9744 |
if (hWnd) |
|
9745 |
{ |
|
9746 |
rec.left = 0; |
|
9747 |
rec.top = 0; |
|
9748 |
rec.right = __intVal(w); |
|
9749 |
rec.bottom = __intVal(h); |
|
2232 | 9750 |
#ifdef ADJUSTWINDOW |
2151 | 9751 |
AdjustWindowRectEx(&rec,GetWindowLong(hWnd,GWL_STYLE),0,GetWindowLong(hWnd,GWL_EXSTYLE)); |
2232 | 9752 |
#endif |
9753 |
CPRINTF(("resize %x w:%d h:%d -> w:%d h:%d\n",hWnd,__intVal(w),__intVal(h),rec.right - rec.left, rec.bottom - rec.top)); |
|
2151 | 9754 |
SetWindowPos(hWnd, (HWND)0, |
9755 |
0, 0, |
|
9756 |
rec.right - rec.left, rec.bottom - rec.top, |
|
2253 | 9757 |
SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER|SWP_NOOWNERZORDER); |
2151 | 9758 |
} |
9759 |
RETURN ( self ); |
|
9760 |
} |
|
9761 |
%} |
|
2232 | 9762 |
! |
9763 |
||
1127 | 9764 |
setBackingStore:how in:aWindowId |
9765 |
"turn on/off backing-store for a window" |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9766 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9767 |
'setBackingStore:in: not yet implemented' errorPrintCR. |
2232 | 9768 |
! |
9769 |
||
1127 | 9770 |
setBitGravity:how in:aWindowId |
9771 |
"set bit gravity for a window" |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9772 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9773 |
"/ 'setBitGravity:in: not yet implemented' errorPrintCR. |
2232 | 9774 |
! |
9775 |
||
1127 | 9776 |
setCursor:aCursorId in:aWindowId |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9777 |
"define a windows cursor |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9778 |
Ignored here, since in windows, an application |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9779 |
has to manage the cursor itself." |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9780 |
|
2232 | 9781 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
9782 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
9783 |
HCURSOR newCursor; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
9784 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
9785 |
if (ISCONNECTED |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
9786 |
&& __isExternalAddress(aWindowId) |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
9787 |
&& __isExternalAddress(aCursorId)) { |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9788 |
HWND win = _HWNDVal(aWindowId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9789 |
POINT p; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9790 |
|
2240 | 9791 |
/*printf("setCursor:in:\n");*/ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9792 |
SetWindow_Cursor(win, _HCURSORVal(aCursorId)); |
2232 | 9793 |
#if 1 |
2260 | 9794 |
GetCursorPos(&p); |
9795 |
if (WindowFromPoint(p) == win) |
|
9796 |
{ |
|
9797 |
PostMessage(win,WM_THREADSETCURSOR,0,(INT)_HCURSORVal(aCursorId)); |
|
9798 |
} |
|
2232 | 9799 |
#else |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9800 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9801 |
* if the pointer is currently in that window ... |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9802 |
*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9803 |
GetCursorPos(&p); |
2232 | 9804 |
if (1/*WindowFromPoint(p) == win*/) |
9805 |
{ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9806 |
SetCursor(_HCURSORVal(aCursorId)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9807 |
} |
2232 | 9808 |
#endif |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
9809 |
RETURN ( self ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
9810 |
} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9811 |
%} |
2232 | 9812 |
! |
9813 |
||
1127 | 9814 |
setIconName:aString in:aWindowId |
9815 |
"define a windows iconname" |
|
9816 |
||
2232 | 9817 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9818 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9819 |
if (__isExternalAddress(aWindowId) |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9820 |
&& (__isString(aString) || __isSymbol(aString))) { |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9821 |
HWND win = _HWNDVal(aWindowId); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9822 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9823 |
SetWindowText(win, __stringVal(aString)); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9824 |
RETURN (self); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9825 |
} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9826 |
%} |
2232 | 9827 |
! |
9828 |
||
1127 | 9829 |
setSaveUnder:yesOrNo in:aWindowId |
9830 |
"turn on/off save-under for a window" |
|
9831 |
||
2232 | 9832 |
! |
9833 |
||
1127 | 9834 |
setTransient:aWindowId for:aMainWindowId |
9835 |
"set aWindowId to be a transient of aMainWindow" |
|
9836 |
||
2232 | 9837 |
! |
9838 |
||
1127 | 9839 |
setWindowBackground:aColorIndex in:aWindowId |
9840 |
"set the windows background color. This is the color with which |
|
9841 |
the view is filled whenever exposed. Do not confuse this with |
|
9842 |
the background drawing color, which is used with opaque drawing." |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9843 |
|
2232 | 9844 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9845 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9846 |
if (__isExternalAddress(aWindowId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9847 |
&& (__isSmallInteger(aColorIndex))) { |
2151 | 9848 |
HWND hWnd = _HWNDVal(aWindowId); |
2232 | 9849 |
/*HBRUSH hBrush = CreateSolidBrush(st2RGB(__intVal(aColorIndex),0)); |
2151 | 9850 |
if (GetWindow_bgBrush(hWnd)) |
2232 | 9851 |
DelObject(GetWindow_bgBrush(hWnd));*/ |
9852 |
SetWindow_bgBrush(hWnd,st2RGB(__intVal(aColorIndex),0) /*hBrush*/); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9853 |
RETURN (self); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9854 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9855 |
%} |
2232 | 9856 |
! |
9857 |
||
1127 | 9858 |
setWindowBackgroundPixmap:aPixmapId in:aWindowId |
9859 |
"set the windows background pattern to be a form. |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9860 |
This is the pattern with which the view is filled whenever exposed. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9861 |
Do not confuse this with the background drawing color, which is used |
1127 | 9862 |
with opaque drawing." |
9863 |
||
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9864 |
%{ /* NOCONTEXT */ |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9865 |
DPRINTF(("setWindowBackgroundPixmap:in: not yet implemented\n")); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9866 |
%}. |
2232 | 9867 |
! |
9868 |
||
1127 | 9869 |
setWindowBorderColor:aColorIndex in:aWindowId |
9870 |
"set the windows border color" |
|
9871 |
||
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9872 |
%{ /* NOCONTEXT */ |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9873 |
DPRINTF(("setWindowBorderColor:in: not yet implemented\n")); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9874 |
%}. |
2232 | 9875 |
! |
9876 |
||
1127 | 9877 |
setWindowBorderPixmap:aPixmapId in:aWindowId |
9878 |
"set the windows border pattern" |
|
9879 |
||
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9880 |
%{ /* NOCONTEXT */ |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9881 |
DPRINTF(("setWindowBorderPixmap:in: not yet implemented\n")); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9882 |
%}. |
2232 | 9883 |
! |
9884 |
||
1127 | 9885 |
setWindowBorderWidth:aNumber in:aWindowId |
9886 |
"set the windows border width" |
|
9887 |
||
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9888 |
%{ /* NOCONTEXT */ |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9889 |
DPRINTF(("setWindowBorderWidth:in: not yet implemented\n")); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9890 |
%}. |
2232 | 9891 |
! |
9892 |
||
1127 | 9893 |
setWindowClass:wClass name:wName in:aWindowId |
9894 |
"define class and name of a window. |
|
9895 |
This may be used by the window manager to |
|
9896 |
select client specific resources." |
|
2232 | 9897 |
%{ /* NOCONTEXT */ |
9898 |
DPRINTF(("setWindowClass:name:in: not yet implemented\n")); |
|
9899 |
%}. |
|
9900 |
! |
|
9901 |
||
1127 | 9902 |
setWindowGravity:how in:aWindowId |
9903 |
"set window gravity for a window" |
|
9904 |
||
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9905 |
%{ /* NOCONTEXT */ |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9906 |
DPRINTF(("setWindowGravity:in: not yet implemented\n")); |
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9907 |
%}. |
2232 | 9908 |
! |
9909 |
||
1127 | 9910 |
setWindowIcon:aForm in:aWindowId |
9911 |
"define a bitmap to be used as icon" |
|
9912 |
||
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9913 |
|wiconId wiconHeight wiconWidth| |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9914 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9915 |
aForm notNil ifTrue:[ |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9916 |
wiconId := aForm id. |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9917 |
wiconHeight := aForm height. |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9918 |
wiconWidth := aForm width. |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9919 |
self |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9920 |
primSetWindowIconId:wiconId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9921 |
width:wiconWidth |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9922 |
height:wiconHeight |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9923 |
in:aWindowId |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9924 |
]. |
2232 | 9925 |
! |
9926 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9927 |
setWindowIcon:aForm mask:aMaskForm in:aWindowId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9928 |
"set a windows icon & iconMask" |
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9929 |
|
2232 | 9930 |
%{ /* NOCONTEXT */ |
9931 |
DPRINTF(("setWindowIcon:mask:in: not yet implemented\n")); |
|
9932 |
%}. |
|
9933 |
! |
|
9934 |
||
1127 | 9935 |
setWindowIconWindow:aView in:aWindowId |
9936 |
"define a window to be used as icon" |
|
2310
0ca46bcbfc05
commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
9937 |
|
2151 | 9938 |
'setWindowIcon:in: not yet implemented' printCR. |
2232 | 9939 |
! |
9940 |
||
1127 | 9941 |
setWindowName:aString in:aWindowId |
9942 |
"define a windows name" |
|
9943 |
||
2232 | 9944 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 9945 |
|
9946 |
if (__isExternalAddress(aWindowId) |
|
9947 |
&& (__isString(aString) || __isSymbol(aString))) { |
|
9948 |
HWND win = _HWNDVal(aWindowId); |
|
9949 |
||
9950 |
SetWindowText(win, __stringVal(aString)); |
|
9951 |
RETURN (self); |
|
9952 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9953 |
%} |
2232 | 9954 |
! |
9955 |
||
1127 | 9956 |
unmapWindow:aWindowId |
9957 |
"make a window invisible" |
|
9958 |
||
2232 | 9959 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 9960 |
|
9961 |
if (__isExternalAddress(aWindowId)) { |
|
9962 |
HWND win = _HWNDVal(aWindowId); |
|
9963 |
||
9964 |
if (win) { |
|
2253 | 9965 |
CPRINTF(("unmapWindow %x\n",win)); |
1127 | 9966 |
ShowWindow(win, SW_HIDE); |
2253 | 9967 |
CPRINTF(("unmapWindow1 %x\n",win)); |
2232 | 9968 |
//enqEvent(win, WM_SHOWWINDOW, FALSE, 0, 0, 0, 0); |
1127 | 9969 |
} |
9970 |
RETURN ( self ); |
|
9971 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9972 |
%} |
2232 | 9973 |
! ! |
9974 |
||
9975 |
!WinWorkstation class methodsFor:'documentation'! |
|
9976 |
||
1127 | 9977 |
version |
2329 | 9978 |
^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.59 1998-09-11 13:59:46 cg Exp $' |
2232 | 9979 |
! ! |
9980 |
WinWorkstation initialize! |