author | Claus Gittinger <cg@exept.de> |
Wed, 19 Aug 1998 16:21:21 +0200 | |
changeset 2253 | 864c30e95b4b |
parent 2251 | 43d624ce346f |
child 2260 | 954c7dce96aa |
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 |
|
61 |
/* #include <stdio.h> */ |
|
1127 | 62 |
/* #include <malloc.h> */ |
63 |
/* #include <math.h> */ |
|
64 |
/* #include <string.h> */ |
|
65 |
||
2151 | 66 |
/*#include <stdarg.h> */ |
67 |
#ifdef __BORLANDC__ |
|
68 |
#define NOATOM |
|
69 |
#define NOGDICAPMASKS |
|
70 |
#define NOMETAFILE |
|
71 |
#define NOMINMAX |
|
72 |
#define NOOPENFILE |
|
73 |
#define NOSOUND |
|
74 |
#define NOWH |
|
75 |
#define NOCOMM |
|
76 |
#define NOKANJI |
|
77 |
#define NOCRYPT |
|
78 |
#define NOMCX |
|
79 |
#define WIN32_LEAN_AND_MEAN |
|
80 |
#include <windows.h> |
|
2232 | 81 |
#include <sys\timeb.h> |
2151 | 82 |
#else |
2232 | 83 |
#define _USERENTRY /**/ |
84 |
#define NOATOM |
|
85 |
#define NOGDICAPMASKS |
|
86 |
#define NOMETAFILE |
|
87 |
#define NOMINMAX |
|
88 |
#define NOOPENFILE |
|
89 |
#define NOSOUND |
|
90 |
#define NOWH |
|
91 |
#define NOCOMM |
|
92 |
#define NOKANJI |
|
93 |
#define NOCRYPT |
|
94 |
#define NOMCX |
|
95 |
#define WIN32_LEAN_AND_MEAN |
|
96 |
#include <windows.h> |
|
97 |
#include <sys\timeb.h> |
|
2151 | 98 |
#endif |
99 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
100 |
#include <process.h> |
1127 | 101 |
|
102 |
# ifdef __DEF_Array |
|
103 |
# undef Array |
|
104 |
# define Array __DEF_Array |
|
105 |
# endif |
|
106 |
# ifdef __DEF_Number |
|
107 |
# undef Number |
|
108 |
# define Number __DEF_Number |
|
109 |
# endif |
|
110 |
# ifdef __DEF_Method |
|
111 |
# undef Method |
|
112 |
# define Method __DEF_Method |
|
113 |
# endif |
|
114 |
# ifdef __DEF_Point |
|
115 |
# undef Point |
|
116 |
# define Point __DEF_Point |
|
117 |
# endif |
|
118 |
# ifdef __DEF_Block |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
119 |
# undef Block |
1127 | 120 |
# define Block __DEF_Block |
121 |
# endif |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
122 |
# ifdef __DEF_Context |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
123 |
# undef Context |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
124 |
# define Context __DEF_Context |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
125 |
# endif |
1912 | 126 |
# undef INT |
127 |
# define INT int |
|
1127 | 128 |
|
129 |
/* |
|
130 |
* some defines - tired of typing ... |
|
131 |
*/ |
|
132 |
#define _HANDLEVal(o) (HANDLE)(__MKCP(o)) |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
133 |
#define _HBITMAPVAL(o) (HBITMAP)(__MKCP(o)) |
1127 | 134 |
#define _HWNDVal(o) (HWND)(__MKCP(o)) |
135 |
#define _HPALETTEVal(o) (HPALETTE)(__MKCP(o)) |
|
136 |
#define _HCURSORVal(o) (HCURSOR)(__MKCP(o)) |
|
137 |
#define _HGDIOBJVal(o) (HGDIOBJ)(__MKCP(o)) |
|
138 |
#define _LOGPALETTEVal(o) (LOGPALETTE *)(__MKCP(o)) |
|
139 |
#define _COLORREFVal(o) (COLORREF)(__MKCP(o)) |
|
140 |
||
141 |
#define _GCDATA(o) ((struct gcData *)(__MKCP(o))) |
|
142 |
||
143 |
#define __rootDC (HDC)(__MKCP(__INST(rootDC))) |
|
144 |
#define ISCONNECTED (__INST(rootDC) != nil) |
|
145 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
146 |
struct gcData { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
147 |
HWND hWnd; |
2232 | 148 |
HBITMAP hBitmap; |
149 |
HBITMAP savehBitmap; |
|
150 |
int clipping; |
|
151 |
int clipX; |
|
152 |
int clipY; |
|
153 |
int clipW; |
|
154 |
int clipH; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
155 |
int clipByChild; |
2232 | 156 |
HDC _hDC; |
2151 | 157 |
HBITMAP hMask; |
158 |
int bitmapColorBitCount; |
|
1127 | 159 |
int lineWidth; |
160 |
int lineStyle; |
|
161 |
int joinStyle; |
|
162 |
int capStyle; |
|
163 |
int fontAscent; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
164 |
int rop2; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
165 |
int bitbltrop2; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
166 |
COLORREF fgColor; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
167 |
COLORREF bgColor; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
168 |
HFONT hFont; |
1127 | 169 |
}; |
170 |
||
171 |
/* |
|
172 |
* some synthetic values |
|
173 |
*/ |
|
2151 | 174 |
/***************************************************************** |
175 |
* EVENT DEFINITIONS |
|
176 |
*****************************************************************/ |
|
177 |
||
178 |
/* Input Event Masks. Used as event-mask window attribute and as arguments |
|
179 |
to Grab requests. Not to be confused with event names. */ |
|
180 |
||
181 |
#define NoEventMask 0L |
|
182 |
#define KeyPressMask (1L<<0) |
|
183 |
#define KeyReleaseMask (1L<<1) |
|
184 |
#define ButtonPressMask (1L<<2) |
|
185 |
#define ButtonReleaseMask (1L<<3) |
|
186 |
#define EnterWindowMask (1L<<4) |
|
187 |
#define LeaveWindowMask (1L<<5) |
|
188 |
#define PointerMotionMask (1L<<6) |
|
189 |
#define PointerMotionHintMask (1L<<7) |
|
190 |
#define Button1MotionMask (1L<<8) |
|
191 |
#define Button2MotionMask (1L<<9) |
|
192 |
#define Button3MotionMask (1L<<10) |
|
193 |
#define Button4MotionMask (1L<<11) |
|
194 |
#define Button5MotionMask (1L<<12) |
|
195 |
#define ButtonMotionMask (1L<<13) |
|
196 |
#define KeymapStateMask (1L<<14) |
|
197 |
#define ExposureMask (1L<<15) |
|
198 |
#define VisibilityChangeMask (1L<<16) |
|
199 |
#define StructureNotifyMask (1L<<17) |
|
200 |
#define ResizeRedirectMask (1L<<18) |
|
201 |
#define SubstructureNotifyMask (1L<<19) |
|
202 |
#define SubstructureRedirectMask (1L<<20) |
|
203 |
#define FocusChangeMask (1L<<21) |
|
204 |
#define PropertyChangeMask (1L<<22) |
|
205 |
#define ColormapChangeMask (1L<<23) |
|
206 |
#define OwnerGrabButtonMask (1L<<24) |
|
207 |
||
208 |
/* Event names. Used in "type" field in XEvent structures. Not to be |
|
209 |
confused with event masks above. They start from 2 because 0 and 1 |
|
210 |
are reserved in the protocol for errors and replies. */ |
|
211 |
||
212 |
#define KeyPress 2 |
|
213 |
#define KeyRelease 3 |
|
214 |
#define ButtonPress 4 |
|
215 |
#define ButtonRelease 5 |
|
216 |
#define MotionNotify 6 |
|
217 |
#define EnterNotify 7 |
|
218 |
#define LeaveNotify 8 |
|
219 |
#define FocusIn 9 |
|
220 |
#define FocusOut 10 |
|
221 |
#define KeymapNotify 11 |
|
222 |
#define Expose 12 |
|
223 |
#define GraphicsExpose 13 |
|
224 |
#define NoExpose 14 |
|
225 |
#define VisibilityNotify 15 |
|
226 |
#define CreateNotify 16 |
|
227 |
#define DestroyNotify 17 |
|
228 |
#define UnmapNotify 18 |
|
229 |
#define MapNotify 19 |
|
230 |
#define MapRequest 20 |
|
231 |
#define ReparentNotify 21 |
|
232 |
#define ConfigureNotify 22 |
|
233 |
#define ConfigureRequest 23 |
|
234 |
#define GravityNotify 24 |
|
235 |
#define ResizeRequest 25 |
|
236 |
#define CirculateNotify 26 |
|
237 |
#define CirculateRequest 27 |
|
238 |
#define PropertyNotify 28 |
|
239 |
#define SelectionClear 29 |
|
240 |
#define SelectionRequest 30 |
|
241 |
#define SelectionNotify 31 |
|
242 |
#define ColormapNotify 32 |
|
243 |
#define ClientMessage 33 |
|
244 |
#define MappingNotify 34 |
|
245 |
#define LASTEvent 35 /* must be bigger than any event # */ |
|
246 |
||
247 |
/*# define Button1MotionMask 1 |
|
1127 | 248 |
# define Button2MotionMask 2 |
249 |
# define Button3MotionMask 4 |
|
250 |
||
251 |
# define Button1Mask Button1MotionMask |
|
252 |
# define Button2Mask Button2MotionMask |
|
2151 | 253 |
# define Button3Mask Button3MotionMask*/ |
254 |
||
255 |
/* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer, |
|
256 |
state in various key-, mouse-, and button-related events. */ |
|
257 |
||
258 |
#define ShiftMask (1<<0) |
|
259 |
#define LockMask (1<<1) |
|
260 |
#define ControlMask (1<<2) |
|
261 |
#define Mod1Mask (1<<3) |
|
262 |
#define Mod2Mask (1<<4) |
|
263 |
#define Mod3Mask (1<<5) |
|
264 |
#define Mod4Mask (1<<6) |
|
265 |
#define Mod5Mask (1<<7) |
|
266 |
||
267 |
/* modifier names. Used to build a SetModifierMapping request or |
|
268 |
to read a GetModifierMapping request. These correspond to the |
|
269 |
masks defined above. */ |
|
270 |
#define ShiftMapIndex 0 |
|
271 |
#define LockMapIndex 1 |
|
272 |
#define ControlMapIndex 2 |
|
273 |
#define Mod1MapIndex 3 |
|
274 |
#define Mod2MapIndex 4 |
|
275 |
#define Mod3MapIndex 5 |
|
276 |
#define Mod4MapIndex 6 |
|
277 |
#define Mod5MapIndex 7 |
|
278 |
||
279 |
||
280 |
/* button masks. Used in same manner as Key masks above. Not to be confused |
|
281 |
with button names below. */ |
|
282 |
||
283 |
# define Button1Mask Button1MotionMask |
|
284 |
# define Button2Mask Button2MotionMask |
|
1127 | 285 |
# define Button3Mask Button3MotionMask |
2151 | 286 |
# define Button4Mask Button4MotionMask |
287 |
# define Button5Mask Button5MotionMask |
|
288 |
||
289 |
#define AnyModifier (1<<15) /* used in GrabButton, GrabKey */ |
|
290 |
||
291 |
||
292 |
/* button names. Used as arguments to GrabButton and as detail in ButtonPress |
|
293 |
and ButtonRelease events. Not to be confused with button masks above. |
|
294 |
Note that 0 is already defined above as "AnyButton". */ |
|
295 |
||
296 |
#define Button1 1 |
|
297 |
#define Button2 2 |
|
298 |
#define Button3 3 |
|
299 |
#define Button4 4 |
|
300 |
#define Button5 5 |
|
301 |
||
302 |
/*# define ControlMask 8 |
|
303 |
# define ShiftMask 16*/ |
|
304 |
# define LeftAltMask Mod1Mask |
|
305 |
# define RightAltMask Mod2Mask |
|
306 |
# define TRANSLATED_KEY Mod5Mask |
|
307 |
||
308 |
#define WIN32PADDING 32 |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
309 |
/* |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
310 |
* synthetic events |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
311 |
*/ |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
312 |
#define __WM_MOUSEENTER 0x10001 |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
313 |
#define __WM_MOUSELEAVE 0x10002 |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
314 |
#define __WM_GEXPOSE 0x10003 |
2232 | 315 |
#define __WM_NOGEXPOSE 0x10004 |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
316 |
|
1920 | 317 |
static int AltMask = RightAltMask; |
318 |
static int MetaMask = LeftAltMask; |
|
1127 | 319 |
|
320 |
# define WhitePixel RGB(0xFF, 0xFF, 0xFF) |
|
321 |
# define BlackPixel RGB(0, 0, 0) |
|
322 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
323 |
/*#undef DEBUG*/ |
1127 | 324 |
#ifdef DEBUG |
2232 | 325 |
# define PRINTF(x) { printf x;} |
326 |
# define CPRINTF(x) { if (__debug__) printf x;} |
|
2253 | 327 |
# define RESPRINTF(x) /*{ if (__debug__) printf x;}*/ |
328 |
# define RES1PRINTF(x) /*{ if (__debug__) printf x;}*/ |
|
329 |
# 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
|
330 |
# define TH_DPRINTF(x) /*{ if (__debug__) printf x;}*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
331 |
# define POSTPRINTF(x) { if (__debug__) printf x;} |
1920 | 332 |
# define DPRINTF(x) { if (__debug__) printf x;} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
333 |
# define DDPRINTF(x) /*{ if (__debug__) printf x;}*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
334 |
# define EVENT_PRINTF(x) /*{ if (__debug__) printf x;}*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
335 |
# define EVENT_PRINTF2(x) /*{ if (__debug__) printf x;}*/ |
1705 | 336 |
# define EVENT_PRINTF3(x) /* */ |
1127 | 337 |
#else |
2151 | 338 |
# define PRINTF(x) /* */ |
2232 | 339 |
# define CPRINTF(x) /* */ |
340 |
# define RES_BMP_PRINTF(x) /**/ |
|
341 |
# define RESPRINTF(x) /* */ |
|
342 |
# define RES1PRINTF(x) /* */ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
343 |
# define TH_DPRINTF(x) /* */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
344 |
# define POSTDPRINTF(x) /* */ |
1127 | 345 |
# define DPRINTF(x) /* */ |
346 |
# define DDPRINTF(x) /* */ |
|
347 |
# define EVENT_PRINTF(x) /* */ |
|
348 |
# define EVENT_PRINTF2(x) /* */ |
|
1705 | 349 |
# define EVENT_PRINTF3(x) /* */ |
1127 | 350 |
#endif |
351 |
||
352 |
# define BR_SOLID 0 |
|
353 |
# define BR_PATTERN 1 |
|
354 |
||
355 |
# define LINE_SOLID 0 |
|
356 |
# define LINE_DASH 1 |
|
357 |
# define LINE_DDASH 2 |
|
358 |
||
1685 | 359 |
#ifdef KEEP_STD_CURSORS |
1127 | 360 |
# define _C_ARROW 1 |
361 |
# define _C_CROSS 2 |
|
362 |
# define _C_IBEAM 3 |
|
363 |
# define _C_ICON 4 |
|
364 |
# define _C_NO 5 |
|
365 |
# define _C_SIZE 6 |
|
366 |
# define _C_SIZEALL 7 |
|
367 |
# define _C_SIZENESW 8 |
|
368 |
# define _C_SIZENS 9 |
|
369 |
# define _C_SIZENWSE 10 |
|
370 |
# define _C_UPARROW 11 |
|
371 |
# define _C_WAIT 12 |
|
372 |
||
1685 | 373 |
static HCURSOR H_C_ARROW = (HCURSOR)0; |
374 |
static HCURSOR H_C_CROSS = (HCURSOR)0; |
|
375 |
static HCURSOR H_C_IBEAM = (HCURSOR)0; |
|
376 |
static HCURSOR H_C_ICON = (HCURSOR)0; |
|
377 |
static HCURSOR H_C_NO = (HCURSOR)0; |
|
378 |
static HCURSOR H_C_SIZE = (HCURSOR)0; |
|
379 |
static HCURSOR H_C_SIZEALL = (HCURSOR)0; |
|
380 |
static HCURSOR H_C_SIZENESW = (HCURSOR)0; |
|
381 |
static HCURSOR H_C_SIZENS = (HCURSOR)0; |
|
382 |
static HCURSOR H_C_SIZENWSE = (HCURSOR)0; |
|
383 |
static HCURSOR H_C_UPARROW = (HCURSOR)0; |
|
384 |
static HCURSOR H_C_WAIT = (HCURSOR)0; |
|
385 |
#endif /* KEEP_STD_CURSORS */ |
|
1127 | 386 |
|
2232 | 387 |
static int c_count; |
1127 | 388 |
static int evRootX, evRootY; |
2151 | 389 |
static int multiClickState; |
390 |
static UINT lastMSGTime; |
|
391 |
static UINT multiClickTime; |
|
392 |
static UINT nextMultiClickTime; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
393 |
static int destroyWin; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
394 |
static int __modifiers; |
2151 | 395 |
static HDC tmpDC; |
2232 | 396 |
static int __isWinNT; |
397 |
static int __logPixelSY; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
398 |
#define WM_THREADCREATEWINDOW WM_USER + 0x101 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
399 |
#define WM_THREADDESTROYWINDOW WM_USER + 0x102 |
2232 | 400 |
#define WM_THREADSETFOCUS WM_USER + 0x103 |
401 |
#define WM_THREADSETCAPTURE WM_USER + 0x104 |
|
2247 | 402 |
#define WM_THREADSETCURSOR WM_USER + 0x105 |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
403 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
404 |
#define THREADINPUTEVENTNAME "InputEvents" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
405 |
#define THREADEVENTNAME "CreateEvents" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
406 |
#define THREADMUTEXNAME "MutexToProtectEvents" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
407 |
#define isInputEvent() ((int)eventQueueHead) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
408 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
409 |
typedef int (*intf)(int); |
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 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
412 |
* 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
|
413 |
*/ |
2151 | 414 |
#define LI_TOPWIN 0x0001 |
415 |
#define LI_INPUTWIN 0x0002 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
416 |
typedef struct |
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 |
HCURSOR hCursor; |
2232 | 419 |
int bgBrush; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
420 |
int flag; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
421 |
int minWidth; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
422 |
int maxWidth; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
423 |
int minHeight; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
424 |
int maxHeight; |
2151 | 425 |
int eventMask; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
426 |
} localWindowInfo; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
427 |
typedef localWindowInfo *plocalWindowInfo; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
428 |
#define N_WINDOW_PRIVATE (sizeof(plocalWindowInfo)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
429 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
430 |
#define GETLOCALWINDOWINFOPTR(__hWnd__) \ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
431 |
((localWindowInfo*)GetWindowLong(__hWnd__, 0)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
432 |
#define SETLOCALWINDOWINFOPTR(__hWnd__,__ptr__) \ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
433 |
SetWindowLong(__hWnd__, 0 , (DWORD)__ptr__) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
434 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
435 |
#define SetWindow_Cursor(__hWnd__, __hCurs__) \ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
436 |
(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor = __hCurs__) : 0) |
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 GetWindow_Cursor(__hWnd__) \ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
439 |
(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor : 0) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
440 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
441 |
#define SetWindow_bgBrush(__hWnd__, __bgBrush__) \ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
442 |
(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->bgBrush = __bgBrush__) : 0) |
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 GetWindow_bgBrush(__hWnd__) \ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
445 |
(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->bgBrush : 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_paintInfoPtr(__hWnd__) \ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
448 |
(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->paintInfo) : 0) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
449 |
#define GetWindow_sizeInfoPtr(__hWnd__) \ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
450 |
(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->sizeInfo) : 0) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
451 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
452 |
#define SetWindow_Flag(__hWnd__, __flag__) \ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
453 |
(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->flag = __flag__) : 0) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
454 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
455 |
#define GetWindow_Flag(__hWnd__) \ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
456 |
(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->flag : 0) |
1127 | 457 |
|
2151 | 458 |
#define GetWindow_eventMask(__hWnd__) \ |
459 |
(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->eventMask) : 0) |
|
460 |
||
1127 | 461 |
struct queuedEvent { |
462 |
struct queuedEvent *ev_next; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
463 |
int count; |
2232 | 464 |
int ev_flag; |
1127 | 465 |
HWND ev_hWnd; |
466 |
UINT ev_message; |
|
467 |
UINT ev_wParam; |
|
468 |
int ev_arg1; |
|
469 |
int ev_arg2; |
|
470 |
int ev_arg3; |
|
471 |
int ev_arg4; |
|
472 |
}; |
|
473 |
||
474 |
#define ev_x ev_arg1 |
|
475 |
#define ev_y ev_arg2 |
|
476 |
#define ev_w ev_arg3 |
|
477 |
#define ev_h ev_arg4 |
|
478 |
||
479 |
#define ev_keyCode ev_wParam |
|
480 |
#define ev_scanCode ev_arg3 |
|
481 |
#define ev_modifiers ev_arg4 |
|
482 |
||
2232 | 483 |
#define EV_CHUNK_CNT 10000 |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
484 |
#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
|
485 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
486 |
#define BITBLT_COPY SRCCOPY |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
487 |
#define BITBLT_COPYINVERTED NOTSRCCOPY |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
488 |
#define BITBLT_XOR SRCINVERT |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
489 |
#define BITBLT_AND SRCAND |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
490 |
#define BITBLT_OR SRCPAINT |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
491 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
492 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
493 |
%} |
2232 | 494 |
! ! |
495 |
||
496 |
!WinWorkstation primitiveVariables! |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
497 |
%{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
498 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
499 |
static int firstInstance = 1; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
500 |
static char *app_name = "ST/X"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
501 |
static char *app_nameroot = "ST/X:Root"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
502 |
static int __debug__ = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
503 |
static int __depth; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
504 |
static HWND __rootWin = NULL; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
505 |
static HWND __rootWinSpezial = NULL; |
2232 | 506 |
static HDESK __rootDesk; |
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 |
#define CAPTURE_NONE 0 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
509 |
#define CAPTURE_EXPLICIT 1 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
510 |
#define CAPTURE_IMPLICIT 2 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
511 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
512 |
static int currentCapture = CAPTURE_NONE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
513 |
static int lastNCMouseX, lastNCMouseY; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
514 |
static int lastMoveX, lastMoveY, lastSizeWidth, lastSizeHeight; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
515 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
516 |
static HANDLE currentPointerView = (HANDLE)0; |
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 |
/* MessageDispatchThread */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
519 |
static char *_thread_windowName; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
520 |
static char *_thread_className; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
521 |
static int _thread_winStyleBits; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
522 |
static int _thread_winStyleBitsEx; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
523 |
static HANDLE _thread_parentHandle; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
524 |
static int _thread_x; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
525 |
static int _thread_y; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
526 |
static int _thread_dx; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
527 |
static int _thread_dy; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
528 |
static localWindowInfo *_thread_local; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
529 |
static HANDLE _thread_newWinHandle; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
530 |
static DWORD _masterThreadId; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
531 |
static HANDLE _masterThread; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
532 |
static DWORD _dispatchThreadId; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
533 |
static BOOL bdispatchThreadState; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
534 |
static int lockcount; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
535 |
static HANDLE hdispatchMutex; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
536 |
static HANDLE hCreateEvent; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
537 |
static HANDLE hInputEvent; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
538 |
|
2232 | 539 |
static int __cnt_bmpdc; |
540 |
static int __cnt_gcData; |
|
541 |
static int __cnt_createWindows; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
542 |
static int __cnt_bitmap; |
2232 | 543 |
static int __cnt_cur; |
544 |
static int __cnt_font; |
|
1127 | 545 |
struct queuedEvent *eventFreeList = (struct queuedEvent *)0; |
546 |
struct queuedEvent *eventQueueHead = (struct queuedEvent *)0; |
|
547 |
struct queuedEvent *eventQueueTail = (struct queuedEvent *)0; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
548 |
static int eventsendcount = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
549 |
static int eventempfcount = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
550 |
%} |
2232 | 551 |
! ! |
552 |
||
553 |
!WinWorkstation primitiveFunctions! |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
554 |
%{ |
2253 | 555 |
#ifdef xxWIN32THREADS |
2232 | 556 |
extern void __suspendAktThread(); |
557 |
extern void __resumeAktThread(); |
|
558 |
#endif |
|
1127 | 559 |
|
1705 | 560 |
__debugEvent__() {} |
2151 | 561 |
#ifdef DEBUGMASK |
562 |
printMask(int mask) |
|
563 |
{ |
|
564 |
if (mask & KeyPressMask) printf("KeyPressMask\n"); |
|
565 |
if (mask & KeyReleaseMask) printf("KeyReleaseMask\n"); |
|
566 |
if (mask & ButtonPressMask) printf("ButtonPressMask\n"); |
|
567 |
if (mask & ButtonReleaseMask) printf("ButtonReleaseMask\n"); |
|
568 |
if (mask & ButtonMotionMask) printf("ButtonMotionMask\n"); |
|
569 |
if (mask & PointerMotionMask) printf("PointerMotionMask\n"); |
|
570 |
if (mask & ExposureMask) printf("ExposureMask\n"); |
|
571 |
if (mask & FocusChangeMask) printf("FocusChangeMask\n"); |
|
572 |
if (mask & EnterWindowMask) printf("EnterWindowMask\n"); |
|
573 |
if (mask & LeaveWindowMask) printf("LeaveWindowMask\n"); |
|
574 |
if (mask & KeymapStateMask) printf("KeymapStateMask\n"); |
|
575 |
if (mask & VisibilityChangeMask)printf("VisibilityChangeMask\n"); |
|
576 |
if (mask & StructureNotifyMask) printf("StructureNotifyMask\n"); |
|
577 |
if (mask & ResizeRedirectMask) printf("ResizeRedirectMask\n"); |
|
578 |
if (mask & PropertyChangeMask) printf("PropertyChangeMask\n"); |
|
579 |
if (mask & ColormapChangeMask) printf("ColormapChangeMask\n"); |
|
580 |
} |
|
581 |
#endif |
|
582 |
static int st2RGB(int color,struct gcData *gcData) |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
583 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
584 |
int ir,ig,ib; |
2151 | 585 |
if (gcData) |
586 |
{ |
|
587 |
if (gcData->bitmapColorBitCount == 1) |
|
588 |
{ |
|
589 |
if (color) |
|
590 |
return WhitePixel; |
|
591 |
else |
|
592 |
return BlackPixel; |
|
593 |
} |
|
594 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
595 |
if (__depth < 15) |
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 |
return 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
598 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
599 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
600 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
601 |
if ((__depth == 16) || (__depth == 15)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
602 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
603 |
ib = (color & 0x1f) << 3; |
2232 | 604 |
ig = ((color >> 5) & 0x3f) << 2; |
605 |
ir = ((color >> 11) & 0x1f) << 3; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
606 |
ir |= 7; |
2232 | 607 |
ig |= 3; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
608 |
ib |= 7; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
609 |
return RGB(ir,ig,ib); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
610 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
611 |
return color; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
612 |
} |
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 |
static int RGB2st(int r,int g,int b) |
1127 | 615 |
{ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
616 |
int ir,ig,ib,id; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
617 |
if (__depth < 15) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
618 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
619 |
id = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
620 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
621 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
622 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
623 |
if ((__depth == 16) || (__depth == 15)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
624 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
625 |
ir = (r >> 11) & 0x1f; |
2232 | 626 |
ig = (g >> 10) & 0x3f; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
627 |
ib = (b >> 11) & 0x1f; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
628 |
|
2232 | 629 |
id = ( ir << 11 ) | ( ig << 5 ) | ib; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
630 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
631 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
632 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
633 |
ir = (r >> 8) & 0xff; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
634 |
ig = (g >> 8) & 0xff; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
635 |
ib = (b >> 8) & 0xff; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
636 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
637 |
id = RGB( ir, ig, ib); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
638 |
} |
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 |
return id; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
641 |
} |
2151 | 642 |
static int DelObject(HANDLE o) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
643 |
{ |
2151 | 644 |
int r = DeleteObject(o); |
645 |
if (r == 0) |
|
646 |
printf("ERROR in DelObjectect\n"); |
|
647 |
return r; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
648 |
} |
2232 | 649 |
static struct gcData *newGcData() |
650 |
{ |
|
651 |
struct gcData *gcData = (struct gcData *)malloc(sizeof(struct gcData)); |
|
652 |
if (! gcData) { |
|
653 |
return 0; |
|
654 |
} |
|
655 |
memset(gcData,0,sizeof(struct gcData)); |
|
656 |
gcData->bgColor = 0xffffff; |
|
657 |
gcData->clipping = FALSE; |
|
658 |
gcData->clipByChild = TRUE; |
|
659 |
gcData->bitbltrop2 = BITBLT_COPY; |
|
660 |
gcData->lineWidth = 1; |
|
661 |
gcData->lineStyle = PS_SOLID; |
|
662 |
gcData->joinStyle = PS_JOIN_MITER; |
|
663 |
gcData->capStyle = PS_ENDCAP_FLAT; |
|
664 |
return gcData; |
|
665 |
} |
|
666 |
static HDC _getDC(struct gcData *gcData) |
|
667 |
{ |
|
668 |
if (gcData->hWnd != 0) |
|
669 |
{ |
|
670 |
if (__isWinNT && (gcData->hWnd == __rootWin)) |
|
671 |
{ |
|
672 |
gcData->_hDC = GetDCEx(gcData->hWnd,0,DCX_WINDOW); |
|
673 |
//gcData->_hDC = GetDC(gcData->hWnd); |
|
674 |
} |
|
675 |
else |
|
676 |
{ |
|
677 |
if (gcData->clipByChild) |
|
678 |
{ |
|
679 |
//gcData->_hDC = GetDCEx(gcData->hWnd,0,DCX_CLIPCHILDREN); |
|
680 |
gcData->_hDC = GetDC(gcData->hWnd); |
|
681 |
} |
|
682 |
else |
|
683 |
gcData->_hDC = GetDCEx(gcData->hWnd,0,DCX_PARENTCLIP); |
|
684 |
} |
|
685 |
} |
|
686 |
else if (gcData->hBitmap) |
|
687 |
{ |
|
688 |
gcData->_hDC = CreateCompatibleDC(tmpDC); |
|
689 |
gcData->savehBitmap = SelectObject(gcData->_hDC,gcData->hBitmap); |
|
690 |
} |
|
691 |
if (gcData->_hDC) |
|
692 |
{ |
|
693 |
SetTextColor(gcData->_hDC, gcData->bgColor); |
|
694 |
SetBkColor(gcData->_hDC, gcData->fgColor); |
|
695 |
if (gcData->rop2) |
|
696 |
SetROP2(gcData->_hDC, gcData->rop2); |
|
697 |
if (gcData->clipping) |
|
698 |
{ |
|
699 |
HRGN region = CreateRectRgn( gcData->clipX,gcData->clipY, |
|
700 |
gcData->clipX + gcData->clipW, |
|
701 |
gcData->clipY + gcData->clipH ); |
|
702 |
if( region == NULL ) |
|
703 |
{ |
|
704 |
DPRINTF((" clipping region creation failed!\n")); |
|
705 |
} |
|
706 |
else |
|
707 |
{ |
|
708 |
if (SelectClipRgn(gcData->_hDC, region) == ERROR ) |
|
709 |
{ |
|
710 |
DPRINTF((" clipping region release unsuccessful\n" )); |
|
711 |
} |
|
712 |
/*printf("%x c\n",hDC);*/ |
|
713 |
DelObject(region); |
|
714 |
} |
|
715 |
} |
|
716 |
} |
|
717 |
return gcData->_hDC; |
|
718 |
} |
|
719 |
static void _releaseDC(struct gcData *gcData) |
|
720 |
{ |
|
721 |
if (gcData->hWnd) |
|
722 |
{ |
|
723 |
if (gcData->_hDC) |
|
724 |
{ |
|
725 |
ReleaseDC(gcData->hWnd,gcData->_hDC); |
|
726 |
} |
|
727 |
} |
|
728 |
else if (gcData->hBitmap) |
|
729 |
{ |
|
730 |
SelectObject(gcData->_hDC,gcData->savehBitmap); |
|
731 |
DeleteDC(gcData->_hDC); |
|
732 |
} |
|
733 |
gcData->_hDC = 0; |
|
734 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
735 |
static HBRUSH GcDataGetBrush(HDC hDC,struct gcData *gcData) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
736 |
{ |
2232 | 737 |
HBRUSH hBrush = 0; |
738 |
if (gcData->hMask) |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
739 |
{ |
2232 | 740 |
hBrush = CreatePatternBrush(gcData->hMask); |
741 |
RESPRINTF(("CreatePatternBrush %x\n",gcData->hMask)); |
|
742 |
} |
|
743 |
else |
|
744 |
{ |
|
745 |
hBrush = CreateSolidBrush(gcData->fgColor); |
|
746 |
RESPRINTF(("CreateSolidBrush %x\n",gcData->fgColor)); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
747 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
748 |
return hBrush; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
749 |
} |
2151 | 750 |
static HPEN GcDataGetPen(HDC hDC,struct gcData *gcData) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
751 |
{ |
2232 | 752 |
HPEN hPen = 0; |
2151 | 753 |
LOGBRUSH Brush; |
754 |
||
2232 | 755 |
if (gcData->hMask) |
2151 | 756 |
{ |
2232 | 757 |
Brush.lbStyle = BS_PATTERN; |
758 |
Brush.lbHatch = (DWORD)gcData->hMask; |
|
759 |
Brush.lbColor = gcData->fgColor; |
|
760 |
hPen = ExtCreatePen(PS_GEOMETRIC | gcData->capStyle | gcData->joinStyle | gcData->lineStyle, |
|
761 |
gcData->lineWidth, |
|
762 |
&Brush, |
|
763 |
0,0); |
|
764 |
RESPRINTF(("ExtCreatePen %s %d %x %x\n",(gcData->lineStyle == PS_SOLID) ? "SOLID " : "DASHED", |
|
765 |
gcData->lineWidth, |
|
766 |
gcData->fgColor,gcData->hMask)); |
|
767 |
} |
|
768 |
if (!hPen) |
|
769 |
{ |
|
770 |
if (gcData->lineStyle == PS_SOLID) |
|
771 |
hPen = CreatePen(gcData->lineStyle, |
|
772 |
gcData->lineWidth, |
|
773 |
gcData->fgColor); |
|
774 |
else |
|
775 |
hPen = CreatePen(PS_DOT, |
|
776 |
0, |
|
777 |
0); |
|
778 |
RESPRINTF(("CreatePen %s %d %x\n",(gcData->lineStyle == PS_SOLID) ? "SOLID " : "DASHED", |
|
779 |
gcData->lineWidth, |
|
780 |
gcData->fgColor)); |
|
2151 | 781 |
} |
782 |
return hPen; |
|
1127 | 783 |
} |
784 |
||
785 |
static |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
786 |
int lockEvent() |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
787 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
788 |
DWORD dwWaitResult; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
789 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
790 |
/* Request ownership of mutex. */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
791 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
792 |
dwWaitResult = WaitForSingleObject( |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
793 |
hdispatchMutex, /* handle of mutex */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
794 |
5000L); /* time-out interval */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
795 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
796 |
lockcount++; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
797 |
if (lockcount != 1) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
798 |
{ |
2232 | 799 |
printf("WINWORKSTATION:lockcount != 1 :=%d\n",lockcount); |
800 |
lockcount = 1; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
801 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
802 |
switch (dwWaitResult) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
803 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
804 |
// The thread got mutex ownership. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
805 |
case WAIT_OBJECT_0: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
806 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
807 |
// Cannot get mutex ownership due to time-out. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
808 |
case WAIT_TIMEOUT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
809 |
printf("lockEvent fail\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
810 |
return FALSE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
811 |
// Got ownership of the abandoned mutex object. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
812 |
default: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
813 |
return FALSE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
814 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
815 |
return TRUE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
816 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
817 |
void unlockEvent() |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
818 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
819 |
if (lockcount != 1) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
820 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
821 |
printf("lockcount != 1 :=%d\n",lockcount); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
822 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
823 |
lockcount--; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
824 |
/* Release ownership of the mutex object. */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
825 |
if (! ReleaseMutex(hdispatchMutex)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
826 |
/* Deal with error. */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
827 |
printf("unlock Error\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
828 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
829 |
} |
2232 | 830 |
static int initqueue() |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
831 |
{ |
2232 | 832 |
struct queuedEvent *bulk; |
833 |
int i = 0; |
|
834 |
bulk = (struct queuedEvent *) malloc(EV_CHUNK_SZ); |
|
835 |
if (bulk == 0) |
|
836 |
{ |
|
837 |
printf("no memory for dispatchqueue\n"); |
|
838 |
return 0; |
|
839 |
} |
|
840 |
for (i=1; i<EV_CHUNK_CNT; i++) { |
|
2244 | 841 |
bulk[i-1].ev_next = &(bulk[i]); |
2232 | 842 |
} |
843 |
bulk[EV_CHUNK_CNT-1].ev_next = (struct queuedEvent *)0; |
|
844 |
eventFreeList = bulk; |
|
845 |
return 1; |
|
2000
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 |
static |
2232 | 848 |
void 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
|
849 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
850 |
struct queuedEvent *ev = 0; |
2232 | 851 |
int repeatCount = 0; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
852 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
853 |
TH_DPRINTF(("TEW\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
854 |
if (lockEvent()) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
855 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
856 |
TH_DPRINTF(("TEF\n")); |
2232 | 857 |
again: |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
858 |
ev = eventFreeList; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
859 |
if (ev) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
860 |
eventFreeList = ev->ev_next; |
2244 | 861 |
ev->ev_next = (struct queuedEvent *)0; |
862 |
||
863 |
ev->count = eventsendcount++; |
|
864 |
ev->ev_flag = flag; |
|
865 |
ev->ev_hWnd = hWnd; |
|
866 |
ev->ev_message = message; |
|
867 |
ev->ev_wParam = wParam; |
|
868 |
ev->ev_arg1 = arg1; |
|
869 |
ev->ev_arg2 = arg2; |
|
870 |
ev->ev_arg3 = arg3; |
|
871 |
ev->ev_arg4 = arg4; |
|
872 |
||
873 |
if (eventQueueTail) { |
|
874 |
eventQueueTail->ev_next = ev; |
|
875 |
} else { |
|
876 |
eventQueueHead = ev; |
|
877 |
} |
|
878 |
eventQueueTail = ev; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
879 |
} else { |
2244 | 880 |
|
881 |
unlockEvent(); |
|
2253 | 882 |
SetEvent(hInputEvent); |
883 |
printf("winthread wait\n"); |
|
2244 | 884 |
if (repeatCount++ < 10) |
885 |
{ |
|
886 |
Sleep(20); |
|
887 |
if (lockEvent()) |
|
888 |
{ |
|
889 |
goto again; |
|
890 |
} |
|
891 |
} |
|
2253 | 892 |
printf("winthread throw away\n"); |
2244 | 893 |
/* throw away sorry */ |
894 |
return; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
895 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
896 |
|
2232 | 897 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
898 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
899 |
unlockEvent(); |
2253 | 900 |
SetEvent(hInputEvent); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
901 |
/*SetThreadPriority(_masterThread,THREAD_PRIORITY_HIGHEST);*/ |
2253 | 902 |
//Sleep(0); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
903 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
904 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
905 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
906 |
static |
2232 | 907 |
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
|
908 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
909 |
struct queuedEvent *ev = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
910 |
|
2232 | 911 |
if (mask != ~0) |
912 |
{ |
|
2240 | 913 |
PRINTF(("deqEvent mask:%x\n",mask)); |
2232 | 914 |
} |
915 |
if (hWnd) |
|
916 |
{ |
|
2240 | 917 |
PRINTF(("deqEvent hWnd:%x\n",hWnd)); |
2232 | 918 |
} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
919 |
if (lockEvent()) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
920 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
921 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
922 |
while (TRUE) |
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 |
TH_DPRINTF(("TDEQ\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
925 |
ev = eventQueueHead; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
926 |
if (ev) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
927 |
{ |
1127 | 928 |
eventQueueHead = ev->ev_next; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
929 |
if (! eventQueueHead) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
930 |
{ |
1127 | 931 |
eventQueueTail = (struct queuedEvent *)0; |
932 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
933 |
if (eventempfcount != ev->count) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
934 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
935 |
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
|
936 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
937 |
eventempfcount++; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
938 |
if (ev->ev_message == WM_DESTROY) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
939 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
940 |
if (ev->ev_arg1) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
941 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
942 |
if (UnregisterClass((char*)ev->ev_arg1,(HANDLE) __getHInstance())) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
943 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
944 |
/*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
|
945 |
free((char*)ev->ev_arg1); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
946 |
ev->ev_arg1 = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
947 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
948 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
949 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
950 |
/* noch einmal in die queue */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
951 |
if (ev->ev_arg2++ < 100) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
952 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
953 |
ev->ev_next = (struct queuedEvent *)0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
954 |
ev->count = eventsendcount++; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
955 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
956 |
if (eventQueueTail) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
957 |
eventQueueTail->ev_next = ev; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
958 |
} else { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
959 |
eventQueueHead = ev; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
960 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
961 |
eventQueueTail = ev; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
962 |
if (ev->ev_arg2 > 98) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
963 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
964 |
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
|
965 |
unlockEvent(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
966 |
sleep(1); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
967 |
lockEvent(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
968 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
969 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
970 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
971 |
unlockEvent(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
972 |
sleep(0); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
973 |
lockEvent(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
974 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
975 |
continue; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
976 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
977 |
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
|
978 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
979 |
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
|
980 |
free((char*)ev->ev_arg1); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
981 |
ev->ev_arg1 = 0; |
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 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
984 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
985 |
} |
2232 | 986 |
break; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
987 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
988 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
989 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
990 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
991 |
} |
2232 | 992 |
if (ev) |
993 |
{ |
|
994 |
*ret_ev = *ev; |
|
995 |
ev->ev_next = eventFreeList; |
|
996 |
eventFreeList = ev; |
|
997 |
} |
|
2000
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 |
unlockEvent(); |
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 |
/*if (!ev) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1002 |
SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_NORMAL);*/ |
2232 | 1003 |
return (ev != 0); |
1127 | 1004 |
} |
1005 |
||
1006 |
static |
|
1007 |
getModifiers() |
|
1008 |
{ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1009 |
int modifiers = 0; |
1127 | 1010 |
if (GetKeyState(VK_SHIFT) & 0x8000) |
1011 |
modifiers |= ShiftMask; |
|
1012 |
if (GetKeyState(VK_CONTROL) & 0x8000) |
|
1013 |
modifiers |= ControlMask; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1014 |
#if 0 |
1127 | 1015 |
if (GetKeyState(VK_RMENU) & 0x8000) |
1016 |
modifiers |= RightAltMask; |
|
1017 |
if (GetKeyState(VK_LMENU) & 0x8000) |
|
1018 |
modifiers |= LeftAltMask; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1019 |
#else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1020 |
if (GetKeyState(VK_MENU) & 0x8000) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1021 |
modifiers |= LeftAltMask; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1022 |
#endif |
1127 | 1023 |
if (GetKeyState(VK_LBUTTON) & 0x8000) |
1024 |
modifiers |= Button1Mask; |
|
1025 |
if (GetKeyState(VK_MBUTTON) & 0x8000) |
|
1026 |
modifiers |= Button2Mask; |
|
1027 |
if (GetKeyState(VK_RBUTTON) & 0x8000) |
|
1028 |
modifiers |= Button3Mask; |
|
1029 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1030 |
__modifiers = modifiers; |
1127 | 1031 |
return modifiers; |
1032 |
} |
|
1033 |
||
1034 |
static |
|
1035 |
winEventProcessing(hWnd, message, wParam, lParam, pDefault) |
|
1036 |
HWND hWnd; /* window handle */ |
|
1037 |
UINT message; /* type of message */ |
|
1038 |
UINT wParam; /* additional information */ |
|
1039 |
LONG lParam; /* additional information */ |
|
1040 |
int *pDefault; |
|
1041 |
{ |
|
1042 |
LPMINMAXINFO lpmmi; |
|
1043 |
WINDOWPOS *posStruct; |
|
1723 | 1044 |
RECT rct; |
1045 |
RECT upd; |
|
1127 | 1046 |
int modifiers; |
1047 |
int x, y, w, h; |
|
1723 | 1048 |
int isNative = 0; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1049 |
PAINTSTRUCT ps; |
1127 | 1050 |
|
1051 |
/* |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1052 |
EVENT_PRINTF(("winEvent hWin=0x%x message=0x%x wP=0x%x lP=0x%x\n", |
1127 | 1053 |
hWnd, message, wParam, lParam)); |
1054 |
*/ |
|
1055 |
||
1056 |
||
1057 |
/* |
|
1058 |
* messages which are enqueued to be handled by the view thread |
|
1059 |
*/ |
|
1060 |
switch (message) { |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1061 |
case WM_CREATE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1062 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1063 |
CREATESTRUCT *lpcs = (LPCREATESTRUCT) lParam; // structure with creation data |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1064 |
SETLOCALWINDOWINFOPTR(hWnd,lpcs->lpCreateParams); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1065 |
if (GETLOCALWINDOWINFOPTR(hWnd) != lpcs->lpCreateParams) |
2232 | 1066 |
PRINTF(("SETLOCALWINDOWINFOPTR ERROR\n")); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1067 |
*pDefault = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1068 |
#ifdef COUNT_RESOURCES |
2232 | 1069 |
__cnt_createWindows++; |
1070 |
RESPRINTF(("CreateWindows %d\n",__cnt_createWindows)); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1071 |
#endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1072 |
DPRINTF(("WM_CREATE\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1073 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1074 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1075 |
case WM_CLOSE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1076 |
DPRINTF(("WM_CLOSE\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1077 |
if (!destroyWin) |
2232 | 1078 |
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
|
1079 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1080 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1081 |
destroyWin = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1082 |
if (!DestroyWindow(hWnd)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1083 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1084 |
DPRINTF(("DestroyWindow ERROR\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1085 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1086 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1087 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1088 |
*pDefault = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1089 |
return 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1090 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1091 |
case WM_DESTROY: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1092 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1093 |
char *n = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1094 |
DPRINTF(("WM_DESTROY\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1095 |
if (GETLOCALWINDOWINFOPTR(hWnd)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1096 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1097 |
if (GETLOCALWINDOWINFOPTR(hWnd)->flag & LI_TOPWIN) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1098 |
{ |
2253 | 1099 |
#if 0 |
2247 | 1100 |
#ifdef WIN32THREADS |
1101 |
__suspendAktThread(); |
|
1102 |
#else |
|
1103 |
SuspendThread(_masterThread); |
|
1104 |
#endif |
|
2253 | 1105 |
#endif |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1106 |
n = (char*)malloc(200); |
2253 | 1107 |
#if 0 |
2247 | 1108 |
#ifdef WIN32THREADS |
1109 |
__resumeAktThread(); |
|
1110 |
#else |
|
1111 |
ResumeThread(_masterThread); |
|
1112 |
#endif |
|
2253 | 1113 |
#endif |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1114 |
GetClassName(hWnd,n,200); |
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 |
#ifdef COUNT_RESOURCES |
2232 | 1117 |
__cnt_createWindows--; |
1118 |
RESPRINTF(("DestroyWindows %d\n",__cnt_createWindows)); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1119 |
#endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1120 |
/* free all resources */ |
2232 | 1121 |
/*if (GetWindow_bgBrush(hWnd)) |
1122 |
DelObject(GetWindow_bgBrush(hWnd));*/ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1123 |
free(GETLOCALWINDOWINFOPTR(hWnd)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1124 |
SETLOCALWINDOWINFOPTR(hWnd,0); |
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 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1127 |
|
2232 | 1128 |
enqEvent(0,hWnd, message, wParam, (int)n, 0, 0, 0); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1129 |
*pDefault = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1130 |
return 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1131 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1132 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1133 |
case WM_GETMINMAXINFO: |
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 |
lpmmi = (LPMINMAXINFO) lParam; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1136 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1137 |
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
|
1138 |
hWnd, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1139 |
lpmmi->ptMinTrackSize.x, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1140 |
lpmmi->ptMinTrackSize.y)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1141 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1142 |
if (GETLOCALWINDOWINFOPTR(hWnd) && |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1143 |
GETLOCALWINDOWINFOPTR(hWnd)->minWidth && |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1144 |
GETLOCALWINDOWINFOPTR(hWnd)->maxWidth |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1145 |
) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1146 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1147 |
lpmmi->ptMaxSize.x = GETLOCALWINDOWINFOPTR(hWnd)->maxWidth; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1148 |
lpmmi->ptMaxSize.y = GETLOCALWINDOWINFOPTR(hWnd)->maxHeight; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1149 |
lpmmi->ptMaxTrackSize.x = GETLOCALWINDOWINFOPTR(hWnd)->maxWidth; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1150 |
lpmmi->ptMaxTrackSize.y = GETLOCALWINDOWINFOPTR(hWnd)->maxHeight; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1151 |
lpmmi->ptMinTrackSize.x = GETLOCALWINDOWINFOPTR(hWnd)->minWidth; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1152 |
lpmmi->ptMinTrackSize.y = GETLOCALWINDOWINFOPTR(hWnd)->minHeight; |
2151 | 1153 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1154 |
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
|
1155 |
hWnd, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1156 |
GETLOCALWINDOWINFOPTR(hWnd)->minWidth, GETLOCALWINDOWINFOPTR(hWnd)->minHeight, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1157 |
GETLOCALWINDOWINFOPTR(hWnd)->maxWidth, GETLOCALWINDOWINFOPTR(hWnd)->maxHeight)); |
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 |
*pDefault = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1160 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1161 |
break; |
1127 | 1162 |
case WM_SETCURSOR: |
2000
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 |
HCURSOR curs; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1165 |
int hitCode; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1166 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1167 |
hitCode = LOWORD(lParam); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1168 |
if (hitCode != HTCLIENT) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1169 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1170 |
* not in client area ... |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1171 |
*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1172 |
return 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1173 |
} |
2240 | 1174 |
DDPRINTF(("WM_SETCURSOR\n")); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1175 |
curs = GetWindow_Cursor(hWnd); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1176 |
if (curs) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1177 |
SetCursor(curs); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1178 |
*pDefault = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1179 |
return 1; |
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 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1182 |
} |
1127 | 1183 |
return 0; |
1184 |
case WM_WINDOWPOSCHANGED: |
|
1723 | 1185 |
/* |
1186 |
* ignore child window messages ... |
|
1187 |
*/ |
|
1188 |
if (GetParent(hWnd)) { |
|
1189 |
break; |
|
1190 |
} |
|
1191 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1192 |
GetClientRect(hWnd, &rct); |
1127 | 1193 |
EVENT_PRINTF(("WM_WINDOWPOSCHANGED\n")); |
2232 | 1194 |
enqEvent(0,hWnd, message, wParam, |
1127 | 1195 |
rct.left, rct.top, |
2151 | 1196 |
rct.right-rct.left, |
1197 |
rct.bottom-rct.top); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1198 |
return 0; |
2253 | 1199 |
break; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1200 |
case WM_ERASEBKGND: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1201 |
EVENT_PRINTF(("WM_ERASEBKGND\n")); |
1723 | 1202 |
if (isNative) { |
1203 |
*pDefault = 1; |
|
1204 |
return 0; |
|
1205 |
} |
|
2151 | 1206 |
*pDefault = 0; |
1207 |
if ((GetWindow_Flag(hWnd) & LI_INPUTWIN) == 0) |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1208 |
{ |
2253 | 1209 |
#if 0 |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1210 |
int state; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1211 |
HDC dc = (HDC)wParam; |
2232 | 1212 |
/*HBRUSH br = GetWindow_bgBrush(hWnd);*/ |
1213 |
HBRUSH br = CreateSolidBrush(st2RGB(GetWindow_bgBrush(hWnd),0)); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1214 |
if (br == 0) |
2151 | 1215 |
{ |
1216 |
/*br = GetStockObject(LTGRAY_BRUSH);*/ |
|
1217 |
return 1; |
|
1218 |
} |
|
2232 | 1219 |
#ifdef WIN32THREADS |
1220 |
__suspendAktThread(); |
|
1221 |
#else |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1222 |
SuspendThread(_masterThread); |
2232 | 1223 |
#endif |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1224 |
state = SaveDC(dc); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1225 |
GetClientRect(hWnd, (LPRECT) &upd); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1226 |
SelectClipRgn(dc,0); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1227 |
FillRect(dc, &upd, br); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1228 |
/*FillRect(GetDCEx(hWnd,0,DCX_CLIPCHILDREN), &upd, br);*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1229 |
RestoreDC(dc,state); |
2232 | 1230 |
#ifdef WIN32THREADS |
1231 |
__resumeAktThread(); |
|
1232 |
#else |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1233 |
ResumeThread(_masterThread); |
2232 | 1234 |
#endif |
1235 |
DelObject(br); |
|
2253 | 1236 |
#endif |
1723 | 1237 |
} |
1238 |
return 1; |
|
1239 |
break; |
|
1127 | 1240 |
case WM_PAINT: |
1241 |
EVENT_PRINTF(("WM_PAINT\n")); |
|
1723 | 1242 |
if (isNative) { |
1243 |
*pDefault = 1; |
|
1244 |
return 0; |
|
1245 |
} |
|
2253 | 1246 |
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
|
1247 |
{ |
2253 | 1248 |
//if (GetUpdateRect(hWnd, &upd, TRUE)) |
1249 |
if (GetUpdateRect(hWnd, &upd, FALSE)) |
|
2232 | 1250 |
{ |
2253 | 1251 |
if (GetWindow_eventMask(hWnd) & ExposureMask) |
1252 |
enqEvent(ExposureMask,hWnd, message, wParam, upd.left, upd.top, upd.right, upd.bottom); |
|
2232 | 1253 |
} |
1127 | 1254 |
} |
2253 | 1255 |
else |
1256 |
pDefault = 0; |
|
1127 | 1257 |
return 0; |
1258 |
break; |
|
1259 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1260 |
case WM_SIZE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1261 |
EVENT_PRINTF(("WM_SIZE\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1262 |
switch(wParam) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1263 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1264 |
case SIZE_RESTORED: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1265 |
case SIZE_MAXIMIZED: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1266 |
GetClientRect(hWnd, (LPRECT) &upd); |
2151 | 1267 |
if (GetWindow_eventMask(hWnd) & ExposureMask) |
2232 | 1268 |
enqEvent(ExposureMask,hWnd, WM_PAINT, wParam, upd.left, upd.top, upd.right, upd.bottom); |
1269 |
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
|
1270 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1271 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1272 |
break; |
1127 | 1273 |
case WM_SHOWWINDOW: |
1274 |
EVENT_PRINTF(("WM_SHOWWINDOW\n")); |
|
2232 | 1275 |
enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0); |
1723 | 1276 |
if (isNative) { |
1277 |
*pDefault = 1; |
|
1278 |
return 0; |
|
1279 |
} |
|
2253 | 1280 |
break; |
1281 |
//*pDefault = 0; |
|
1282 |
//return 0; |
|
1127 | 1283 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1284 |
case WM_MOUSEACTIVATE : |
1127 | 1285 |
EVENT_PRINTF2(("WM_MOUSEACTIVATE h=%x\n", hWnd)); |
1286 |
*pDefault = 0; |
|
2253 | 1287 |
if ((__rootWinSpezial == hWnd) || (GetActiveWindow() && (LOWORD(lParam) == HTCLIENT)) |
1288 |
/*((GETLOCALWINDOWINFOPTR(hWnd)->flag & LI_TOPWIN) == 0) */ |
|
2247 | 1289 |
) |
1290 |
return MA_NOACTIVATE; |
|
2232 | 1291 |
else |
1292 |
{ |
|
1293 |
return MA_ACTIVATE; |
|
1294 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1295 |
break; |
2253 | 1296 |
case WM_NCHITTEST: |
1297 |
EVENT_PRINTF(("WM_NCHITTEST\n")); |
|
1298 |
if (hWnd == __rootWinSpezial) |
|
1299 |
{ |
|
1300 |
*pDefault = 0; |
|
1301 |
return HTCLIENT; |
|
1302 |
} |
|
1303 |
break; |
|
1304 |
case WM_NCACTIVATE: |
|
1305 |
EVENT_PRINTF(("WM_NCACTIVATE\n")); |
|
1306 |
break; |
|
1127 | 1307 |
case WM_ACTIVATE: |
2232 | 1308 |
CPRINTF(("WM_ACTIVATE %s h=%x\n", |
1127 | 1309 |
LOWORD(wParam) ? "active" : "inactive", |
1310 |
hWnd)); |
|
2253 | 1311 |
#if 0 |
2232 | 1312 |
enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0); |
1127 | 1313 |
switch (LOWORD(wParam)) { |
1314 |
case WA_INACTIVE: |
|
1315 |
EVENT_PRINTF2(("WM_ACTIVATE inactive h=%x\n", hWnd)); |
|
1316 |
break; |
|
1317 |
case WA_ACTIVE: |
|
1318 |
EVENT_PRINTF2(("WM_ACTIVATE active h=%x\n", hWnd)); |
|
2244 | 1319 |
if (currentCapture == CAPTURE_NONE) |
1320 |
{ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1321 |
POINT p; |
2232 | 1322 |
HWND hWndChild,hWndTemp; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1323 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1324 |
p.x = evRootX; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1325 |
p.y = evRootY; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1326 |
ScreenToClient(hWnd, &p); |
2244 | 1327 |
hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p); |
1328 |
do |
|
1329 |
{ |
|
1330 |
hWndTemp = hWndChild; |
|
1331 |
hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT); |
|
1332 |
} while ((hWndChild) && (hWndChild != hWndTemp)); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1333 |
/*printf("WM_ACTIVATE active h=%x p=%d.%d in %x\n", hWnd,p.x,p.y,hWndChild);*/ |
2232 | 1334 |
if (hWndChild /*&& (hWndChild != hWnd)*/) |
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 |
modifiers = getModifiers(); |
2232 | 1337 |
if (hWndChild != currentPointerView) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1338 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1339 |
if (currentPointerView) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1340 |
{ |
2151 | 1341 |
if (GetWindow_eventMask(hWnd) & LeaveWindowMask) |
2232 | 1342 |
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
|
1343 |
currentPointerView = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1344 |
} |
2232 | 1345 |
if (GetWindow_eventMask(hWndChild) & EnterWindowMask) |
1346 |
enqEvent(EnterWindowMask,hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers); |
|
1347 |
//SetFocus(hWndChild); |
|
1348 |
currentPointerView = hWndChild; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1349 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1350 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1351 |
} |
1127 | 1352 |
break; |
1353 |
case WA_CLICKACTIVE: |
|
1354 |
EVENT_PRINTF2(("WM_ACTIVATE clkactive h=%x\n", hWnd)); |
|
1355 |
break; |
|
1356 |
default: |
|
1357 |
EVENT_PRINTF2(("WM_ACTIVATE ? h=%x\n", hWnd)); |
|
1358 |
break; |
|
1359 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1360 |
if (isNative) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1361 |
*pDefault = 1; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1362 |
return 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1363 |
} |
2232 | 1364 |
*pDefault = 0; |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1365 |
return 0; |
2253 | 1366 |
#endif |
1367 |
break; |
|
1127 | 1368 |
case WM_SYSCHAR: |
1369 |
EVENT_PRINTF2(("WM_SYSCHAR h=%x %x\n", hWnd, wParam)); |
|
1370 |
goto commonChar; |
|
1371 |
||
1372 |
case WM_CHAR: |
|
1373 |
EVENT_PRINTF2(("WM_CHAR h=%x %x\n", hWnd, wParam)); |
|
1374 |
commonChar: |
|
1723 | 1375 |
if (isNative) { |
1376 |
*pDefault = 1; |
|
1377 |
return 0; |
|
1378 |
} |
|
1127 | 1379 |
modifiers = getModifiers(); |
1380 |
{ |
|
1381 |
POINT p; |
|
1382 |
||
1383 |
p.x = evRootX; |
|
1384 |
p.y = evRootY; |
|
1385 |
ScreenToClient(hWnd, &p); |
|
1386 |
x = p.x; |
|
1387 |
y = p.y; |
|
1388 |
} |
|
2232 | 1389 |
if (currentPointerView) |
1390 |
{ |
|
1391 |
if (GetWindow_eventMask(currentPointerView) & KeyPressMask) |
|
1392 |
enqEvent(KeyPressMask,currentPointerView, WM_KEYDOWN, wParam, x, y, lParam, modifiers | TRANSLATED_KEY); |
|
1393 |
if (GetWindow_eventMask(currentPointerView) & KeyReleaseMask) |
|
1394 |
enqEvent(KeyReleaseMask,currentPointerView, WM_KEYUP, wParam, x, y, lParam, modifiers | TRANSLATED_KEY); |
|
1395 |
} |
|
1396 |
else |
|
1397 |
{ |
|
1398 |
if (GetWindow_eventMask(hWnd) & KeyPressMask) |
|
1399 |
enqEvent(KeyPressMask,hWnd, WM_KEYDOWN, wParam, x, y, lParam, modifiers | TRANSLATED_KEY); |
|
1400 |
if (GetWindow_eventMask(hWnd) & KeyReleaseMask) |
|
1401 |
enqEvent(KeyReleaseMask,hWnd, WM_KEYUP, wParam, x, y, lParam, modifiers | TRANSLATED_KEY); |
|
1402 |
} |
|
1127 | 1403 |
*pDefault = 0; |
1404 |
return 0; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1405 |
|
2151 | 1406 |
case WM_KEYUP: |
1407 |
EVENT_PRINTF2(("WM_KEYUP h=%x %x\n", hWnd, wParam)); |
|
1408 |
goto commonKeyUp; |
|
1409 |
||
1127 | 1410 |
case WM_SYSKEYUP: |
1411 |
EVENT_PRINTF2(("WM_SYSKEYUP %x\n, wParam")); |
|
2151 | 1412 |
commonKeyUp: |
1413 |
if (isNative) { |
|
1414 |
*pDefault = 1; |
|
1415 |
return 0; |
|
1416 |
} |
|
1417 |
modifiers = getModifiers(); |
|
1418 |
{ |
|
1419 |
POINT p; |
|
1420 |
||
1421 |
p.x = evRootX; |
|
1422 |
p.y = evRootY; |
|
1423 |
ScreenToClient(hWnd, &p); |
|
1424 |
x = p.x; |
|
1425 |
y = p.y; |
|
1426 |
} |
|
1427 |
||
2232 | 1428 |
if (currentPointerView) |
1429 |
{ |
|
1430 |
if (GetWindow_eventMask(currentPointerView) & KeyReleaseMask) |
|
1431 |
enqEvent(KeyReleaseMask,currentPointerView, message, wParam, x, y, lParam, modifiers); |
|
1432 |
} |
|
1433 |
else |
|
1434 |
{ |
|
1435 |
if (GetWindow_eventMask(hWnd) & KeyReleaseMask) |
|
1436 |
enqEvent(KeyReleaseMask,hWnd, message, wParam, x, y, lParam, modifiers); |
|
1437 |
} |
|
2151 | 1438 |
*pDefault = 0; |
1439 |
return 0; |
|
1127 | 1440 |
|
1441 |
case WM_SYSKEYDOWN: |
|
1442 |
EVENT_PRINTF2(("WM_SYSKEYDOWN %x\n, wParam")); |
|
1443 |
goto commonKey; |
|
1444 |
||
1445 |
case WM_KEYDOWN: |
|
1446 |
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
|
1447 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1448 |
/* while debugging ... */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1449 |
if (wParam == VK_ESCAPE) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1450 |
ReleaseCapture(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1451 |
currentCapture = CAPTURE_NONE; |
2244 | 1452 |
CPRINTF(("ReleaseCapture <ESC>\n")); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1453 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1454 |
|
1127 | 1455 |
commonKey: |
1723 | 1456 |
if (isNative) { |
1457 |
*pDefault = 1; |
|
1458 |
return 0; |
|
1459 |
} |
|
1127 | 1460 |
modifiers = getModifiers(); |
1461 |
{ |
|
1462 |
POINT p; |
|
1463 |
||
1464 |
p.x = evRootX; |
|
1465 |
p.y = evRootY; |
|
1466 |
ScreenToClient(hWnd, &p); |
|
1467 |
x = p.x; |
|
1468 |
y = p.y; |
|
1469 |
} |
|
2232 | 1470 |
if (currentPointerView) |
1471 |
{ |
|
1472 |
if (GetWindow_eventMask(currentPointerView) & KeyPressMask) |
|
1473 |
enqEvent(KeyPressMask,currentPointerView, message, wParam, x, y, lParam, modifiers); |
|
1474 |
} |
|
1475 |
else |
|
1476 |
{ |
|
1477 |
if (GetWindow_eventMask(hWnd) & KeyPressMask) |
|
1478 |
enqEvent(KeyPressMask,hWnd, message, wParam, x, y, lParam, modifiers); |
|
1479 |
} |
|
1127 | 1480 |
*pDefault = 0; |
1481 |
return 0; |
|
1482 |
||
1483 |
case WM_MOUSEMOVE: |
|
1705 | 1484 |
EVENT_PRINTF3(("WM_MOUSEMOVE h=%x\n", hWnd)); |
1723 | 1485 |
if (isNative) { |
1486 |
*pDefault = 1; |
|
1487 |
return 0; |
|
1488 |
} |
|
1489 |
||
1127 | 1490 |
{ |
1491 |
short x, y; |
|
1492 |
||
2232 | 1493 |
x = (int)(short)LOWORD(lParam); |
1494 |
y = (int)(short)HIWORD(lParam); |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1495 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1496 |
modifiers = getModifiers(); |
1723 | 1497 |
|
2232 | 1498 |
if (currentCapture == CAPTURE_NONE) |
2244 | 1499 |
{ |
1500 |
if (hWnd != currentPointerView) { |
|
1501 |
if (currentPointerView) { |
|
1502 |
if (GetWindow_eventMask(hWnd) & LeaveWindowMask) |
|
1503 |
enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers); |
|
1504 |
currentPointerView = 0; |
|
1505 |
} |
|
1506 |
if (GetWindow_eventMask(hWnd) & EnterWindowMask) |
|
1507 |
enqEvent(EnterWindowMask,hWnd, __WM_MOUSEENTER, 0, x, y, 0, modifiers); |
|
1508 |
currentPointerView = hWnd; |
|
1509 |
} |
|
1510 |
CPRINTF(("MouseMove %x\n",currentPointerView)); |
|
1511 |
} |
|
1512 |
else |
|
1513 |
{ |
|
1514 |
CPRINTF(("MouseMove Capture %x\n",currentPointerView)); |
|
1515 |
} |
|
2232 | 1516 |
if ( (GetWindow_eventMask(currentPointerView) & PointerMotionMask) |
2151 | 1517 |
|| (modifiers & (Button1Mask|Button2Mask|Button3Mask)) |
1518 |
) |
|
2232 | 1519 |
enqEvent(PointerMotionMask,currentPointerView, message, wParam, x, y, 0, modifiers); |
1127 | 1520 |
} |
1521 |
*pDefault = 0; |
|
1522 |
return 0; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1523 |
|
2151 | 1524 |
case WM_LBUTTONUP: |
1525 |
case WM_MBUTTONUP: |
|
1526 |
case WM_RBUTTONUP: |
|
1527 |
if (isNative) { |
|
1528 |
*pDefault = 1; |
|
1529 |
return 0; |
|
1530 |
} |
|
1531 |
||
1532 |
if (currentCapture == CAPTURE_IMPLICIT) { |
|
1533 |
currentCapture = CAPTURE_NONE; |
|
1534 |
ReleaseCapture(); |
|
2244 | 1535 |
CPRINTF(("ReleaseCapture <BUTTONUP>\n")); |
2151 | 1536 |
} |
1537 |
modifiers = getModifiers(); |
|
1538 |
EVENT_PRINTF3(("WM_BUTTONUP h=%x pos=%d/%d\n", |
|
2232 | 1539 |
hWnd, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam))); |
2151 | 1540 |
|
1541 |
||
1542 |
if (GetWindow_eventMask(hWnd) & ButtonReleaseMask) |
|
2232 | 1543 |
enqEvent(ButtonReleaseMask,hWnd, message, wParam, (int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam), |
2151 | 1544 |
wParam,modifiers); |
1545 |
*pDefault = 0; |
|
1546 |
break; |
|
1547 |
||
1127 | 1548 |
case WM_LBUTTONDOWN: |
1549 |
case WM_MBUTTONDOWN: |
|
1550 |
case WM_RBUTTONDOWN: |
|
1723 | 1551 |
if (isNative) { |
1552 |
*pDefault = 1; |
|
1553 |
return 0; |
|
1554 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1555 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1556 |
if (currentCapture == CAPTURE_NONE) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1557 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1558 |
currentCapture = CAPTURE_IMPLICIT; |
2232 | 1559 |
//SetFocus(hWnd); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1560 |
SetCapture(hWnd); |
2244 | 1561 |
CPRINTF(("SetCapture <BUTTONDOWN>%x\n",hWnd)); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1562 |
} |
1127 | 1563 |
goto commonButton; |
1564 |
case WM_LBUTTONDBLCLK: |
|
1565 |
case WM_MBUTTONDBLCLK: |
|
1566 |
case WM_RBUTTONDBLCLK: |
|
1723 | 1567 |
if (isNative) { |
1568 |
*pDefault = 1; |
|
1569 |
return 0; |
|
1570 |
} |
|
1127 | 1571 |
commonButton: |
1572 |
modifiers = getModifiers(); |
|
2151 | 1573 |
EVENT_PRINTF3(("WM_BUTTONDOWN h=%x pos=%d/%d\n", |
1127 | 1574 |
hWnd, LOWORD(lParam), HIWORD(lParam))); |
1723 | 1575 |
|
2151 | 1576 |
|
1577 |
if (GetWindow_eventMask(hWnd) & ButtonPressMask) |
|
2232 | 1578 |
enqEvent(ButtonPressMask,hWnd, message, wParam, (int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam), |
2151 | 1579 |
wParam,modifiers); |
1127 | 1580 |
*pDefault = 0; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1581 |
break; |
2232 | 1582 |
case WM_CAPTURECHANGED: |
1583 |
CPRINTF(("WM_CAPTURECHANGED %x to %x\n",hWnd,lParam)); |
|
1584 |
break; |
|
1127 | 1585 |
case WM_KILLFOCUS: |
2232 | 1586 |
CPRINTF(("WM_KILLFOCUS\n")); |
1587 |
//enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0); |
|
1723 | 1588 |
if (isNative) { |
1589 |
*pDefault = 1; |
|
1590 |
return 0; |
|
1591 |
} |
|
2232 | 1592 |
*pDefault = 0; |
1593 |
return 0; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1594 |
break; |
1127 | 1595 |
case WM_SETFOCUS: |
2232 | 1596 |
CPRINTF(("WM_SETFOCUS %x\n",hWnd)); |
1597 |
#if 0 |
|
1598 |
//enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0); |
|
1599 |
{ |
|
1600 |
POINT p; |
|
1601 |
HWND hWndChild,hWndTemp; |
|
1602 |
||
2244 | 1603 |
p.x = evRootX; |
1604 |
p.y = evRootY; |
|
1605 |
ScreenToClient(hWnd, &p); |
|
1606 |
hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p); |
|
1607 |
do |
|
1608 |
{ |
|
1609 |
hWndTemp = hWndChild; |
|
1610 |
hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT); |
|
1611 |
} while ((hWndChild) && (hWndChild != hWndTemp)); |
|
2232 | 1612 |
/*printf("WM_ACTIVATE active h=%x p=%d.%d in %x\n", hWnd,p.x,p.y,hWndChild);*/ |
1613 |
if (hWndChild /*&& (hWndChild != hWnd)*/) |
|
1614 |
{ |
|
1615 |
modifiers = getModifiers(); |
|
1616 |
if (hWndChild != currentPointerView) |
|
1617 |
{ |
|
1618 |
if (currentPointerView) |
|
1619 |
{ |
|
1620 |
if (GetWindow_eventMask(hWnd) & LeaveWindowMask) |
|
1621 |
enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers); |
|
1622 |
currentPointerView = 0; |
|
1623 |
} |
|
1624 |
if (GetWindow_eventMask(hWndChild) & EnterWindowMask) |
|
1625 |
enqEvent(EnterWindowMask,hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers); |
|
1626 |
//SetFocus(hWndChild); |
|
1627 |
currentPointerView = hWndChild; |
|
1628 |
} |
|
1629 |
} |
|
1630 |
} |
|
2253 | 1631 |
#endif |
1723 | 1632 |
if (isNative) { |
1633 |
*pDefault = 1; |
|
1634 |
return 0; |
|
1635 |
} |
|
2232 | 1636 |
*pDefault = 0; |
2253 | 1637 |
break; |
1723 | 1638 |
case WM_STYLECHANGING: |
1639 |
EVENT_PRINTF(("WM_STYLECHANGING\n")); |
|
1640 |
break; |
|
1641 |
||
1642 |
case WM_STYLECHANGED: |
|
1643 |
EVENT_PRINTF(("WM_STYLECHANGED\n")); |
|
1644 |
break; |
|
1645 |
||
1127 | 1646 |
case WM_GETTEXT: |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1647 |
/*EVENT_PRINTF(("WM_GETTEXT %x\n", message));*/ |
1127 | 1648 |
break; |
1649 |
||
1650 |
case WM_GETTEXTLENGTH: |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1651 |
EVENT_PRINTF(("WM_GETTEXTLENGTH %x\n", message)); |
1127 | 1652 |
break; |
1653 |
||
1654 |
case WM_NCCREATE: |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1655 |
EVENT_PRINTF(("WM_NCCREATE %x\n", message)); |
1127 | 1656 |
break; |
1657 |
||
1658 |
case WM_NCMOUSEMOVE: |
|
1723 | 1659 |
{ |
1660 |
short x, y; |
|
1661 |
||
2232 | 1662 |
x = (int)(short)LOWORD(lParam); |
1663 |
y = (int)(short)HIWORD(lParam); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1664 |
EVENT_PRINTF(("WM_NCMOUSEMOVE %d/%d\n", x, y)); |
1723 | 1665 |
lastNCMouseX = x; |
1666 |
lastNCMouseY = y; |
|
1667 |
} |
|
1127 | 1668 |
break; |
1669 |
||
1670 |
case WM_PARENTNOTIFY: |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1671 |
EVENT_PRINTF2(("WM_PARENTNOTIFY h=%x hChild=%x %d\n", |
1127 | 1672 |
hWnd, lParam, LOWORD(wParam))); |
1673 |
break; |
|
1674 |
||
1675 |
case WM_NCLBUTTONDOWN: |
|
1676 |
EVENT_PRINTF(("WM_NCLBUTTONDOWN\n")); |
|
1723 | 1677 |
{ |
1678 |
short x, y; |
|
1679 |
||
2232 | 1680 |
x = (int)(short)LOWORD(lParam); |
1681 |
y = (int)(short)HIWORD(lParam); |
|
1723 | 1682 |
lastNCMouseX = x; |
1683 |
lastNCMouseY = y; |
|
1684 |
} |
|
1685 |
break; |
|
1686 |
||
1687 |
case WM_NCLBUTTONUP: |
|
1688 |
EVENT_PRINTF(("WM_NCLBUTTONUP\n")); |
|
1689 |
break; |
|
1690 |
||
1691 |
case WM_NCRBUTTONDOWN: |
|
1692 |
EVENT_PRINTF(("WM_NCRBUTTONDOWN\n")); |
|
1693 |
break; |
|
1694 |
||
1695 |
case WM_NCRBUTTONUP: |
|
1696 |
EVENT_PRINTF(("WM_NCRBUTTONUP\n")); |
|
1697 |
break; |
|
1698 |
||
1699 |
case WM_NCMBUTTONDOWN: |
|
1700 |
EVENT_PRINTF(("WM_NCMBUTTONDOWN\n")); |
|
1701 |
break; |
|
1702 |
||
1703 |
case WM_NCMBUTTONUP: |
|
1704 |
EVENT_PRINTF(("WM_NCMBUTTONUP\n")); |
|
1127 | 1705 |
break; |
1706 |
||
1707 |
case WM_SETTEXT: |
|
1708 |
EVENT_PRINTF(("WM_SETTEXT\n")); |
|
1709 |
break; |
|
1710 |
||
1711 |
case 0x88: |
|
1712 |
EVENT_PRINTF(("0x88 (undoc)\n")); |
|
1713 |
break; |
|
1714 |
||
1715 |
case WM_NCCALCSIZE: |
|
1716 |
EVENT_PRINTF(("WM_NCCALCSIZE\n")); |
|
1717 |
break; |
|
1718 |
||
1719 |
case WM_NCPAINT: |
|
1705 | 1720 |
EVENT_PRINTF3(("WM_NCPAINT\n")); |
1127 | 1721 |
break; |
1722 |
||
1723 |
case WM_SYSCOMMAND: |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1724 |
switch (wParam & ~0x000F) { |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1725 |
case SC_CLOSE: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1726 |
EVENT_PRINTF2(("WM_SYSCOMMAND SC_CLOSE\n")); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1727 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1728 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1729 |
case SC_MOVE: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1730 |
EVENT_PRINTF2(("WM_SYSCOMMAND SC_MOVE\n")); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1731 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1732 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1733 |
case SC_RESTORE: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1734 |
EVENT_PRINTF2(("WM_SYSCOMMAND SC_RESTORE\n")); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1735 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1736 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1737 |
case SC_SIZE: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1738 |
EVENT_PRINTF2(("WM_SYSCOMMAND SC_SIZE\n")); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1739 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1740 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1741 |
default: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1742 |
EVENT_PRINTF2(("WM_SYSCOMMAND %x\n", wParam)); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1743 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1744 |
} |
1127 | 1745 |
break; |
1746 |
case WM_INITMENU: |
|
1747 |
EVENT_PRINTF(("WM_INITMENU\n")); |
|
1748 |
break; |
|
1749 |
case WM_INITMENUPOPUP: |
|
1750 |
EVENT_PRINTF(("WM_INITMENUPOPUP\n")); |
|
1751 |
break; |
|
1752 |
case WM_ENTERIDLE: |
|
1753 |
EVENT_PRINTF(("WM_ENTERIDLE\n")); |
|
1754 |
break; |
|
1755 |
case WM_ENTERMENULOOP: |
|
1756 |
EVENT_PRINTF(("WM_ENTERMENULOOP\n")); |
|
1757 |
break; |
|
1758 |
case WM_EXITMENULOOP: |
|
1759 |
EVENT_PRINTF(("WM_EXITMENULOOP\n")); |
|
1760 |
break; |
|
1761 |
case WM_MENUSELECT: |
|
1762 |
EVENT_PRINTF(("WM_MENUSELECT\n")); |
|
1763 |
break; |
|
1764 |
case WM_QUIT: |
|
1765 |
EVENT_PRINTF(("WM_QUIT\n")); |
|
1766 |
break; |
|
1767 |
case WM_NCDESTROY: |
|
1768 |
EVENT_PRINTF(("WM_NCDESTROY\n")); |
|
1769 |
break; |
|
1770 |
case WM_QUERYNEWPALETTE: |
|
1771 |
EVENT_PRINTF(("WM_QUERYNEWPALETTE\n")); |
|
1772 |
break; |
|
1773 |
case WM_PALETTECHANGED: |
|
1774 |
EVENT_PRINTF(("WM_PALETTECHANGED\n")); |
|
1775 |
break; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1776 |
case WM_ACTIVATEAPP: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1777 |
EVENT_PRINTF2(("WM_ACTIVATEAPP %s\n", wParam ? "active" : "inactive")); |
1723 | 1778 |
break; |
1127 | 1779 |
case WM_SYSDEADCHAR: |
1780 |
EVENT_PRINTF2(("WM_SYSDEADCHAR %x\n, wParam")); |
|
1781 |
break; |
|
1782 |
case WM_DEADCHAR: |
|
1783 |
EVENT_PRINTF2(("WM_DEADCHAR %x\n, wParam")); |
|
1784 |
break; |
|
1785 |
case WM_PAINTICON: |
|
1786 |
EVENT_PRINTF(("WM_PAINTICON\n")); |
|
1787 |
break; |
|
1788 |
case WM_ICONERASEBKGND: |
|
1789 |
EVENT_PRINTF(("WM_ICONERASEBKGND\n")); |
|
1790 |
break; |
|
1791 |
case WM_WINDOWPOSCHANGING: |
|
1792 |
EVENT_PRINTF(("WM_WINDOWPOSCHANGING\n")); |
|
1793 |
break; |
|
1794 |
case WM_QUERYOPEN: |
|
1795 |
EVENT_PRINTF(("WM_QUERYOPEN\n")); |
|
1796 |
break; |
|
1797 |
case WM_QUERYENDSESSION: |
|
1798 |
EVENT_PRINTF(("WM_QUERYENDSESSION\n")); |
|
1799 |
break; |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1800 |
case WM_FONTCHANGE: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1801 |
EVENT_PRINTF(("WM_FONTCHANGE\n")); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1802 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1803 |
case WM_MOVING: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1804 |
EVENT_PRINTF(("WM_MOVING\n")); |
1705 | 1805 |
break; |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1806 |
case WM_SYSCOLORCHANGE: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1807 |
EVENT_PRINTF(("WM_SYSCOLORCHANGE\n")); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1808 |
break; |
1705 | 1809 |
case WM_SIZING: |
1810 |
EVENT_PRINTF(("WM_SIZING\n")); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1811 |
/*__debugEvent__();*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1812 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1813 |
case WM_EXITSIZEMOVE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1814 |
EVENT_PRINTF(("WM_EXITSIZEMOVE\n")); |
1705 | 1815 |
break; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1816 |
case WM_ENTERSIZEMOVE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1817 |
EVENT_PRINTF(("WM_ENTERSIZEMOVE\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1818 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1819 |
case WM_MOVE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1820 |
EVENT_PRINTF(("WM_MOVE\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1821 |
break; |
1127 | 1822 |
default: |
1823 |
EVENT_PRINTF(("msg = %x\n", message)); |
|
1824 |
break; |
|
1825 |
} |
|
1826 |
return 0; |
|
1827 |
} |
|
2253 | 1828 |
#if 0 |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1829 |
static |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1830 |
winEventProcessingRoot(hWnd, message, wParam, lParam, pDefault) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1831 |
HWND hWnd; /* window handle */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1832 |
UINT message; /* type of message */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1833 |
UINT wParam; /* additional information */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1834 |
LONG lParam; /* additional information */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1835 |
int *pDefault; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1836 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1837 |
LPMINMAXINFO lpmmi; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1838 |
WINDOWPOS *posStruct; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1839 |
RECT rct; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1840 |
RECT upd; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1841 |
int modifiers; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1842 |
int x, y, w, h; |
2253 | 1843 |
int isNative = 0; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1844 |
PAINTSTRUCT ps; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1845 |
|
2253 | 1846 |
/* |
1847 |
EVENT_PRINTF(("winEvent hWin=0x%x message=0x%x wP=0x%x lP=0x%x\n", |
|
1848 |
hWnd, message, wParam, lParam)); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1849 |
*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1850 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1851 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1852 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1853 |
* messages which are enqueued to be handled by the view thread |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1854 |
*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1855 |
switch (message) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1856 |
case WM_CREATE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1857 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1858 |
CREATESTRUCT *lpcs = (LPCREATESTRUCT) lParam; // structure with creation data |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1859 |
SETLOCALWINDOWINFOPTR(hWnd,lpcs->lpCreateParams); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1860 |
if (GETLOCALWINDOWINFOPTR(hWnd) != lpcs->lpCreateParams) |
2253 | 1861 |
PRINTF(("SETLOCALWINDOWINFOPTR ERROR\n")); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1862 |
*pDefault = 0; |
2253 | 1863 |
#ifdef COUNT_RESOURCES |
1864 |
__cnt_createWindows++; |
|
1865 |
RESPRINTF(("CreateWindows %d\n",__cnt_createWindows)); |
|
1866 |
#endif |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1867 |
DPRINTF(("WM_CREATE\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1868 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1869 |
break; |
2253 | 1870 |
case WM_CLOSE: |
1871 |
DPRINTF(("WM_CLOSE\n")); |
|
1872 |
if (!destroyWin) |
|
1873 |
enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0); |
|
1874 |
else |
|
1875 |
{ |
|
1876 |
destroyWin = 0; |
|
1877 |
if (!DestroyWindow(hWnd)) |
|
1878 |
{ |
|
1879 |
DPRINTF(("DestroyWindow ERROR\n")); |
|
1880 |
} |
|
1881 |
||
1882 |
} |
|
1883 |
*pDefault = 0; |
|
1884 |
return 0; |
|
1885 |
break; |
|
1886 |
case WM_DESTROY: |
|
1887 |
{ |
|
1888 |
char *n = 0; |
|
1889 |
DPRINTF(("WM_DESTROY\n")); |
|
1890 |
if (GETLOCALWINDOWINFOPTR(hWnd)) |
|
1891 |
{ |
|
1892 |
if (GETLOCALWINDOWINFOPTR(hWnd)->flag & LI_TOPWIN) |
|
1893 |
{ |
|
1894 |
#if 0 |
|
1895 |
#ifdef WIN32THREADS |
|
1896 |
__suspendAktThread(); |
|
1897 |
#else |
|
1898 |
SuspendThread(_masterThread); |
|
1899 |
#endif |
|
1900 |
#endif |
|
1901 |
n = (char*)malloc(200); |
|
1902 |
#if 0 |
|
1903 |
#ifdef WIN32THREADS |
|
1904 |
__resumeAktThread(); |
|
1905 |
#else |
|
1906 |
ResumeThread(_masterThread); |
|
1907 |
#endif |
|
1908 |
#endif |
|
1909 |
GetClassName(hWnd,n,200); |
|
1910 |
} |
|
1911 |
#ifdef COUNT_RESOURCES |
|
1912 |
__cnt_createWindows--; |
|
1913 |
RESPRINTF(("DestroyWindows %d\n",__cnt_createWindows)); |
|
1914 |
#endif |
|
1915 |
/* free all resources */ |
|
1916 |
/*if (GetWindow_bgBrush(hWnd)) |
|
1917 |
DelObject(GetWindow_bgBrush(hWnd));*/ |
|
1918 |
free(GETLOCALWINDOWINFOPTR(hWnd)); |
|
1919 |
SETLOCALWINDOWINFOPTR(hWnd,0); |
|
1920 |
} |
|
1921 |
||
1922 |
||
1923 |
enqEvent(0,hWnd, message, wParam, (int)n, 0, 0, 0); |
|
1924 |
*pDefault = 0; |
|
1925 |
return 0; |
|
1926 |
} |
|
1927 |
break; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1928 |
case WM_SETCURSOR: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1929 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1930 |
HCURSOR curs; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1931 |
int hitCode; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1932 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1933 |
hitCode = LOWORD(lParam); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1934 |
if (hitCode != HTCLIENT) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1935 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1936 |
* not in client area ... |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1937 |
*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1938 |
return 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1939 |
} |
2232 | 1940 |
DDPRINTF(("WM_SETCURSOR\n")); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1941 |
curs = GetWindow_Cursor(hWnd); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1942 |
if (curs) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1943 |
SetCursor(curs); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1944 |
*pDefault = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1945 |
return 1; |
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 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1948 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1949 |
return 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1950 |
case WM_SYSCHAR: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1951 |
EVENT_PRINTF2(("WM_SYSCHAR h=%x %x\n", hWnd, wParam)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1952 |
goto commonChar; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1953 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1954 |
case WM_CHAR: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1955 |
EVENT_PRINTF2(("WM_CHAR h=%x %x\n", hWnd, wParam)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1956 |
commonChar: |
2253 | 1957 |
if (isNative) { |
1958 |
*pDefault = 1; |
|
1959 |
return 0; |
|
1960 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1961 |
modifiers = getModifiers(); |
2253 | 1962 |
{ |
1963 |
POINT p; |
|
1964 |
||
1965 |
p.x = evRootX; |
|
1966 |
p.y = evRootY; |
|
1967 |
ScreenToClient(hWnd, &p); |
|
1968 |
x = p.x; |
|
1969 |
y = p.y; |
|
1970 |
} |
|
1971 |
if (currentPointerView) |
|
1972 |
{ |
|
1973 |
if (GetWindow_eventMask(currentPointerView) & KeyPressMask) |
|
1974 |
enqEvent(KeyPressMask,currentPointerView, WM_KEYDOWN, wParam, x, y, lParam, modifiers | TRANSLATED_KEY); |
|
1975 |
if (GetWindow_eventMask(currentPointerView) & KeyReleaseMask) |
|
1976 |
enqEvent(KeyReleaseMask,currentPointerView, WM_KEYUP, wParam, x, y, lParam, modifiers | TRANSLATED_KEY); |
|
1977 |
} |
|
1978 |
else |
|
1979 |
{ |
|
1980 |
if (GetWindow_eventMask(hWnd) & KeyPressMask) |
|
1981 |
enqEvent(KeyPressMask,hWnd, WM_KEYDOWN, wParam, x, y, lParam, modifiers | TRANSLATED_KEY); |
|
1982 |
if (GetWindow_eventMask(hWnd) & KeyReleaseMask) |
|
1983 |
enqEvent(KeyReleaseMask,hWnd, WM_KEYUP, wParam, x, y, lParam, modifiers | TRANSLATED_KEY); |
|
1984 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1985 |
*pDefault = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1986 |
return 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1987 |
|
2253 | 1988 |
case WM_KEYUP: |
1989 |
EVENT_PRINTF2(("WM_KEYUP h=%x %x\n", hWnd, wParam)); |
|
1990 |
goto commonKeyUp; |
|
1991 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1992 |
case WM_SYSKEYUP: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
1993 |
EVENT_PRINTF2(("WM_SYSKEYUP %x\n, wParam")); |
2253 | 1994 |
commonKeyUp: |
1995 |
if (isNative) { |
|
1996 |
*pDefault = 1; |
|
1997 |
return 0; |
|
1998 |
} |
|
1999 |
modifiers = getModifiers(); |
|
2000 |
{ |
|
2001 |
POINT p; |
|
2002 |
||
2003 |
p.x = evRootX; |
|
2004 |
p.y = evRootY; |
|
2005 |
ScreenToClient(hWnd, &p); |
|
2006 |
x = p.x; |
|
2007 |
y = p.y; |
|
2008 |
} |
|
2009 |
||
2010 |
if (currentPointerView) |
|
2011 |
{ |
|
2012 |
if (GetWindow_eventMask(currentPointerView) & KeyReleaseMask) |
|
2013 |
enqEvent(KeyReleaseMask,currentPointerView, message, wParam, x, y, lParam, modifiers); |
|
2014 |
} |
|
2015 |
else |
|
2016 |
{ |
|
2017 |
if (GetWindow_eventMask(hWnd) & KeyReleaseMask) |
|
2018 |
enqEvent(KeyReleaseMask,hWnd, message, wParam, x, y, lParam, modifiers); |
|
2019 |
} |
|
2020 |
*pDefault = 0; |
|
2021 |
return 0; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2022 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2023 |
case WM_SYSKEYDOWN: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2024 |
EVENT_PRINTF2(("WM_SYSKEYDOWN %x\n, wParam")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2025 |
goto commonKey; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2026 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2027 |
case WM_KEYDOWN: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2028 |
EVENT_PRINTF2(("WM_KEYDOWN h=%x %x\n", hWnd, wParam)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2029 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2030 |
/* while debugging ... */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2031 |
if (wParam == VK_ESCAPE) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2032 |
ReleaseCapture(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2033 |
currentCapture = CAPTURE_NONE; |
2253 | 2034 |
CPRINTF(("ReleaseCapture <ESC>\n")); |
2000
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 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2037 |
commonKey: |
2253 | 2038 |
if (isNative) { |
2039 |
*pDefault = 1; |
|
2040 |
return 0; |
|
2041 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2042 |
modifiers = getModifiers(); |
2253 | 2043 |
{ |
2044 |
POINT p; |
|
2045 |
||
2046 |
p.x = evRootX; |
|
2047 |
p.y = evRootY; |
|
2048 |
ScreenToClient(hWnd, &p); |
|
2049 |
x = p.x; |
|
2050 |
y = p.y; |
|
2051 |
} |
|
2052 |
if (currentPointerView) |
|
2053 |
{ |
|
2054 |
if (GetWindow_eventMask(currentPointerView) & KeyPressMask) |
|
2055 |
enqEvent(KeyPressMask,currentPointerView, message, wParam, x, y, lParam, modifiers); |
|
2056 |
} |
|
2057 |
else |
|
2058 |
{ |
|
2059 |
if (GetWindow_eventMask(hWnd) & KeyPressMask) |
|
2060 |
enqEvent(KeyPressMask,hWnd, message, wParam, x, y, lParam, modifiers); |
|
2061 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2062 |
*pDefault = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2063 |
return 0; |
2253 | 2064 |
|
2065 |
case WM_MOUSEMOVE: |
|
2066 |
EVENT_PRINTF3(("WM_MOUSEMOVE h=%x\n", hWnd)); |
|
2067 |
if (isNative) { |
|
2068 |
*pDefault = 1; |
|
2069 |
return 0; |
|
2070 |
} |
|
2071 |
||
2072 |
{ |
|
2073 |
short x, y; |
|
2074 |
||
2075 |
x = (int)(short)LOWORD(lParam); |
|
2076 |
y = (int)(short)HIWORD(lParam); |
|
2077 |
||
2078 |
modifiers = getModifiers(); |
|
2079 |
||
2080 |
if (currentCapture == CAPTURE_NONE) |
|
2081 |
{ |
|
2082 |
if (hWnd != currentPointerView) { |
|
2083 |
if (currentPointerView) { |
|
2084 |
if (GetWindow_eventMask(hWnd) & LeaveWindowMask) |
|
2085 |
enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers); |
|
2086 |
currentPointerView = 0; |
|
2087 |
} |
|
2088 |
if (GetWindow_eventMask(hWnd) & EnterWindowMask) |
|
2089 |
enqEvent(EnterWindowMask,hWnd, __WM_MOUSEENTER, 0, x, y, 0, modifiers); |
|
2090 |
currentPointerView = hWnd; |
|
2091 |
} |
|
2092 |
CPRINTF(("MouseMove %x\n",currentPointerView)); |
|
2093 |
} |
|
2094 |
else |
|
2095 |
{ |
|
2096 |
CPRINTF(("MouseMove Capture %x\n",currentPointerView)); |
|
2097 |
} |
|
2098 |
if ( (GetWindow_eventMask(currentPointerView) & PointerMotionMask) |
|
2099 |
|| (modifiers & (Button1Mask|Button2Mask|Button3Mask)) |
|
2100 |
) |
|
2101 |
enqEvent(PointerMotionMask,currentPointerView, message, wParam, x, y, 0, modifiers); |
|
2102 |
} |
|
2103 |
*pDefault = 0; |
|
2104 |
return 0; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2105 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2106 |
case WM_LBUTTONUP: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2107 |
case WM_MBUTTONUP: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2108 |
case WM_RBUTTONUP: |
2253 | 2109 |
if (isNative) { |
2110 |
*pDefault = 1; |
|
2111 |
return 0; |
|
2112 |
} |
|
2113 |
||
2114 |
if (currentCapture == CAPTURE_IMPLICIT) { |
|
2115 |
currentCapture = CAPTURE_NONE; |
|
2116 |
ReleaseCapture(); |
|
2117 |
CPRINTF(("ReleaseCapture <BUTTONUP>\n")); |
|
2118 |
} |
|
2119 |
modifiers = getModifiers(); |
|
2120 |
EVENT_PRINTF3(("WM_BUTTONUP h=%x pos=%d/%d\n", |
|
2121 |
hWnd, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam))); |
|
2122 |
||
2123 |
||
2124 |
if (GetWindow_eventMask(hWnd) & ButtonReleaseMask) |
|
2125 |
enqEvent(ButtonReleaseMask,hWnd, message, wParam, (int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam), |
|
2126 |
wParam,modifiers); |
|
2127 |
*pDefault = 0; |
|
2128 |
break; |
|
2129 |
||
2130 |
case WM_LBUTTONDOWN: |
|
2131 |
case WM_MBUTTONDOWN: |
|
2132 |
case WM_RBUTTONDOWN: |
|
2133 |
if (isNative) { |
|
2134 |
*pDefault = 1; |
|
2135 |
return 0; |
|
2136 |
} |
|
2137 |
||
2138 |
if (currentCapture == CAPTURE_NONE) |
|
2139 |
{ |
|
2140 |
currentCapture = CAPTURE_IMPLICIT; |
|
2141 |
//SetFocus(hWnd); |
|
2142 |
SetCapture(hWnd); |
|
2143 |
CPRINTF(("SetCapture <BUTTONDOWN>%x\n",hWnd)); |
|
2144 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2145 |
goto commonButton; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2146 |
case WM_LBUTTONDBLCLK: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2147 |
case WM_MBUTTONDBLCLK: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2148 |
case WM_RBUTTONDBLCLK: |
2253 | 2149 |
if (isNative) { |
2150 |
*pDefault = 1; |
|
2151 |
return 0; |
|
2152 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2153 |
commonButton: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2154 |
modifiers = getModifiers(); |
2253 | 2155 |
EVENT_PRINTF3(("WM_BUTTONDOWN h=%x pos=%d/%d\n", |
2156 |
hWnd, LOWORD(lParam), HIWORD(lParam))); |
|
2157 |
||
2158 |
||
2159 |
if (GetWindow_eventMask(hWnd) & ButtonPressMask) |
|
2160 |
enqEvent(ButtonPressMask,hWnd, message, wParam, (int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam), |
|
2161 |
wParam,modifiers); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2162 |
*pDefault = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2163 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2164 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2165 |
return 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2166 |
} |
2253 | 2167 |
#endif |
2151 | 2168 |
LONG APIENTRY |
2169 |
MainWndProc(HWND hWnd,UINT message,UINT wParam,LONG lParam); |
|
2253 | 2170 |
//LONG APIENTRY MainWndProcRoot(HWND hWnd,UINT message,UINT wParam,LONG lParam); |
2151 | 2171 |
|
2232 | 2172 |
void _USERENTRY dispatchThread(void *arg) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2173 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2174 |
static int th_calls; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2175 |
RECT rect; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2176 |
MSG msg; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2177 |
localWindowInfo *li; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2178 |
_dispatchThreadId = GetCurrentThreadId(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2179 |
TH_DPRINTF(("TS %d\n", th_calls++)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2180 |
PeekMessage(&msg,NULL,0,0,PM_NOREMOVE); /* must be */ |
2232 | 2181 |
#ifndef WIN32THREADS |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2182 |
AttachThreadInput(_dispatchThreadId,_masterThreadId,TRUE); |
2232 | 2183 |
#endif |
2151 | 2184 |
/*SetThreadPriority(_masterThread,THREAD_PRIORITY_HIGHEST); |
2185 |
SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_ABOVE_NORMAL);*/ |
|
2186 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2187 |
GetWindowRect(GetDesktopWindow(), &rect); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2188 |
/* allocate localMemory for Window */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2189 |
li = (localWindowInfo*)malloc(sizeof(localWindowInfo)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2190 |
if (li) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2191 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2192 |
memset(li,0,sizeof(*_thread_local)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2193 |
} |
2232 | 2194 |
|
2253 | 2195 |
__rootWinSpezial = CreateWindowEx( WS_EX_TOOLWINDOW|WS_EX_TRANSPARENT,app_nameroot,app_nameroot, |
2196 |
WS_POPUP|WS_DISABLED, |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2197 |
0,0, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2198 |
rect.right-rect.left,rect.bottom-rect.top, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2199 |
0,0,(HANDLE) __getHInstance(),li); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2200 |
|
2151 | 2201 |
/*printf("__rootWinSpezial %x\n",__rootWinSpezial);*/ |
2253 | 2202 |
//ShowWindow(__rootWinSpezial,SW_SHOWNOACTIVATE); |
2232 | 2203 |
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
|
2204 |
SetEvent(hCreateEvent); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2205 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2206 |
while (bdispatchThreadState) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2207 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2208 |
TH_DPRINTF(("TG %d\n", th_calls++)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2209 |
GetMessage(&msg, NULL, 0, 0); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2210 |
TH_DPRINTF(("TD %d\n", th_calls++)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2211 |
destroyWin = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2212 |
if (msg.message == WM_THREADDESTROYWINDOW) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2213 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2214 |
destroyWin = TRUE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2215 |
msg.message = WM_CLOSE; |
2232 | 2216 |
CPRINTF(("thread WM_THREADDESTROYWINDOW %x\n",msg.hwnd)); |
2217 |
} |
|
2218 |
else if (msg.message == WM_THREADSETFOCUS) |
|
2219 |
{ |
|
2253 | 2220 |
#ifdef xxWIN32THREADS |
2232 | 2221 |
if (msg.lParam) |
2222 |
{ |
|
2223 |
if (AttachThreadInput(_dispatchThreadId,msg.lParam,TRUE) == FALSE) |
|
2240 | 2224 |
PRINTF(("SetFocus AttachThreadInput error %d\n",GetLastError())); |
2232 | 2225 |
} |
2226 |
#endif |
|
2227 |
CPRINTF(("threadSetfocus %x\n",msg.wParam)); |
|
2253 | 2228 |
//SetForegroundWindow((HWND)msg.wParam); |
2229 |
//SetWindowPos((HWND)msg.wParam, HWND_TOP, 0, 0, 0, 0, SWP_NOOWNERZORDER |SWP_NOACTIVATE | SWP_NOMOVE|SWP_NOSIZE); |
|
2232 | 2230 |
SetFocus((HWND)msg.wParam); |
2231 |
continue; |
|
2232 |
} |
|
2247 | 2233 |
else if (msg.message == WM_THREADSETCURSOR) |
2234 |
{ |
|
2235 |
if (msg.lParam) |
|
2236 |
{ |
|
2237 |
CPRINTF(("threadSetCursor %x\n",msg.lParam)); |
|
2238 |
SetCursor((HCURSOR)msg.lParam); |
|
2239 |
} |
|
2240 |
continue; |
|
2241 |
} |
|
2232 | 2242 |
else if (msg.message == WM_THREADSETCAPTURE) |
2243 |
{ |
|
2244 |
if (msg.wParam) |
|
2245 |
{ |
|
2244 | 2246 |
currentPointerView = msg.wParam; |
2247 |
currentCapture = CAPTURE_EXPLICIT; |
|
2232 | 2248 |
CPRINTF(("threadSetCapture %x\n",msg.wParam)); |
2244 | 2249 |
SetCapture(currentPointerView); |
2232 | 2250 |
} |
2244 | 2251 |
else |
2252 |
{ |
|
2253 | 2253 |
if (currentPointerView == __rootWinSpezial) |
2254 |
{ |
|
2255 |
//ShowWindow(__rootWinSpezial, SW_HIDE); |
|
2256 |
SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0,SWP_NOREDRAW|SWP_NOSENDCHANGING|SWP_NOCOPYBITS |
|
2257 |
|SWP_HIDEWINDOW| SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE/*| SWP_NOZORDER|SWP_NOOWNERZORDER*/); |
|
2258 |
} |
|
2244 | 2259 |
currentPointerView = 0; |
2260 |
currentCapture = CAPTURE_NONE; |
|
2232 | 2261 |
CPRINTF(("threadReleaseCapture\n")); |
2244 | 2262 |
ReleaseCapture(); |
2263 |
} |
|
2232 | 2264 |
if (msg.lParam) |
2265 |
{ |
|
2244 | 2266 |
CPRINTF(("threadSetCursor %x\n",msg.lParam)); |
2232 | 2267 |
SetCursor((HCURSOR)msg.lParam); |
2244 | 2268 |
} |
2232 | 2269 |
continue; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2270 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2271 |
else if (msg.message == WM_THREADCREATEWINDOW) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2272 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2273 |
TH_DPRINTF(("C %d\n", th_calls)); |
2244 | 2274 |
if (_thread_winStyleBits & WS_POPUP) |
2275 |
{ |
|
2276 |
//_thread_parentHandle = GetActiveWindow(); |
|
2277 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2278 |
_thread_newWinHandle = CreateWindowEx( |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2279 |
_thread_winStyleBitsEx, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2280 |
_thread_className, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2281 |
_thread_windowName, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2282 |
_thread_winStyleBits, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2283 |
_thread_x, _thread_y, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2284 |
_thread_dx,_thread_dy, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2285 |
_thread_parentHandle, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2286 |
NULL, /* menu */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2287 |
(HANDLE) __getHInstance(), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2288 |
_thread_local); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2289 |
SetEvent(hCreateEvent); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2290 |
continue; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2291 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2292 |
/* TranslateMessage(&msg); */ /* Translates virtual key codes */ |
2151 | 2293 |
if ( (msg.message == WM_KEYDOWN) |
2294 |
|| (msg.message == WM_KEYUP) |
|
2295 |
|| (msg.message == WM_SYSKEYDOWN) |
|
2296 |
|| (msg.message == WM_SYSKEYUP) |
|
2297 |
) |
|
2298 |
{ |
|
2232 | 2299 |
#ifdef xxDEBUG |
2300 |
if ((msg.wParam == 0x11) && (msg.message == WM_KEYDOWN))/* CTRL-C */ |
|
2301 |
{ |
|
2302 |
if (c_count++ > 3) /* for debugging */ |
|
2303 |
exit(1); |
|
2304 |
} |
|
2305 |
#endif |
|
2151 | 2306 |
/*printf("keymsg %x\n",msg.wParam);*/ |
2307 |
if ( |
|
2308 |
((msg.wParam >= '0') && (msg.wParam <= 'Z')) |
|
2309 |
|| (msg.wParam == 0x20) |
|
2310 |
|| (msg.wParam == 0x14) |
|
2311 |
/*|| (msg.wParam == 0x10)*/ |
|
2312 |
|| (msg.wParam >= 0xB0) |
|
2313 |
) |
|
2314 |
{ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2315 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2316 |
* translate to a WM_CHAR message |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2317 |
*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2318 |
if (TranslateMessage(&msg)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2319 |
continue; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2320 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2321 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2322 |
evRootX = msg.pt.x; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2323 |
evRootY = msg.pt.y; |
2151 | 2324 |
lastMSGTime = msg.time; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2325 |
DispatchMessage(&msg); /* Dispatches message to window */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2326 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2327 |
return 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2328 |
} |
1127 | 2329 |
|
2330 |
LONG APIENTRY |
|
2151 | 2331 |
MainWndProc(HWND hWnd,UINT message,UINT wParam,LONG lParam) |
1127 | 2332 |
{ |
2333 |
int wantDefault = 1; |
|
2334 |
int retVal; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2335 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2336 |
TH_DPRINTF(("TMW %d\n",message)); |
1127 | 2337 |
retVal = winEventProcessing(hWnd, message, wParam, lParam, &wantDefault); |
2338 |
if (wantDefault) { |
|
1723 | 2339 |
DDPRINTF((">>DefWindowProc\n")); |
1127 | 2340 |
retVal = DefWindowProc(hWnd, message, wParam, lParam); |
1723 | 2341 |
DDPRINTF(("<<DefWindowProc\n")); |
1127 | 2342 |
} |
2343 |
return retVal; |
|
2344 |
} |
|
2253 | 2345 |
#if 0 |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2346 |
LONG APIENTRY |
2151 | 2347 |
MainWndProcRoot(HWND hWnd,UINT message,UINT wParam,LONG lParam) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2348 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2349 |
int wantDefault = 1; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2350 |
int retVal; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2351 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2352 |
TH_DPRINTF(("TMW %d\n",message)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2353 |
retVal = winEventProcessingRoot(hWnd, message, wParam, lParam, &wantDefault); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2354 |
return TRUE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2355 |
} |
2253 | 2356 |
#endif |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2357 |
int CALLBACK |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2358 |
EnumFPTypeFaceProc( lplf, lptm, dwType, lpData ) |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2359 |
LOGFONT* lplf; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2360 |
TEXTMETRIC* lptm; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2361 |
DWORD dwType; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2362 |
LPARAM lpData; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2363 |
{ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2364 |
OBJ t; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2365 |
OBJ* refToList; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2366 |
OBJ typeFaceList; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2367 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2368 |
if (lplf) { |
2151 | 2369 |
refToList = (OBJ*) lpData; |
2370 |
__PROTECT__(*refToList); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2371 |
t = __MKSTRING( lplf->lfFaceName ); |
2151 | 2372 |
__UNPROTECT__(*refToList); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2373 |
typeFaceList = *refToList; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2374 |
__SSEND1( typeFaceList, @symbol(add:), 0, t ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2375 |
} |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2376 |
return 1; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2377 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2378 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2379 |
int CALLBACK |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2380 |
EnumFontsProc( lplf, lptm, dwType, lpData ) |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2381 |
LOGFONT* lplf; /* address of logical-font data */ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2382 |
TEXTMETRIC* lptm; /* address of physical font data */ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2383 |
DWORD dwType; /* font type */ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2384 |
LPARAM lpData; /* address of application supplied data */ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2385 |
{ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2386 |
OBJ newArray, t; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2387 |
OBJ *refToList; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2388 |
OBJ list; |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2389 |
char *s; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2390 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2391 |
DPRINTF(("EnumFontProc\n\n\n\n")); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2392 |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2393 |
if( lplf ) { |
2151 | 2394 |
refToList = (OBJ*) lpData; |
2395 |
__PROTECT__(*refToList); |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2396 |
DPRINTF((" lfHeight %d\n", lplf->lfHeight )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2397 |
DPRINTF((" lfWidth %d\n", lplf->lfWidth )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2398 |
DPRINTF((" lfEscapement %d\n", lplf->lfEscapement )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2399 |
DPRINTF((" lfOrientation %d\n", lplf->lfOrientation )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2400 |
DPRINTF((" lfWeight %d\n", lplf->lfWeight )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2401 |
DPRINTF((" lfItalic %d\n", lplf->lfItalic )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2402 |
DPRINTF((" lfUnderline %d\n", lplf->lfUnderline )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2403 |
DPRINTF((" lfStrikeOut %d\n", lplf->lfStrikeOut )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2404 |
DPRINTF((" lfCharSet %d\n", lplf->lfCharSet )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2405 |
DPRINTF((" lfOutPrecision %d\n", lplf->lfOutPrecision )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2406 |
DPRINTF((" lfClipPrecision %d\n", lplf->lfClipPrecision )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2407 |
DPRINTF((" lfQuality %d\n", lplf->lfQuality )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2408 |
DPRINTF((" lfPitchAndFamily %d\n", lplf->lfPitchAndFamily )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2409 |
DPRINTF((" lfFaceName %s\n\n", lplf->lfFaceName )); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2410 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2411 |
newArray = __ARRAY_NEW_INT(16); |
2151 | 2412 |
__UNPROTECT__(*refToList); |
2413 |
||
2414 |
if ( dwType & TRUETYPE_FONTTYPE ) |
|
2415 |
__ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(0); |
|
2416 |
else |
|
2232 | 2417 |
//__ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(MulDiv(__logPixelSY,lplf->lfHeight, 72)); |
2151 | 2418 |
__ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(lplf->lfHeight); |
2419 |
||
1920 | 2420 |
__ArrayInstPtr(newArray)->a_element[1] = __MKSMALLINT(lplf->lfWidth); |
2421 |
__ArrayInstPtr(newArray)->a_element[2] = __MKSMALLINT(lplf->lfEscapement); |
|
2422 |
__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
|
2423 |
switch (lplf->lfWeight) { |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2424 |
case FW_NORMAL: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2425 |
s = "normal"; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2426 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2427 |
case FW_BOLD: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2428 |
s = "bold"; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2429 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2430 |
case FW_MEDIUM: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2431 |
s = "medium"; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2432 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2433 |
case FW_LIGHT: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2434 |
s = "demi"; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2435 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2436 |
default: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2437 |
s = "other"; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2438 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2439 |
} |
2151 | 2440 |
__PROTECT__(*refToList); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2441 |
__PROTECT__(newArray); |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2442 |
t = __MKSTRING(s); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2443 |
__UNPROTECT__(newArray); |
2151 | 2444 |
__UNPROTECT__(*refToList); |
1920 | 2445 |
__ArrayInstPtr(newArray)->a_element[4] = t; __STORE(newArray, t); |
2446 |
||
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2447 |
if( lplf->lfItalic == TRUE ) { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2448 |
if( lplf->lfUnderline == TRUE ) { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2449 |
if( lplf->lfStrikeOut == TRUE ) { |
1920 | 2450 |
s = "italic-underline-strikeOut"; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2451 |
} else { |
1920 | 2452 |
s = "italic-underline"; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2453 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2454 |
} else { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2455 |
if( lplf->lfStrikeOut == TRUE ) { |
1920 | 2456 |
s = "italic-strikeOut"; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2457 |
} else { |
1920 | 2458 |
s = "italic"; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2459 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2460 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2461 |
} else { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2462 |
if( lplf->lfUnderline == TRUE ) { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2463 |
if( lplf->lfStrikeOut == TRUE ) { |
1920 | 2464 |
s = "underline-strikeOut"; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2465 |
} else { |
1920 | 2466 |
s = "underline"; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2467 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2468 |
} else { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2469 |
if( lplf->lfStrikeOut == TRUE ) { |
1920 | 2470 |
s = "strikeOut"; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2471 |
} else { |
1920 | 2472 |
s = "normal"; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2473 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2474 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2475 |
} |
2151 | 2476 |
__PROTECT__(*refToList); |
1920 | 2477 |
__PROTECT__(newArray); |
2478 |
t = __MKSTRING(s); |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2479 |
__UNPROTECT__(newArray); |
2151 | 2480 |
__UNPROTECT__(*refToList); |
1920 | 2481 |
__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
|
2482 |
|
1920 | 2483 |
__ArrayInstPtr(newArray)->a_element[5] = __MKSMALLINT(lplf->lfItalic); |
2484 |
__ArrayInstPtr(newArray)->a_element[6] = __MKSMALLINT(lplf->lfUnderline); |
|
2485 |
__ArrayInstPtr(newArray)->a_element[7] = __MKSMALLINT(lplf->lfStrikeOut); |
|
2486 |
__ArrayInstPtr(newArray)->a_element[8] = __MKSMALLINT(lplf->lfCharSet); |
|
2487 |
__ArrayInstPtr(newArray)->a_element[9] = __MKSMALLINT(lplf->lfOutPrecision); |
|
2488 |
__ArrayInstPtr(newArray)->a_element[10] = __MKSMALLINT(lplf->lfClipPrecision); |
|
2489 |
__ArrayInstPtr(newArray)->a_element[11] = __MKSMALLINT(lplf->lfQuality); |
|
2490 |
__ArrayInstPtr(newArray)->a_element[12] = __MKSMALLINT(lplf->lfPitchAndFamily); |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2491 |
/* ... */ |
2151 | 2492 |
__PROTECT__(*refToList); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2493 |
__PROTECT__(newArray); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2494 |
t = __MKSTRING(lplf->lfFaceName); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2495 |
__UNPROTECT__(newArray); |
2151 | 2496 |
__UNPROTECT__(*refToList); |
1920 | 2497 |
__ArrayInstPtr(newArray)->a_element[13] = t; __STORE(newArray, t); |
2498 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2499 |
switch (lplf->lfCharSet) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2500 |
case ANSI_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2501 |
s = "ansi"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2502 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2503 |
case DEFAULT_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2504 |
s = "default"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2505 |
case SYMBOL_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2506 |
s = "symbol"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2507 |
case SHIFTJIS_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2508 |
s = "sjis"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2509 |
case GB2312_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2510 |
s = "gb"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2511 |
case HANGEUL_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2512 |
s = "hangeul"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2513 |
case CHINESEBIG5_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2514 |
s = "big5"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2515 |
case OEM_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2516 |
s = "oem"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2517 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2518 |
# ifdef JOHAB_CHARSET |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2519 |
case JOHAB_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2520 |
s = "johab"; |
2151 | 2521 |
break; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2522 |
# endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2523 |
# ifdef HEBREW_CHARSET |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2524 |
case HEBREW_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2525 |
s = "hebrew"; |
2151 | 2526 |
break; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2527 |
# endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2528 |
# ifdef GREEK_CHARSET |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2529 |
case GREEK_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2530 |
s = "greek"; |
2151 | 2531 |
break; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2532 |
# endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2533 |
# ifdef RUSSIAN_CHARSET |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2534 |
case RUSSIAN_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2535 |
s = "russian"; |
2151 | 2536 |
break; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2537 |
# endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2538 |
# ifdef MAC_CHARSET |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2539 |
case MAC_CHARSET: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2540 |
s = "mac"; |
2151 | 2541 |
break; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2542 |
# endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2543 |
default: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2544 |
s = "unknown"; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2545 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2546 |
} |
2151 | 2547 |
__PROTECT__(*refToList); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2548 |
__PROTECT__(newArray); |
1920 | 2549 |
t = __MKSTRING(s); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2550 |
__UNPROTECT__(newArray); |
2151 | 2551 |
__UNPROTECT__(*refToList); |
2552 |
||
1920 | 2553 |
__ArrayInstPtr(newArray)->a_element[14] = t; __STORE(newArray, t); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2554 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2555 |
list = *refToList; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2556 |
__SSEND1(list, @symbol(add:), 0, newArray); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2557 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2558 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2559 |
DPRINTF((" dwType %d\n", dwType )); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2560 |
return 1; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2561 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2562 |
|
1127 | 2563 |
%} |
2232 | 2564 |
! ! |
2565 |
||
2566 |
!WinWorkstation class methodsFor:'documentation'! |
|
2567 |
||
1127 | 2568 |
copyright |
2569 |
" |
|
2570 |
COPYRIGHT (c) 1996 by Claus Gittinger |
|
2571 |
All Rights Reserved |
|
2572 |
||
2573 |
This software is furnished under a license and may be used |
|
2574 |
only in accordance with the terms of that license and with the |
|
2575 |
inclusion of the above copyright notice. This software may not |
|
2576 |
be provided or otherwise made available to, or used by, any |
|
2577 |
other person. No title to or ownership of the software is |
|
2578 |
hereby transferred. |
|
2579 |
" |
|
2232 | 2580 |
! |
2581 |
||
1127 | 2582 |
documentation |
2583 |
" |
|
2584 |
See more documentation in my superclass, DeviceWorkstation. |
|
2585 |
||
2586 |
[author:] |
|
2587 |
Claus Gittinger |
|
2588 |
" |
|
2232 | 2589 |
! ! |
2590 |
||
2591 |
!WinWorkstation class methodsFor:'initialization'! |
|
2592 |
||
1127 | 2593 |
initialize |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
2594 |
|nButtons swap| |
1127 | 2595 |
|
2596 |
super initialize. |
|
2597 |
||
2151 | 2598 |
self initializeStandardColorNames. |
2599 |
||
1705 | 2600 |
NativeWindows := false. |
2601 |
||
1127 | 2602 |
BeepFrequency := 440. "/ Hertz |
2603 |
BeepDuration := 200. "/ millis |
|
2604 |
||
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2605 |
ButtonTranslation := #(1 2 2). |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2606 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2607 |
nButtons := self getSystemMetrics:#mouseButtons. |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2608 |
swap := self getSystemMetrics:#swapButton. |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2609 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2610 |
nButtons == 0 ifTrue:[ |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2611 |
'WinWorkstation [warning]: mouse-less operation may not work' infoPrintCR. |
1127 | 2612 |
] ifFalse:[ |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2613 |
nButtons == 2 ifTrue:[ |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2614 |
ButtonTranslation := #(1 2). |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2615 |
]. |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2616 |
swap ifTrue:[ |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2617 |
ButtonTranslation := ButtonTranslation copy reverse |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2618 |
] |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
2619 |
]. |
1705 | 2620 |
|
2621 |
"/ translation table from ST/X windowType symbol (system-independent) |
|
2622 |
"/ to Windows windowClass (windows-specific). |
|
2232 | 2623 |
|
1705 | 2624 |
NativeWindowClassTable := IdentityDictionary new. |
2625 |
NativeWindowClassTable at:#ScrollBar put:'SCROLLBAR'. |
|
2626 |
NativeWindowClassTable at:#CheckBox put:'BUTTON'. |
|
2627 |
NativeWindowClassTable at:#RadioButton put:'BUTTON'. |
|
2628 |
NativeWindowClassTable at:#Button put:'BUTTON'. |
|
2629 |
NativeWindowClassTable at:#DefaultButton put:'BUTTON'. |
|
2630 |
NativeWindowClassTable at:#ComboBox put:'COMBOBOX'. |
|
2631 |
NativeWindowClassTable at:#EditField put:'EDIT'. |
|
2632 |
NativeWindowClassTable at:#ListBox put:'LISTBOX'. |
|
2232 | 2633 |
! |
2634 |
||
2151 | 2635 |
initializeStandardColorNames |
2636 |
"{ Pragma: +optSpace }" |
|
2637 |
||
2638 |
"setup standard colors" |
|
2639 |
||
2640 |
StandardColorValues := Dictionary new. |
|
2641 |
#( |
|
2642 |
(240 248 255) 'alice blue' |
|
2643 |
(240 248 255) 'AliceBlue' |
|
2644 |
(250 235 215) 'antique white' |
|
2645 |
(250 235 215) 'AntiqueWhite' |
|
2646 |
(255 239 219) 'AntiqueWhite1' |
|
2647 |
(238 223 204) 'AntiqueWhite2' |
|
2648 |
(205 192 176) 'AntiqueWhite3' |
|
2649 |
(139 131 120) 'AntiqueWhite4' |
|
2650 |
(127 255 212) 'aquamarine' |
|
2651 |
(127 255 212) 'aquamarine1' |
|
2652 |
(118 238 198) 'aquamarine2' |
|
2653 |
(102 205 170) 'aquamarine3' |
|
2654 |
( 69 139 116) 'aquamarine4' |
|
2655 |
(240 255 255) 'azure' |
|
2656 |
(240 255 255) 'azure1' |
|
2657 |
(224 238 238) 'azure2' |
|
2658 |
(193 205 205) 'azure3' |
|
2659 |
(131 139 139) 'azure4' |
|
2660 |
(245 245 220) 'beige' |
|
2661 |
(255 228 196) 'bisque' |
|
2662 |
(255 228 196) 'bisque1' |
|
2663 |
(238 213 183) 'bisque2' |
|
2664 |
(205 183 158) 'bisque3' |
|
2665 |
(139 125 107) 'bisque4' |
|
2666 |
( 0 0 0) 'black' |
|
2667 |
(255 235 205) 'blanched almond' |
|
2668 |
(255 235 205) 'BlanchedAlmond' |
|
2669 |
( 0 0 255) 'blue' |
|
2670 |
(138 43 226) 'blue violet' |
|
2671 |
( 0 0 255) 'blue1' |
|
2672 |
( 0 0 238) 'blue2' |
|
2673 |
( 0 0 205) 'blue3' |
|
2674 |
( 0 0 139) 'blue4' |
|
2675 |
(138 43 226) 'BlueViolet' |
|
2676 |
(165 42 42) 'brown' |
|
2677 |
(255 64 64) 'brown1' |
|
2678 |
(238 59 59) 'brown2' |
|
2679 |
(205 51 51) 'brown3' |
|
2680 |
(139 35 35) 'brown4' |
|
2681 |
(222 184 135) 'burlywood' |
|
2682 |
(255 211 155) 'burlywood1' |
|
2683 |
(238 197 145) 'burlywood2' |
|
2684 |
(205 170 125) 'burlywood3' |
|
2685 |
(139 115 85) 'burlywood4' |
|
2686 |
( 95 158 160) 'cadet blue' |
|
2687 |
( 95 158 160) 'CadetBlue' |
|
2688 |
(152 245 255) 'CadetBlue1' |
|
2689 |
(142 229 238) 'CadetBlue2' |
|
2690 |
(122 197 205) 'CadetBlue3' |
|
2691 |
( 83 134 139) 'CadetBlue4' |
|
2692 |
(127 255 0) 'chartreuse' |
|
2693 |
(127 255 0) 'chartreuse1' |
|
2694 |
(118 238 0) 'chartreuse2' |
|
2695 |
(102 205 0) 'chartreuse3' |
|
2696 |
( 69 139 0) 'chartreuse4' |
|
2697 |
(210 105 30) 'chocolate' |
|
2698 |
(255 127 36) 'chocolate1' |
|
2699 |
(238 118 33) 'chocolate2' |
|
2700 |
(205 102 29) 'chocolate3' |
|
2701 |
(139 69 19) 'chocolate4' |
|
2702 |
(255 127 80) 'coral' |
|
2703 |
(255 114 86) 'coral1' |
|
2704 |
(238 106 80) 'coral2' |
|
2705 |
(205 91 69) 'coral3' |
|
2706 |
(139 62 47) 'coral4' |
|
2707 |
(100 149 237) 'cornflower blue' |
|
2708 |
(100 149 237) 'CornflowerBlue' |
|
2709 |
(255 248 220) 'cornsilk' |
|
2710 |
(255 248 220) 'cornsilk1' |
|
2711 |
(238 232 205) 'cornsilk2' |
|
2712 |
(205 200 177) 'cornsilk3' |
|
2713 |
(139 136 120) 'cornsilk4' |
|
2714 |
( 0 255 255) 'cyan' |
|
2715 |
( 0 255 255) 'cyan1' |
|
2716 |
( 0 238 238) 'cyan2' |
|
2717 |
( 0 205 205) 'cyan3' |
|
2718 |
( 0 139 139) 'cyan4' |
|
2719 |
( 0 0 139) 'dark blue' |
|
2720 |
( 0 139 139) 'dark cyan' |
|
2721 |
(184 134 11) 'dark goldenrod' |
|
2722 |
(169 169 169) 'dark gray' |
|
2723 |
( 0 100 0) 'dark green' |
|
2724 |
(169 169 169) 'dark grey' |
|
2725 |
(189 183 107) 'dark khaki' |
|
2726 |
(139 0 139) 'dark magenta' |
|
2727 |
( 85 107 47) 'dark olive green' |
|
2728 |
(255 140 0) 'dark orange' |
|
2729 |
(153 50 204) 'dark orchid' |
|
2730 |
(139 0 0) 'dark red' |
|
2731 |
(233 150 122) 'dark salmon' |
|
2732 |
(143 188 143) 'dark sea green' |
|
2733 |
( 72 61 139) 'dark slate blue' |
|
2734 |
( 47 79 79) 'dark slate gray' |
|
2735 |
( 47 79 79) 'dark slate grey' |
|
2736 |
( 0 206 209) 'dark turquoise' |
|
2737 |
(148 0 211) 'dark violet' |
|
2738 |
( 0 0 139) 'DarkBlue' |
|
2739 |
( 0 139 139) 'DarkCyan' |
|
2740 |
(184 134 11) 'DarkGoldenrod' |
|
2741 |
(255 185 15) 'DarkGoldenrod1' |
|
2742 |
(238 173 14) 'DarkGoldenrod2' |
|
2743 |
(205 149 12) 'DarkGoldenrod3' |
|
2744 |
(139 101 8) 'DarkGoldenrod4' |
|
2745 |
(169 169 169) 'DarkGray' |
|
2746 |
( 0 100 0) 'DarkGreen' |
|
2747 |
(169 169 169) 'DarkGrey' |
|
2748 |
(189 183 107) 'DarkKhaki' |
|
2749 |
(139 0 139) 'DarkMagenta' |
|
2750 |
( 85 107 47) 'DarkOliveGreen' |
|
2751 |
(202 255 112) 'DarkOliveGreen1' |
|
2752 |
(188 238 104) 'DarkOliveGreen2' |
|
2753 |
(162 205 90) 'DarkOliveGreen3' |
|
2754 |
(110 139 61) 'DarkOliveGreen4' |
|
2755 |
(255 140 0) 'DarkOrange' |
|
2756 |
(255 127 0) 'DarkOrange1' |
|
2757 |
(238 118 0) 'DarkOrange2' |
|
2758 |
(205 102 0) 'DarkOrange3' |
|
2759 |
(139 69 0) 'DarkOrange4' |
|
2760 |
(153 50 204) 'DarkOrchid' |
|
2761 |
(191 62 255) 'DarkOrchid1' |
|
2762 |
(178 58 238) 'DarkOrchid2' |
|
2763 |
(154 50 205) 'DarkOrchid3' |
|
2764 |
(104 34 139) 'DarkOrchid4' |
|
2765 |
(139 0 0) 'DarkRed' |
|
2766 |
(233 150 122) 'DarkSalmon' |
|
2767 |
(143 188 143) 'DarkSeaGreen' |
|
2768 |
(193 255 193) 'DarkSeaGreen1' |
|
2769 |
(180 238 180) 'DarkSeaGreen2' |
|
2770 |
(155 205 155) 'DarkSeaGreen3' |
|
2771 |
(105 139 105) 'DarkSeaGreen4' |
|
2772 |
( 72 61 139) 'DarkSlateBlue' |
|
2773 |
( 47 79 79) 'DarkSlateGray' |
|
2774 |
(151 255 255) 'DarkSlateGray1' |
|
2775 |
(141 238 238) 'DarkSlateGray2' |
|
2776 |
(121 205 205) 'DarkSlateGray3' |
|
2777 |
( 82 139 139) 'DarkSlateGray4' |
|
2778 |
( 47 79 79) 'DarkSlateGrey' |
|
2779 |
( 0 206 209) 'DarkTurquoise' |
|
2780 |
(148 0 211) 'DarkViolet' |
|
2781 |
(255 20 147) 'deep pink' |
|
2782 |
( 0 191 255) 'deep sky blue' |
|
2783 |
(255 20 147) 'DeepPink' |
|
2784 |
(255 20 147) 'DeepPink1' |
|
2785 |
(238 18 137) 'DeepPink2' |
|
2786 |
(205 16 118) 'DeepPink3' |
|
2787 |
(139 10 80) 'DeepPink4' |
|
2788 |
( 0 191 255) 'DeepSkyBlue' |
|
2789 |
( 0 191 255) 'DeepSkyBlue1' |
|
2790 |
( 0 178 238) 'DeepSkyBlue2' |
|
2791 |
( 0 154 205) 'DeepSkyBlue3' |
|
2792 |
( 0 104 139) 'DeepSkyBlue4' |
|
2793 |
(105 105 105) 'dim gray' |
|
2794 |
(105 105 105) 'dim grey' |
|
2795 |
(105 105 105) 'DimGray' |
|
2796 |
(105 105 105) 'DimGrey' |
|
2797 |
( 30 144 255) 'dodger blue' |
|
2798 |
( 30 144 255) 'DodgerBlue' |
|
2799 |
( 30 144 255) 'DodgerBlue1' |
|
2800 |
( 28 134 238) 'DodgerBlue2' |
|
2801 |
( 24 116 205) 'DodgerBlue3' |
|
2802 |
( 16 78 139) 'DodgerBlue4' |
|
2803 |
(178 34 34) 'firebrick' |
|
2804 |
(255 48 48) 'firebrick1' |
|
2805 |
(238 44 44) 'firebrick2' |
|
2806 |
(205 38 38) 'firebrick3' |
|
2807 |
(139 26 26) 'firebrick4' |
|
2808 |
(255 250 240) 'floral white' |
|
2809 |
(255 250 240) 'FloralWhite' |
|
2810 |
( 34 139 34) 'forest green' |
|
2811 |
( 34 139 34) 'ForestGreen' |
|
2812 |
(220 220 220) 'gainsboro' |
|
2813 |
(248 248 255) 'ghost white' |
|
2814 |
(248 248 255) 'GhostWhite' |
|
2815 |
(255 215 0) 'gold' |
|
2816 |
(255 215 0) 'gold1' |
|
2817 |
(238 201 0) 'gold2' |
|
2818 |
(205 173 0) 'gold3' |
|
2819 |
(139 117 0) 'gold4' |
|
2820 |
(218 165 32) 'goldenrod' |
|
2821 |
(255 193 37) 'goldenrod1' |
|
2822 |
(238 180 34) 'goldenrod2' |
|
2823 |
(205 155 29) 'goldenrod3' |
|
2824 |
(139 105 20) 'goldenrod4' |
|
2232 | 2825 |
|
2826 |
(192 192 192) 'grey' |
|
2827 |
( 0 0 0) 'grey0' |
|
2828 |
( 3 3 3) 'grey1' |
|
2829 |
( 26 26 26) 'grey10' |
|
2830 |
(255 255 255) 'grey100' |
|
2831 |
( 28 28 28) 'grey11' |
|
2832 |
( 31 31 31) 'grey12' |
|
2833 |
( 33 33 33) 'grey13' |
|
2834 |
( 36 36 36) 'grey14' |
|
2835 |
( 38 38 38) 'grey15' |
|
2836 |
( 41 41 41) 'grey16' |
|
2837 |
( 43 43 43) 'grey17' |
|
2838 |
( 46 46 46) 'grey18' |
|
2839 |
( 48 48 48) 'grey19' |
|
2840 |
( 5 5 5) 'grey2' |
|
2841 |
( 51 51 51) 'grey20' |
|
2842 |
( 54 54 54) 'grey21' |
|
2843 |
( 56 56 56) 'grey22' |
|
2844 |
( 59 59 59) 'grey23' |
|
2845 |
( 61 61 61) 'grey24' |
|
2846 |
( 64 64 64) 'grey25' |
|
2847 |
( 66 66 66) 'grey26' |
|
2848 |
( 69 69 69) 'grey27' |
|
2849 |
( 71 71 71) 'grey28' |
|
2850 |
( 74 74 74) 'grey29' |
|
2851 |
( 8 8 8) 'grey3' |
|
2852 |
( 77 77 77) 'grey30' |
|
2853 |
( 79 79 79) 'grey31' |
|
2854 |
( 82 82 82) 'grey32' |
|
2855 |
( 84 84 84) 'grey33' |
|
2856 |
( 87 87 87) 'grey34' |
|
2857 |
( 89 89 89) 'grey35' |
|
2858 |
( 92 92 92) 'grey36' |
|
2859 |
( 94 94 94) 'grey37' |
|
2860 |
( 97 97 97) 'grey38' |
|
2861 |
( 99 99 99) 'grey39' |
|
2862 |
( 10 10 10) 'grey4' |
|
2863 |
(102 102 102) 'grey40' |
|
2864 |
(105 105 105) 'grey41' |
|
2865 |
(107 107 107) 'grey42' |
|
2866 |
(110 110 110) 'grey43' |
|
2867 |
(112 112 112) 'grey44' |
|
2868 |
(115 115 115) 'grey45' |
|
2869 |
(117 117 117) 'grey46' |
|
2870 |
(120 120 120) 'grey47' |
|
2871 |
(122 122 122) 'grey48' |
|
2872 |
(125 125 125) 'grey49' |
|
2873 |
( 13 13 13) 'grey5' |
|
2874 |
(127 127 127) 'grey50' |
|
2875 |
(130 130 130) 'grey51' |
|
2876 |
(133 133 133) 'grey52' |
|
2877 |
(135 135 135) 'grey53' |
|
2878 |
(138 138 138) 'grey54' |
|
2879 |
(140 140 140) 'grey55' |
|
2880 |
(143 143 143) 'grey56' |
|
2881 |
(145 145 145) 'grey57' |
|
2882 |
(148 148 148) 'grey58' |
|
2883 |
(150 150 150) 'grey59' |
|
2884 |
( 15 15 15) 'grey6' |
|
2885 |
(153 153 153) 'grey60' |
|
2886 |
(156 156 156) 'grey61' |
|
2887 |
(158 158 158) 'grey62' |
|
2888 |
(161 161 161) 'grey63' |
|
2889 |
(163 163 163) 'grey64' |
|
2890 |
(166 166 166) 'grey65' |
|
2891 |
(168 168 168) 'grey66' |
|
2892 |
(171 171 171) 'grey67' |
|
2893 |
(173 173 173) 'grey68' |
|
2894 |
(176 176 176) 'grey69' |
|
2895 |
( 18 18 18) 'grey7' |
|
2896 |
(179 179 179) 'grey70' |
|
2897 |
(181 181 181) 'grey71' |
|
2898 |
(184 184 184) 'grey72' |
|
2899 |
(186 186 186) 'grey73' |
|
2900 |
(189 189 189) 'grey74' |
|
2901 |
(191 191 191) 'grey75' |
|
2902 |
(194 194 194) 'grey76' |
|
2903 |
(196 196 196) 'grey77' |
|
2904 |
(199 199 199) 'grey78' |
|
2905 |
(201 201 201) 'grey79' |
|
2906 |
( 20 20 20) 'grey8' |
|
2907 |
(204 204 204) 'grey80' |
|
2908 |
(207 207 207) 'grey81' |
|
2909 |
(209 209 209) 'grey82' |
|
2910 |
(212 212 212) 'grey83' |
|
2911 |
(214 214 214) 'grey84' |
|
2912 |
(217 217 217) 'grey85' |
|
2913 |
(219 219 219) 'grey86' |
|
2914 |
(222 222 222) 'grey87' |
|
2915 |
(224 224 224) 'grey88' |
|
2916 |
(227 227 227) 'grey89' |
|
2917 |
( 23 23 23) 'grey9' |
|
2918 |
(229 229 229) 'grey90' |
|
2919 |
(232 232 232) 'grey91' |
|
2920 |
(235 235 235) 'grey92' |
|
2921 |
(237 237 237) 'grey93' |
|
2922 |
(240 240 240) 'grey94' |
|
2923 |
(242 242 242) 'grey95' |
|
2924 |
(245 245 245) 'grey96' |
|
2925 |
(247 247 247) 'grey97' |
|
2926 |
(250 250 250) 'grey98' |
|
2927 |
(252 252 252) 'grey99' |
|
2928 |
||
2151 | 2929 |
(192 192 192) 'gray' |
2930 |
( 0 0 0) 'gray0' |
|
2931 |
( 3 3 3) 'gray1' |
|
2932 |
( 26 26 26) 'gray10' |
|
2933 |
(255 255 255) 'gray100' |
|
2934 |
( 28 28 28) 'gray11' |
|
2935 |
( 31 31 31) 'gray12' |
|
2936 |
( 33 33 33) 'gray13' |
|
2937 |
( 36 36 36) 'gray14' |
|
2938 |
( 38 38 38) 'gray15' |
|
2939 |
( 41 41 41) 'gray16' |
|
2940 |
( 43 43 43) 'gray17' |
|
2941 |
( 46 46 46) 'gray18' |
|
2942 |
( 48 48 48) 'gray19' |
|
2943 |
( 5 5 5) 'gray2' |
|
2944 |
( 51 51 51) 'gray20' |
|
2945 |
( 54 54 54) 'gray21' |
|
2946 |
( 56 56 56) 'gray22' |
|
2947 |
( 59 59 59) 'gray23' |
|
2948 |
( 61 61 61) 'gray24' |
|
2949 |
( 64 64 64) 'gray25' |
|
2950 |
( 66 66 66) 'gray26' |
|
2951 |
( 69 69 69) 'gray27' |
|
2952 |
( 71 71 71) 'gray28' |
|
2953 |
( 74 74 74) 'gray29' |
|
2954 |
( 8 8 8) 'gray3' |
|
2955 |
( 77 77 77) 'gray30' |
|
2956 |
( 79 79 79) 'gray31' |
|
2957 |
( 82 82 82) 'gray32' |
|
2958 |
( 84 84 84) 'gray33' |
|
2959 |
( 87 87 87) 'gray34' |
|
2960 |
( 89 89 89) 'gray35' |
|
2961 |
( 92 92 92) 'gray36' |
|
2962 |
( 94 94 94) 'gray37' |
|
2963 |
( 97 97 97) 'gray38' |
|
2964 |
( 99 99 99) 'gray39' |
|
2965 |
( 10 10 10) 'gray4' |
|
2966 |
(102 102 102) 'gray40' |
|
2967 |
(105 105 105) 'gray41' |
|
2968 |
(107 107 107) 'gray42' |
|
2969 |
(110 110 110) 'gray43' |
|
2970 |
(112 112 112) 'gray44' |
|
2971 |
(115 115 115) 'gray45' |
|
2972 |
(117 117 117) 'gray46' |
|
2973 |
(120 120 120) 'gray47' |
|
2974 |
(122 122 122) 'gray48' |
|
2975 |
(125 125 125) 'gray49' |
|
2976 |
( 13 13 13) 'gray5' |
|
2977 |
(127 127 127) 'gray50' |
|
2978 |
(130 130 130) 'gray51' |
|
2979 |
(133 133 133) 'gray52' |
|
2980 |
(135 135 135) 'gray53' |
|
2981 |
(138 138 138) 'gray54' |
|
2982 |
(140 140 140) 'gray55' |
|
2983 |
(143 143 143) 'gray56' |
|
2984 |
(145 145 145) 'gray57' |
|
2985 |
(148 148 148) 'gray58' |
|
2986 |
(150 150 150) 'gray59' |
|
2987 |
( 15 15 15) 'gray6' |
|
2988 |
(153 153 153) 'gray60' |
|
2989 |
(156 156 156) 'gray61' |
|
2990 |
(158 158 158) 'gray62' |
|
2991 |
(161 161 161) 'gray63' |
|
2992 |
(163 163 163) 'gray64' |
|
2993 |
(166 166 166) 'gray65' |
|
2994 |
(168 168 168) 'gray66' |
|
2995 |
(171 171 171) 'gray67' |
|
2996 |
(173 173 173) 'gray68' |
|
2997 |
(176 176 176) 'gray69' |
|
2998 |
( 18 18 18) 'gray7' |
|
2999 |
(179 179 179) 'gray70' |
|
3000 |
(181 181 181) 'gray71' |
|
3001 |
(184 184 184) 'gray72' |
|
3002 |
(186 186 186) 'gray73' |
|
3003 |
(189 189 189) 'gray74' |
|
3004 |
(191 191 191) 'gray75' |
|
3005 |
(194 194 194) 'gray76' |
|
3006 |
(196 196 196) 'gray77' |
|
3007 |
(199 199 199) 'gray78' |
|
3008 |
(201 201 201) 'gray79' |
|
3009 |
( 20 20 20) 'gray8' |
|
3010 |
(204 204 204) 'gray80' |
|
3011 |
(207 207 207) 'gray81' |
|
3012 |
(209 209 209) 'gray82' |
|
3013 |
(212 212 212) 'gray83' |
|
3014 |
(214 214 214) 'gray84' |
|
3015 |
(217 217 217) 'gray85' |
|
3016 |
(219 219 219) 'gray86' |
|
3017 |
(222 222 222) 'gray87' |
|
3018 |
(224 224 224) 'gray88' |
|
3019 |
(227 227 227) 'gray89' |
|
3020 |
( 23 23 23) 'gray9' |
|
3021 |
(229 229 229) 'gray90' |
|
3022 |
(232 232 232) 'gray91' |
|
3023 |
(235 235 235) 'gray92' |
|
3024 |
(237 237 237) 'gray93' |
|
3025 |
(240 240 240) 'gray94' |
|
3026 |
(242 242 242) 'gray95' |
|
3027 |
(245 245 245) 'gray96' |
|
3028 |
(247 247 247) 'gray97' |
|
3029 |
(250 250 250) 'gray98' |
|
3030 |
(252 252 252) 'gray99' |
|
3031 |
( 0 255 0) 'green' |
|
3032 |
(173 255 47) 'green yellow' |
|
3033 |
( 0 255 0) 'green1' |
|
3034 |
( 0 238 0) 'green2' |
|
3035 |
( 0 205 0) 'green3' |
|
3036 |
( 0 139 0) 'green4' |
|
3037 |
(173 255 47) 'GreenYellow' |
|
3038 |
(240 255 240) 'honeydew' |
|
3039 |
(240 255 240) 'honeydew1' |
|
3040 |
(224 238 224) 'honeydew2' |
|
3041 |
(193 205 193) 'honeydew3' |
|
3042 |
(131 139 131) 'honeydew4' |
|
3043 |
(255 105 180) 'hot pink' |
|
3044 |
(255 105 180) 'HotPink' |
|
3045 |
(255 110 180) 'HotPink1' |
|
3046 |
(238 106 167) 'HotPink2' |
|
3047 |
(205 96 144) 'HotPink3' |
|
3048 |
(139 58 98) 'HotPink4' |
|
3049 |
(205 92 92) 'indian red' |
|
3050 |
(205 92 92) 'IndianRed' |
|
3051 |
(255 106 106) 'IndianRed1' |
|
3052 |
(238 99 99) 'IndianRed2' |
|
3053 |
(205 85 85) 'IndianRed3' |
|
3054 |
(139 58 58) 'IndianRed4' |
|
3055 |
(255 255 240) 'ivory' |
|
3056 |
(255 255 240) 'ivory1' |
|
3057 |
(238 238 224) 'ivory2' |
|
3058 |
(205 205 193) 'ivory3' |
|
3059 |
(139 139 131) 'ivory4' |
|
3060 |
(240 230 140) 'khaki' |
|
3061 |
(255 246 143) 'khaki1' |
|
3062 |
(238 230 133) 'khaki2' |
|
3063 |
(205 198 115) 'khaki3' |
|
3064 |
(139 134 78) 'khaki4' |
|
3065 |
(230 230 250) 'lavender' |
|
3066 |
(255 240 245) 'lavender blush' |
|
3067 |
(255 240 245) 'LavenderBlush' |
|
3068 |
(255 240 245) 'LavenderBlush1' |
|
3069 |
(238 224 229) 'LavenderBlush2' |
|
3070 |
(205 193 197) 'LavenderBlush3' |
|
3071 |
(139 131 134) 'LavenderBlush4' |
|
3072 |
(124 252 0) 'lawn green' |
|
3073 |
(124 252 0) 'LawnGreen' |
|
3074 |
(255 250 205) 'lemon chiffon' |
|
3075 |
(255 250 205) 'LemonChiffon' |
|
3076 |
(255 250 205) 'LemonChiffon1' |
|
3077 |
(238 233 191) 'LemonChiffon2' |
|
3078 |
(205 201 165) 'LemonChiffon3' |
|
3079 |
(139 137 112) 'LemonChiffon4' |
|
3080 |
(173 216 230) 'light blue' |
|
3081 |
(240 128 128) 'light coral' |
|
3082 |
(224 255 255) 'light cyan' |
|
3083 |
(238 221 130) 'light goldenrod' |
|
3084 |
(250 250 210) 'light goldenrod yellow' |
|
3085 |
(211 211 211) 'light gray' |
|
3086 |
(144 238 144) 'light green' |
|
3087 |
(211 211 211) 'light grey' |
|
3088 |
(255 182 193) 'light pink' |
|
3089 |
(255 160 122) 'light salmon' |
|
3090 |
( 32 178 170) 'light sea green' |
|
3091 |
(135 206 250) 'light sky blue' |
|
3092 |
(132 112 255) 'light slate blue' |
|
3093 |
(119 136 153) 'light slate gray' |
|
3094 |
(119 136 153) 'light slate grey' |
|
3095 |
(176 196 222) 'light steel blue' |
|
3096 |
(255 255 224) 'light yellow' |
|
3097 |
(173 216 230) 'LightBlue' |
|
3098 |
(191 239 255) 'LightBlue1' |
|
3099 |
(178 223 238) 'LightBlue2' |
|
3100 |
(154 192 205) 'LightBlue3' |
|
3101 |
(104 131 139) 'LightBlue4' |
|
3102 |
(240 128 128) 'LightCoral' |
|
3103 |
(224 255 255) 'LightCyan' |
|
3104 |
(224 255 255) 'LightCyan1' |
|
3105 |
(209 238 238) 'LightCyan2' |
|
3106 |
(180 205 205) 'LightCyan3' |
|
3107 |
(122 139 139) 'LightCyan4' |
|
3108 |
(238 221 130) 'LightGoldenrod' |
|
3109 |
(255 236 139) 'LightGoldenrod1' |
|
3110 |
(238 220 130) 'LightGoldenrod2' |
|
3111 |
(205 190 112) 'LightGoldenrod3' |
|
3112 |
(139 129 76) 'LightGoldenrod4' |
|
3113 |
(250 250 210) 'LightGoldenrodYellow' |
|
3114 |
(211 211 211) 'LightGray' |
|
3115 |
(144 238 144) 'LightGreen' |
|
3116 |
(211 211 211) 'LightGrey' |
|
3117 |
(255 182 193) 'LightPink' |
|
3118 |
(255 174 185) 'LightPink1' |
|
3119 |
(238 162 173) 'LightPink2' |
|
3120 |
(205 140 149) 'LightPink3' |
|
3121 |
(139 95 101) 'LightPink4' |
|
3122 |
(255 160 122) 'LightSalmon' |
|
3123 |
(255 160 122) 'LightSalmon1' |
|
3124 |
(238 149 114) 'LightSalmon2' |
|
3125 |
(205 129 98) 'LightSalmon3' |
|
3126 |
(139 87 66) 'LightSalmon4' |
|
3127 |
( 32 178 170) 'LightSeaGreen' |
|
3128 |
(135 206 250) 'LightSkyBlue' |
|
3129 |
(176 226 255) 'LightSkyBlue1' |
|
3130 |
(164 211 238) 'LightSkyBlue2' |
|
3131 |
(141 182 205) 'LightSkyBlue3' |
|
3132 |
( 96 123 139) 'LightSkyBlue4' |
|
3133 |
(132 112 255) 'LightSlateBlue' |
|
3134 |
(119 136 153) 'LightSlateGray' |
|
3135 |
(119 136 153) 'LightSlateGrey' |
|
3136 |
(176 196 222) 'LightSteelBlue' |
|
3137 |
(202 225 255) 'LightSteelBlue1' |
|
3138 |
(188 210 238) 'LightSteelBlue2' |
|
3139 |
(162 181 205) 'LightSteelBlue3' |
|
3140 |
(110 123 139) 'LightSteelBlue4' |
|
3141 |
(255 255 224) 'LightYellow' |
|
3142 |
(255 255 224) 'LightYellow1' |
|
3143 |
(238 238 209) 'LightYellow2' |
|
3144 |
(205 205 180) 'LightYellow3' |
|
3145 |
(139 139 122) 'LightYellow4' |
|
3146 |
( 50 205 50) 'lime green' |
|
3147 |
( 50 205 50) 'LimeGreen' |
|
3148 |
(250 240 230) 'linen' |
|
3149 |
(255 0 255) 'magenta' |
|
3150 |
(255 0 255) 'magenta1' |
|
3151 |
(238 0 238) 'magenta2' |
|
3152 |
(205 0 205) 'magenta3' |
|
3153 |
(139 0 139) 'magenta4' |
|
3154 |
(176 48 96) 'maroon' |
|
3155 |
(255 52 179) 'maroon1' |
|
3156 |
(238 48 167) 'maroon2' |
|
3157 |
(205 41 144) 'maroon3' |
|
3158 |
(139 28 98) 'maroon4' |
|
3159 |
(102 205 170) 'medium aquamarine' |
|
3160 |
( 0 0 205) 'medium blue' |
|
3161 |
(186 85 211) 'medium orchid' |
|
3162 |
(147 112 219) 'medium purple' |
|
3163 |
( 60 179 113) 'medium sea green' |
|
3164 |
(123 104 238) 'medium slate blue' |
|
3165 |
( 0 250 154) 'medium spring green' |
|
3166 |
( 72 209 204) 'medium turquoise' |
|
3167 |
(199 21 133) 'medium violet red' |
|
3168 |
(102 205 170) 'MediumAquamarine' |
|
3169 |
( 0 0 205) 'MediumBlue' |
|
3170 |
(186 85 211) 'MediumOrchid' |
|
3171 |
(224 102 255) 'MediumOrchid1' |
|
3172 |
(209 95 238) 'MediumOrchid2' |
|
3173 |
(180 82 205) 'MediumOrchid3' |
|
3174 |
(122 55 139) 'MediumOrchid4' |
|
3175 |
(147 112 219) 'MediumPurple' |
|
3176 |
(171 130 255) 'MediumPurple1' |
|
3177 |
(159 121 238) 'MediumPurple2' |
|
3178 |
(137 104 205) 'MediumPurple3' |
|
3179 |
( 93 71 139) 'MediumPurple4' |
|
3180 |
( 60 179 113) 'MediumSeaGreen' |
|
3181 |
(123 104 238) 'MediumSlateBlue' |
|
3182 |
( 0 250 154) 'MediumSpringGreen' |
|
3183 |
( 72 209 204) 'MediumTurquoise' |
|
3184 |
(199 21 133) 'MediumVioletRed' |
|
3185 |
( 25 25 112) 'midnight blue' |
|
3186 |
( 25 25 112) 'MidnightBlue' |
|
3187 |
(245 255 250) 'mint cream' |
|
3188 |
(245 255 250) 'MintCream' |
|
3189 |
(255 228 225) 'misty rose' |
|
3190 |
(255 228 225) 'MistyRose' |
|
3191 |
(255 228 225) 'MistyRose1' |
|
3192 |
(238 213 210) 'MistyRose2' |
|
3193 |
(205 183 181) 'MistyRose3' |
|
3194 |
(139 125 123) 'MistyRose4' |
|
3195 |
(255 228 181) 'moccasin' |
|
3196 |
(255 222 173) 'navajo white' |
|
3197 |
(255 222 173) 'NavajoWhite' |
|
3198 |
(255 222 173) 'NavajoWhite1' |
|
3199 |
(238 207 161) 'NavajoWhite2' |
|
3200 |
(205 179 139) 'NavajoWhite3' |
|
3201 |
(139 121 94) 'NavajoWhite4' |
|
3202 |
( 0 0 128) 'navy' |
|
3203 |
( 0 0 128) 'navy blue' |
|
3204 |
( 0 0 128) 'NavyBlue' |
|
3205 |
(253 245 230) 'old lace' |
|
3206 |
(253 245 230) 'OldLace' |
|
3207 |
(107 142 35) 'olive drab' |
|
3208 |
(107 142 35) 'OliveDrab' |
|
3209 |
(192 255 62) 'OliveDrab1' |
|
3210 |
(179 238 58) 'OliveDrab2' |
|
3211 |
(154 205 50) 'OliveDrab3' |
|
3212 |
(105 139 34) 'OliveDrab4' |
|
3213 |
(255 165 0) 'orange' |
|
3214 |
(255 69 0) 'orange red' |
|
3215 |
(255 165 0) 'orange1' |
|
3216 |
(238 154 0) 'orange2' |
|
3217 |
(205 133 0) 'orange3' |
|
3218 |
(139 90 0) 'orange4' |
|
3219 |
(255 69 0) 'OrangeRed' |
|
3220 |
(255 69 0) 'OrangeRed1' |
|
3221 |
(238 64 0) 'OrangeRed2' |
|
3222 |
(205 55 0) 'OrangeRed3' |
|
3223 |
(139 37 0) 'OrangeRed4' |
|
3224 |
(218 112 214) 'orchid' |
|
3225 |
(255 131 250) 'orchid1' |
|
3226 |
(238 122 233) 'orchid2' |
|
3227 |
(205 105 201) 'orchid3' |
|
3228 |
(139 71 137) 'orchid4' |
|
3229 |
(238 232 170) 'pale goldenrod' |
|
3230 |
(152 251 152) 'pale green' |
|
3231 |
(175 238 238) 'pale turquoise' |
|
3232 |
(219 112 147) 'pale violet red' |
|
3233 |
(238 232 170) 'PaleGoldenrod' |
|
3234 |
(152 251 152) 'PaleGreen' |
|
3235 |
(154 255 154) 'PaleGreen1' |
|
3236 |
(144 238 144) 'PaleGreen2' |
|
3237 |
(124 205 124) 'PaleGreen3' |
|
3238 |
( 84 139 84) 'PaleGreen4' |
|
3239 |
(175 238 238) 'PaleTurquoise' |
|
3240 |
(187 255 255) 'PaleTurquoise1' |
|
3241 |
(174 238 238) 'PaleTurquoise2' |
|
3242 |
(150 205 205) 'PaleTurquoise3' |
|
3243 |
(102 139 139) 'PaleTurquoise4' |
|
3244 |
(219 112 147) 'PaleVioletRed' |
|
3245 |
(255 130 171) 'PaleVioletRed1' |
|
3246 |
(238 121 159) 'PaleVioletRed2' |
|
3247 |
(205 104 137) 'PaleVioletRed3' |
|
3248 |
(139 71 93) 'PaleVioletRed4' |
|
3249 |
(255 239 213) 'papaya whip' |
|
3250 |
(255 239 213) 'PapayaWhip' |
|
3251 |
(255 218 185) 'peach puff' |
|
3252 |
(255 218 185) 'PeachPuff' |
|
3253 |
(255 218 185) 'PeachPuff1' |
|
3254 |
(238 203 173) 'PeachPuff2' |
|
3255 |
(205 175 149) 'PeachPuff3' |
|
3256 |
(139 119 101) 'PeachPuff4' |
|
3257 |
(205 133 63) 'peru' |
|
3258 |
(255 192 203) 'pink' |
|
3259 |
(255 181 197) 'pink1' |
|
3260 |
(238 169 184) 'pink2' |
|
3261 |
(205 145 158) 'pink3' |
|
3262 |
(139 99 108) 'pink4' |
|
3263 |
(221 160 221) 'plum' |
|
3264 |
(255 187 255) 'plum1' |
|
3265 |
(238 174 238) 'plum2' |
|
3266 |
(205 150 205) 'plum3' |
|
3267 |
(139 102 139) 'plum4' |
|
3268 |
(176 224 230) 'powder blue' |
|
3269 |
(176 224 230) 'PowderBlue' |
|
3270 |
(160 32 240) 'purple' |
|
3271 |
(155 48 255) 'purple1' |
|
3272 |
(145 44 238) 'purple2' |
|
3273 |
(125 38 205) 'purple3' |
|
3274 |
( 85 26 139) 'purple4' |
|
3275 |
(255 0 0) 'red' |
|
3276 |
(255 0 0) 'red1' |
|
3277 |
(238 0 0) 'red2' |
|
3278 |
(205 0 0) 'red3' |
|
3279 |
(139 0 0) 'red4' |
|
3280 |
(188 143 143) 'rosy brown' |
|
3281 |
(188 143 143) 'RosyBrown' |
|
3282 |
(255 193 193) 'RosyBrown1' |
|
3283 |
(238 180 180) 'RosyBrown2' |
|
3284 |
(205 155 155) 'RosyBrown3' |
|
3285 |
(139 105 105) 'RosyBrown4' |
|
3286 |
( 65 105 225) 'royal blue' |
|
3287 |
( 65 105 225) 'RoyalBlue' |
|
3288 |
( 72 118 255) 'RoyalBlue1' |
|
3289 |
( 67 110 238) 'RoyalBlue2' |
|
3290 |
( 58 95 205) 'RoyalBlue3' |
|
3291 |
( 39 64 139) 'RoyalBlue4' |
|
3292 |
(139 69 19) 'saddle brown' |
|
3293 |
(139 69 19) 'SaddleBrown' |
|
3294 |
(250 128 114) 'salmon' |
|
3295 |
(255 140 105) 'salmon1' |
|
3296 |
(238 130 98) 'salmon2' |
|
3297 |
(205 112 84) 'salmon3' |
|
3298 |
(139 76 57) 'salmon4' |
|
3299 |
(244 164 96) 'sandy brown' |
|
3300 |
(244 164 96) 'SandyBrown' |
|
3301 |
( 255 206 137) 'scoActiveBackground' |
|
3302 |
( 43 45 49) 'scoActiveForeground' |
|
3303 |
( 254 222 255) 'scoActiveTopShadow' |
|
3304 |
( 172 186 204) 'scoAltBackground' |
|
3305 |
( 203 203 192) 'scoBackground' |
|
3306 |
( 11 0 113) 'scoForeground' |
|
3307 |
( 141 178 215) 'scoHighlight' |
|
3308 |
( 255 240 248) 'scoTopShadow' |
|
3309 |
( 46 139 87) 'sea green' |
|
3310 |
( 46 139 87) 'SeaGreen' |
|
3311 |
( 84 255 159) 'SeaGreen1' |
|
3312 |
( 78 238 148) 'SeaGreen2' |
|
3313 |
( 67 205 128) 'SeaGreen3' |
|
3314 |
( 46 139 87) 'SeaGreen4' |
|
3315 |
(255 245 238) 'seashell' |
|
3316 |
(255 245 238) 'seashell1' |
|
3317 |
(238 229 222) 'seashell2' |
|
3318 |
(205 197 191) 'seashell3' |
|
3319 |
(139 134 130) 'seashell4' |
|
3320 |
(142 56 142) 'sgi beet' |
|
3321 |
(197 193 170) 'sgi bright gray' |
|
3322 |
(197 193 170) 'sgi bright grey' |
|
3323 |
(113 198 113) 'sgi chartreuse' |
|
3324 |
( 85 85 85) 'sgi dark gray' |
|
3325 |
( 85 85 85) 'sgi dark grey' |
|
3326 |
( 0 0 0) 'sgi gray 0' |
|
3327 |
(255 255 255) 'sgi gray 100' |
|
3328 |
( 30 30 30) 'sgi gray 12' |
|
3329 |
( 40 40 40) 'sgi gray 16' |
|
3330 |
( 51 51 51) 'sgi gray 20' |
|
3331 |
( 61 61 61) 'sgi gray 24' |
|
3332 |
( 71 71 71) 'sgi gray 28' |
|
3333 |
( 81 81 81) 'sgi gray 32' |
|
3334 |
( 91 91 91) 'sgi gray 36' |
|
3335 |
( 10 10 10) 'sgi gray 4' |
|
3336 |
(102 102 102) 'sgi gray 40' |
|
3337 |
(112 112 112) 'sgi gray 44' |
|
3338 |
(122 122 122) 'sgi gray 48' |
|
3339 |
(132 132 132) 'sgi gray 52' |
|
3340 |
(142 142 142) 'sgi gray 56' |
|
3341 |
(153 153 153) 'sgi gray 60' |
|
3342 |
(163 163 163) 'sgi gray 64' |
|
3343 |
(173 173 173) 'sgi gray 68' |
|
3344 |
(183 183 183) 'sgi gray 72' |
|
3345 |
(193 193 193) 'sgi gray 76' |
|
3346 |
( 20 20 20) 'sgi gray 8' |
|
3347 |
(204 204 204) 'sgi gray 80' |
|
3348 |
(214 214 214) 'sgi gray 84' |
|
3349 |
(224 224 224) 'sgi gray 88' |
|
3350 |
(234 234 234) 'sgi gray 92' |
|
3351 |
(244 244 244) 'sgi gray 96' |
|
3352 |
( 0 0 0) 'sgi grey 0' |
|
3353 |
(255 255 255) 'sgi grey 100' |
|
3354 |
( 30 30 30) 'sgi grey 12' |
|
3355 |
( 40 40 40) 'sgi grey 16' |
|
3356 |
( 51 51 51) 'sgi grey 20' |
|
3357 |
( 61 61 61) 'sgi grey 24' |
|
3358 |
( 71 71 71) 'sgi grey 28' |
|
3359 |
( 81 81 81) 'sgi grey 32' |
|
3360 |
( 91 91 91) 'sgi grey 36' |
|
3361 |
( 10 10 10) 'sgi grey 4' |
|
3362 |
(102 102 102) 'sgi grey 40' |
|
3363 |
(112 112 112) 'sgi grey 44' |
|
3364 |
(122 122 122) 'sgi grey 48' |
|
3365 |
(132 132 132) 'sgi grey 52' |
|
3366 |
(142 142 142) 'sgi grey 56' |
|
3367 |
(153 153 153) 'sgi grey 60' |
|
3368 |
(163 163 163) 'sgi grey 64' |
|
3369 |
(173 173 173) 'sgi grey 68' |
|
3370 |
(183 183 183) 'sgi grey 72' |
|
3371 |
(193 193 193) 'sgi grey 76' |
|
3372 |
( 20 20 20) 'sgi grey 8' |
|
3373 |
(204 204 204) 'sgi grey 80' |
|
3374 |
(214 214 214) 'sgi grey 84' |
|
3375 |
(224 224 224) 'sgi grey 88' |
|
3376 |
(234 234 234) 'sgi grey 92' |
|
3377 |
(244 244 244) 'sgi grey 96' |
|
3378 |
(125 158 192) 'sgi light blue' |
|
3379 |
(170 170 170) 'sgi light gray' |
|
3380 |
(170 170 170) 'sgi light grey' |
|
3381 |
(132 132 132) 'sgi medium gray' |
|
3382 |
(132 132 132) 'sgi medium grey' |
|
3383 |
(142 142 56) 'sgi olive drab' |
|
3384 |
(198 113 113) 'sgi salmon' |
|
3385 |
(113 113 198) 'sgi slate blue' |
|
3386 |
( 56 142 142) 'sgi teal' |
|
3387 |
( 40 40 40) 'sgi very dark gray' |
|
3388 |
( 40 40 40) 'sgi very dark grey' |
|
3389 |
(214 214 214) 'sgi very light gray' |
|
3390 |
(214 214 214) 'sgi very light grey' |
|
3391 |
(142 56 142) 'SGIBeet' |
|
3392 |
(197 193 170) 'SGIBrightGray' |
|
3393 |
(197 193 170) 'SGIBrightGrey' |
|
3394 |
(113 198 113) 'SGIChartreuse' |
|
3395 |
( 85 85 85) 'SGIDarkGray' |
|
3396 |
( 85 85 85) 'SGIDarkGrey' |
|
3397 |
( 0 0 0) 'SGIGray0' |
|
3398 |
(255 255 255) 'SGIGray100' |
|
3399 |
( 30 30 30) 'SGIGray12' |
|
3400 |
( 40 40 40) 'SGIGray16' |
|
3401 |
( 51 51 51) 'SGIGray20' |
|
3402 |
( 61 61 61) 'SGIGray24' |
|
3403 |
( 71 71 71) 'SGIGray28' |
|
3404 |
( 81 81 81) 'SGIGray32' |
|
3405 |
( 91 91 91) 'SGIGray36' |
|
3406 |
( 10 10 10) 'SGIGray4' |
|
3407 |
(102 102 102) 'SGIGray40' |
|
3408 |
(112 112 112) 'SGIGray44' |
|
3409 |
(122 122 122) 'SGIGray48' |
|
3410 |
(132 132 132) 'SGIGray52' |
|
3411 |
(142 142 142) 'SGIGray56' |
|
3412 |
(153 153 153) 'SGIGray60' |
|
3413 |
(163 163 163) 'SGIGray64' |
|
3414 |
(173 173 173) 'SGIGray68' |
|
3415 |
(183 183 183) 'SGIGray72' |
|
3416 |
(193 193 193) 'SGIGray76' |
|
3417 |
( 20 20 20) 'SGIGray8' |
|
3418 |
(204 204 204) 'SGIGray80' |
|
3419 |
(214 214 214) 'SGIGray84' |
|
3420 |
(224 224 224) 'SGIGray88' |
|
3421 |
(234 234 234) 'SGIGray92' |
|
3422 |
(244 244 244) 'SGIGray96' |
|
3423 |
( 0 0 0) 'SGIGrey0' |
|
3424 |
(255 255 255) 'SGIGrey100' |
|
3425 |
( 30 30 30) 'SGIGrey12' |
|
3426 |
( 40 40 40) 'SGIGrey16' |
|
3427 |
( 51 51 51) 'SGIGrey20' |
|
3428 |
( 61 61 61) 'SGIGrey24' |
|
3429 |
( 71 71 71) 'SGIGrey28' |
|
3430 |
( 81 81 81) 'SGIGrey32' |
|
3431 |
( 91 91 91) 'SGIGrey36' |
|
3432 |
( 10 10 10) 'SGIGrey4' |
|
3433 |
(102 102 102) 'SGIGrey40' |
|
3434 |
(112 112 112) 'SGIGrey44' |
|
3435 |
(122 122 122) 'SGIGrey48' |
|
3436 |
(132 132 132) 'SGIGrey52' |
|
3437 |
(142 142 142) 'SGIGrey56' |
|
3438 |
(153 153 153) 'SGIGrey60' |
|
3439 |
(163 163 163) 'SGIGrey64' |
|
3440 |
(173 173 173) 'SGIGrey68' |
|
3441 |
(183 183 183) 'SGIGrey72' |
|
3442 |
(193 193 193) 'SGIGrey76' |
|
3443 |
( 20 20 20) 'SGIGrey8' |
|
3444 |
(204 204 204) 'SGIGrey80' |
|
3445 |
(214 214 214) 'SGIGrey84' |
|
3446 |
(224 224 224) 'SGIGrey88' |
|
3447 |
(234 234 234) 'SGIGrey92' |
|
3448 |
(244 244 244) 'SGIGrey96' |
|
3449 |
(125 158 192) 'SGILightBlue' |
|
3450 |
(170 170 170) 'SGILightGray' |
|
3451 |
(170 170 170) 'SGILightGrey' |
|
3452 |
(132 132 132) 'SGIMediumGray' |
|
3453 |
(132 132 132) 'SGIMediumGrey' |
|
3454 |
(142 142 56) 'SGIOliveDrab' |
|
3455 |
(198 113 113) 'SGISalmon' |
|
3456 |
(113 113 198) 'SGISlateBlue' |
|
3457 |
( 56 142 142) 'SGITeal' |
|
3458 |
( 40 40 40) 'SGIVeryDarkGray' |
|
3459 |
( 40 40 40) 'SGIVeryDarkGrey' |
|
3460 |
(214 214 214) 'SGIVeryLightGray' |
|
3461 |
(214 214 214) 'SGIVeryLightGrey' |
|
3462 |
(160 82 45) 'sienna' |
|
3463 |
(255 130 71) 'sienna1' |
|
3464 |
(238 121 66) 'sienna2' |
|
3465 |
(205 104 57) 'sienna3' |
|
3466 |
(139 71 38) 'sienna4' |
|
3467 |
(135 206 235) 'sky blue' |
|
3468 |
(135 206 235) 'SkyBlue' |
|
3469 |
(135 206 255) 'SkyBlue1' |
|
3470 |
(126 192 238) 'SkyBlue2' |
|
3471 |
(108 166 205) 'SkyBlue3' |
|
3472 |
( 74 112 139) 'SkyBlue4' |
|
3473 |
(106 90 205) 'slate blue' |
|
3474 |
(112 128 144) 'slate gray' |
|
3475 |
(112 128 144) 'slate grey' |
|
3476 |
(106 90 205) 'SlateBlue' |
|
3477 |
(131 111 255) 'SlateBlue1' |
|
3478 |
(122 103 238) 'SlateBlue2' |
|
3479 |
(105 89 205) 'SlateBlue3' |
|
3480 |
( 71 60 139) 'SlateBlue4' |
|
3481 |
(112 128 144) 'SlateGray' |
|
3482 |
(198 226 255) 'SlateGray1' |
|
3483 |
(185 211 238) 'SlateGray2' |
|
3484 |
(159 182 205) 'SlateGray3' |
|
3485 |
(108 123 139) 'SlateGray4' |
|
3486 |
(112 128 144) 'SlateGrey' |
|
3487 |
(255 250 250) 'snow' |
|
3488 |
(255 250 250) 'snow1' |
|
3489 |
(238 233 233) 'snow2' |
|
3490 |
(205 201 201) 'snow3' |
|
3491 |
(139 137 137) 'snow4' |
|
3492 |
( 0 255 127) 'spring green' |
|
3493 |
( 0 255 127) 'SpringGreen' |
|
3494 |
( 0 255 127) 'SpringGreen1' |
|
3495 |
( 0 238 118) 'SpringGreen2' |
|
3496 |
( 0 205 102) 'SpringGreen3' |
|
3497 |
( 0 139 69) 'SpringGreen4' |
|
3498 |
( 70 130 180) 'steel blue' |
|
3499 |
( 70 130 180) 'SteelBlue' |
|
3500 |
( 99 184 255) 'SteelBlue1' |
|
3501 |
( 92 172 238) 'SteelBlue2' |
|
3502 |
( 79 148 205) 'SteelBlue3' |
|
3503 |
( 54 100 139) 'SteelBlue4' |
|
3504 |
(210 180 140) 'tan' |
|
3505 |
(255 165 79) 'tan1' |
|
3506 |
(238 154 73) 'tan2' |
|
3507 |
(205 133 63) 'tan3' |
|
3508 |
(139 90 43) 'tan4' |
|
3509 |
(216 191 216) 'thistle' |
|
3510 |
(255 225 255) 'thistle1' |
|
3511 |
(238 210 238) 'thistle2' |
|
3512 |
(205 181 205) 'thistle3' |
|
3513 |
(139 123 139) 'thistle4' |
|
3514 |
(255 99 71) 'tomato' |
|
3515 |
(255 99 71) 'tomato1' |
|
3516 |
(238 92 66) 'tomato2' |
|
3517 |
(205 79 57) 'tomato3' |
|
3518 |
(139 54 38) 'tomato4' |
|
3519 |
( 64 224 208) 'turquoise' |
|
3520 |
( 0 245 255) 'turquoise1' |
|
3521 |
( 0 229 238) 'turquoise2' |
|
3522 |
( 0 197 205) 'turquoise3' |
|
3523 |
( 0 134 139) 'turquoise4' |
|
3524 |
(238 130 238) 'violet' |
|
3525 |
(208 32 144) 'violet red' |
|
3526 |
(208 32 144) 'VioletRed' |
|
3527 |
(255 62 150) 'VioletRed1' |
|
3528 |
(238 58 140) 'VioletRed2' |
|
3529 |
(205 50 120) 'VioletRed3' |
|
3530 |
(139 34 82) 'VioletRed4' |
|
3531 |
(245 222 179) 'wheat' |
|
3532 |
(255 231 186) 'wheat1' |
|
3533 |
(238 216 174) 'wheat2' |
|
3534 |
(205 186 150) 'wheat3' |
|
3535 |
(139 126 102) 'wheat4' |
|
3536 |
(255 255 255) 'white' |
|
3537 |
(245 245 245) 'white smoke' |
|
3538 |
(245 245 245) 'WhiteSmoke' |
|
3539 |
(255 255 0) 'yellow' |
|
3540 |
(154 205 50) 'yellow green' |
|
3541 |
(255 255 0) 'yellow1' |
|
3542 |
(238 238 0) 'yellow2' |
|
3543 |
(205 205 0) 'yellow3' |
|
3544 |
(139 139 0) 'yellow4' |
|
3545 |
(154 205 50) 'YellowGreen' |
|
3546 |
) pairWiseDo:[ :value :name | |
|
3547 |
StandardColorValues at:name put:value |
|
3548 |
]. |
|
3549 |
" |
|
3550 |
WinWorkstation initializeStandardColorNames |
|
3551 |
" |
|
3552 |
||
3553 |
||
2232 | 3554 |
! |
3555 |
||
1705 | 3556 |
nativeWindows:aBoolean |
3557 |
"enable / disable use of native windows" |
|
3558 |
||
3559 |
NativeWindows := aBoolean |
|
2232 | 3560 |
! ! |
3561 |
||
3562 |
!WinWorkstation class methodsFor:'error handling'! |
|
3563 |
||
1127 | 3564 |
debug:aBoolean |
3565 |
%{ /* NOCONTEXT */ |
|
3566 |
||
3567 |
__debug__ = (aBoolean == true) ? 1 : 0; |
|
3568 |
%} |
|
2232 | 3569 |
! |
3570 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3571 |
prim |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3572 |
"show prim values" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3573 |
|
2232 | 3574 |
('WINWORKSTATION: pW=',self primWindows printString,'pB=',self primBitmaps printString,'pGc=',self primgcData printString,'pbmpdc=',self primBmpDc printString) errorPrintNL |
3575 |
! |
|
3576 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3577 |
primBitmaps |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3578 |
%{ /* NOCONTEXT */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3579 |
RETURN ( __MKSMALLINT(__cnt_bitmap)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3580 |
%} |
2232 | 3581 |
! |
3582 |
||
3583 |
primBmpDc |
|
3584 |
%{ /* NOCONTEXT */ |
|
3585 |
RETURN ( __MKSMALLINT(__cnt_bmpdc)); |
|
3586 |
%} |
|
3587 |
||
3588 |
! |
|
3589 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3590 |
primWindows |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3591 |
%{ /* NOCONTEXT */ |
2232 | 3592 |
RETURN ( __MKSMALLINT(__cnt_createWindows)); |
2000
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 |
primgcData |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3597 |
%{ /* NOCONTEXT */ |
2232 | 3598 |
RETURN ( __MKSMALLINT(__cnt_gcData)); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3599 |
%} |
2232 | 3600 |
! |
3601 |
||
3602 |
! ! |
|
3603 |
||
3604 |
!WinWorkstation class methodsFor:'queries'! |
|
3605 |
||
1127 | 3606 |
getSystemMetrics:aSymbol |
2232 | 3607 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 3608 |
int info = 0; |
3609 |
int isBool = 0; |
|
3610 |
int arg; |
|
3611 |
||
3612 |
if (aSymbol == @symbol(swapButton)) { |
|
3613 |
arg = SM_SWAPBUTTON; |
|
3614 |
isBool = 1; |
|
3615 |
} else if (aSymbol == @symbol(mouseButtons)) { |
|
3616 |
arg = SM_CMOUSEBUTTONS; |
|
3617 |
} else if (aSymbol == @symbol(iconWidth)) { |
|
3618 |
arg = SM_CXICON; |
|
3619 |
} else if (aSymbol == @symbol(iconHeight)) { |
|
3620 |
arg = SM_CYICON; |
|
3621 |
} else if (aSymbol == @symbol(cursorWidth)) { |
|
3622 |
arg = SM_CXCURSOR; |
|
3623 |
} else if (aSymbol == @symbol(cursorHeight)) { |
|
3624 |
arg = SM_CYCURSOR; |
|
3625 |
} else if (aSymbol == @symbol(captionHeight)) { |
|
3626 |
arg = SM_CYCAPTION; |
|
3627 |
} else if (aSymbol == @symbol(resizeFrameWidth)) { |
|
3628 |
arg = SM_CXFRAME; |
|
3629 |
} else if (aSymbol == @symbol(resizeFrameHeight)) { |
|
3630 |
arg = SM_CYFRAME; |
|
3631 |
} else if (aSymbol == @symbol(borderFrameWidth)) { |
|
3632 |
arg = SM_CXBORDER; |
|
3633 |
} else if (aSymbol == @symbol(borderFrameHeight)) { |
|
3634 |
arg = SM_CYBORDER; |
|
3635 |
} else if (aSymbol == @symbol(fullScreenWindowWidth)) { |
|
3636 |
arg = SM_CXFULLSCREEN; |
|
3637 |
} else if (aSymbol == @symbol(fullScreenWindowHeight)) { |
|
3638 |
arg = SM_CYFULLSCREEN; |
|
3639 |
} else { |
|
3640 |
RETURN (nil); |
|
3641 |
} |
|
3642 |
info = GetSystemMetrics(arg); |
|
3643 |
if (isBool) { |
|
3644 |
RETURN (info ? true : false); |
|
3645 |
} |
|
3646 |
RETURN (__MKSMALLINT(info)); |
|
3647 |
%} |
|
2232 | 3648 |
! |
3649 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3650 |
platformName |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3651 |
"ST-80 compatibility. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3652 |
Return a string describing the display systems platform." |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3653 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3654 |
^ 'WIN32' |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3655 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3656 |
"Modified: 26.5.1996 / 15:32:46 / cg" |
2232 | 3657 |
! ! |
3658 |
||
3659 |
!WinWorkstation methodsFor:'accessing & queries'! |
|
3660 |
||
1127 | 3661 |
anyButtonMotionMask |
3662 |
"return the state-mask for any button in motion events' state-field. |
|
3663 |
This is the devices mask." |
|
3664 |
||
3665 |
%{ /* NOCONTEXT */ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3666 |
RETURN ( __MKSMALLINT(Button1MotionMask | Button2MotionMask | Button3MotionMask)); |
1723 | 3667 |
%} |
2232 | 3668 |
! |
3669 |
||
1127 | 3670 |
blackpixel |
3671 |
"return the colornumber of black" |
|
3672 |
||
3673 |
^ blackpixel |
|
2232 | 3674 |
! |
3675 |
||
1127 | 3676 |
button1MotionMask |
3677 |
"return the state-mask for button1 in motion events' state-field. |
|
3678 |
For backward compatibility." |
|
3679 |
||
3680 |
%{ /* NOCONTEXT */ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3681 |
RETURN (__MKSMALLINT(Button1MotionMask)); |
1127 | 3682 |
%} |
3683 |
||
3684 |
" |
|
3685 |
Display button1MotionMask |
|
3686 |
" |
|
2232 | 3687 |
! |
3688 |
||
1127 | 3689 |
button2MotionMask |
3690 |
"return the state-mask for button2 in motion events' state-field |
|
3691 |
For backward compatibility." |
|
3692 |
||
3693 |
%{ /* NOCONTEXT */ |
|
3694 |
RETURN (__MKSMALLINT(Button2MotionMask)); |
|
3695 |
%} |
|
2232 | 3696 |
! |
3697 |
||
1127 | 3698 |
button3MotionMask |
3699 |
"return the state-mask for button3 in motion events' state-field |
|
3700 |
For backward compatibility." |
|
3701 |
||
3702 |
%{ /* NOCONTEXT */ |
|
3703 |
RETURN (__MKSMALLINT(Button3MotionMask)); |
|
3704 |
%} |
|
2232 | 3705 |
! |
3706 |
||
1127 | 3707 |
buttonMotionMask:aButton |
3708 |
"return the state-mask for button1 in motion events state-field. |
|
3709 |
This is the devices mask." |
|
3710 |
||
3711 |
%{ /* NOCONTEXT */ |
|
3712 |
if (aButton == __MKSMALLINT(1)) { |
|
3713 |
RETURN (__MKSMALLINT(Button1MotionMask)); |
|
3714 |
} |
|
3715 |
if (aButton == __MKSMALLINT(2)) { |
|
3716 |
RETURN (__MKSMALLINT(Button2MotionMask)); |
|
3717 |
} |
|
3718 |
if (aButton == __MKSMALLINT(3)) { |
|
3719 |
RETURN (__MKSMALLINT(Button3MotionMask)); |
|
3720 |
} |
|
3721 |
%}. |
|
3722 |
^ nil |
|
2232 | 3723 |
! |
3724 |
||
1127 | 3725 |
controlMask |
3726 |
"return the state-mask for the CTRL modified in motion events' state-field." |
|
3727 |
||
3728 |
%{ /* NOCONTEXT */ |
|
3729 |
RETURN (__MKSMALLINT(ControlMask)); |
|
3730 |
%} |
|
2232 | 3731 |
! |
3732 |
||
1127 | 3733 |
defaultEventMask |
3734 |
"return a mask to enable some events by default." |
|
3735 |
||
3736 |
%{ /* NOCONTEXT */ |
|
2151 | 3737 |
RETURN (__MKSMALLINT( ExposureMask | StructureNotifyMask | |
1127 | 3738 |
KeyPressMask | KeyReleaseMask | |
3739 |
EnterWindowMask | LeaveWindowMask | |
|
3740 |
ButtonPressMask | ButtonMotionMask | ButtonReleaseMask )); |
|
2151 | 3741 |
%} |
2232 | 3742 |
! |
3743 |
||
1127 | 3744 |
displayFileDescriptor |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
3745 |
"return the displays fileNumber for select, if any" |
1127 | 3746 |
|
3747 |
%{ /* NOCONTEXT */ |
|
2232 | 3748 |
/* RETURN (nil);*/ |
3749 |
RETURN ( __MKEXTERNALADDRESS(hInputEvent)); |
|
1127 | 3750 |
%} |
2232 | 3751 |
! |
3752 |
||
1127 | 3753 |
displayName |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
3754 |
"return the display-connections display name. |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
3755 |
For Windows, a dummy name is returned" |
1127 | 3756 |
|
3757 |
^ 'local' |
|
2232 | 3758 |
! |
3759 |
||
1723 | 3760 |
getSystemColor:aKey |
3761 |
|rgb| |
|
3762 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3763 |
rgb := self primGetSystemColor:aKey. |
1723 | 3764 |
rgb notNil ifTrue:[ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3765 |
^ Color |
1723 | 3766 |
redByte:((rgb bitShift:-16) bitAnd:16rFF) |
3767 |
greenByte:((rgb bitShift:-8) bitAnd:16rFF) |
|
3768 |
blueByte:(rgb bitAnd:16rFF) |
|
3769 |
]. |
|
3770 |
^ nil |
|
2232 | 3771 |
! |
3772 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3773 |
primGetSystemColor:aKey |
2232 | 3774 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2238 | 3775 |
int p; |
3776 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3777 |
if (aKey == @symbol(COLOR_WINDOW)) { |
2240 | 3778 |
p = COLOR_WINDOW; |
2238 | 3779 |
} else if (aKey == @symbol(COLOR_WINDOWTEXT)) { |
2240 | 3780 |
p = COLOR_WINDOWTEXT; |
2238 | 3781 |
} else if (aKey == @symbol(COLOR_MENU)) { |
2240 | 3782 |
p = COLOR_MENU; |
2238 | 3783 |
} else if (aKey == @symbol(COLOR_MENUTEXT)) { |
2240 | 3784 |
p = COLOR_MENUTEXT; |
2238 | 3785 |
} else if (aKey == @symbol(COLOR_BTNFACE)) { |
2240 | 3786 |
p = COLOR_BTNFACE; |
2238 | 3787 |
} else if (aKey == @symbol(COLOR_BTNSHADOW)) { |
2240 | 3788 |
p = COLOR_BTNSHADOW; |
2238 | 3789 |
} else if (aKey == @symbol(COLOR_BTNTEXT)) { |
2240 | 3790 |
p = COLOR_BTNTEXT; |
2238 | 3791 |
} else if (aKey == @symbol(COLOR_GRAYTEXT)) { |
2240 | 3792 |
p = COLOR_GRAYTEXT; |
2238 | 3793 |
} else if (aKey == @symbol(COLOR_HIGHLIGHT)) { |
2240 | 3794 |
p = COLOR_HIGHLIGHT; |
2238 | 3795 |
} else if (aKey == @symbol(COLOR_HIGHLIGHTTEXT)) { |
2240 | 3796 |
p = COLOR_HIGHLIGHTTEXT; |
2238 | 3797 |
} else if (aKey == @symbol(COLOR_MENU)) { |
2240 | 3798 |
p = COLOR_MENU; |
2238 | 3799 |
} else if (aKey == @symbol(COLOR_MENUTEXT)) { |
2240 | 3800 |
p = COLOR_MENUTEXT; |
2238 | 3801 |
} else if (aKey == @symbol(COLOR_SCROLLBAR)) { |
2240 | 3802 |
p = COLOR_SCROLLBAR; |
2239 | 3803 |
#ifdef COLOR_SHADOW |
2238 | 3804 |
} else if (aKey == @symbol(COLOR_SHADOW)) { |
2240 | 3805 |
p = COLOR_SHADOW; |
2239 | 3806 |
#endif |
2238 | 3807 |
} else { |
2240 | 3808 |
RETURN (nil); |
2238 | 3809 |
} |
3810 |
RETURN (__MKSMALLINT(GetSysColor(p))); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3811 |
%}. |
2232 | 3812 |
! |
3813 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3814 |
primTranslatePointX:x y:y from:windowId1 to:windowId2 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3815 |
|
2232 | 3816 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3817 |
HWND w1, w2; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3818 |
POINT point; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3819 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3820 |
if (__isExternalAddress(windowId1) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3821 |
&& __isExternalAddress(windowId2) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3822 |
&& __bothSmallInteger(x, y)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3823 |
w1 = _HWNDVal(windowId1); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3824 |
w2 = _HWNDVal(windowId2); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3825 |
point.x = __intVal(x); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3826 |
point.y = __intVal(y); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3827 |
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
|
3828 |
ClientToScreen(w1,&point); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3829 |
ScreenToClient(w2,&point); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3830 |
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
|
3831 |
RETURN (__MKPOINT_INT(point.x, point.y)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3832 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3833 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3834 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3835 |
%} |
2232 | 3836 |
! |
3837 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3838 |
primViewIdFromPoint:aPoint in:windowId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3839 |
"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
|
3840 |
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
|
3841 |
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
|
3842 |
- 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
|
3843 |
|
2232 | 3844 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3845 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3846 |
OBJ xp, yp; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3847 |
int xpos, ypos; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3848 |
HWND child_return; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3849 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3850 |
if (ISCONNECTED |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3851 |
&& __isExternalAddress(windowId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3852 |
&& __isPoint(aPoint)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3853 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3854 |
xp = _point_X(aPoint); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3855 |
yp = _point_Y(aPoint); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3856 |
if (__bothSmallInteger(xp, yp)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3857 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3858 |
POINT p; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3859 |
HWND hWnd = _HWNDVal(windowId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3860 |
p.x = __intVal(xp); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3861 |
p.y = __intVal(yp); |
2151 | 3862 |
ScreenToClient(hWnd, &p); |
2232 | 3863 |
child_return = ChildWindowFromPointEx(hWnd,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT); |
2151 | 3864 |
/*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
|
3865 |
if ((child_return) && (child_return != hWnd)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3866 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3867 |
RETURN ( __MKEXTERNALADDRESS(child_return) ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3868 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3869 |
RETURN ( nil ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3870 |
} |
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 |
%}. |
2232 | 3873 |
! |
3874 |
||
2151 | 3875 |
protocolVersion |
3876 |
"return the displays protocol version. |
|
3877 |
For Windows, a dummy number is returned" |
|
3878 |
||
3879 |
^ '1' |
|
3880 |
||
3881 |
" |
|
3882 |
Display protocolVersion |
|
3883 |
" |
|
2232 | 3884 |
! |
3885 |
||
2151 | 3886 |
serverVendor |
3887 |
"return the server vendor string. |
|
3888 |
For Windows, a dummy name is returned" |
|
3889 |
||
3890 |
^ 'microsoft' |
|
3891 |
||
3892 |
" |
|
3893 |
Display serverVendor |
|
3894 |
" |
|
2232 | 3895 |
! |
3896 |
||
2151 | 3897 |
shiftMask |
3898 |
"return the state-mask for the SHIFT modified in motion events' state-field." |
|
3899 |
||
3900 |
%{ /* NOCONTEXT */ |
|
3901 |
RETURN (__MKSMALLINT(ShiftMask)); |
|
3902 |
%} |
|
2232 | 3903 |
! |
3904 |
||
2151 | 3905 |
translatePoint:aPoint from:windowId1 to:windowId2 |
3906 |
"given a point in window1, return the coordinate in window2. |
|
3907 |
This expects a device coordinate (relative to the first views origin) |
|
3908 |
in aPoint and returns a device coordinate relative to the 2nd views origin. |
|
3909 |
- use to xlate points from a window to rootwindow" |
|
3910 |
||
3911 |
|x1 y1| |
|
3912 |
||
3913 |
x1 := aPoint x truncated. |
|
3914 |
y1 := aPoint y truncated. |
|
3915 |
^ self primTranslatePointX:x1 y:y1 from:windowId1 to:windowId2 |
|
2232 | 3916 |
! |
3917 |
||
2151 | 3918 |
vendorRelease |
3919 |
"return the display-servers vendor release |
|
3920 |
- should normally not be of any interest, |
|
3921 |
but may be usefule for special cases. |
|
3922 |
(to avoid bugs in certain implementations / releases)" |
|
3923 |
||
3924 |
^ 1 |
|
3925 |
||
3926 |
" |
|
3927 |
Display vendorRelease |
|
3928 |
" |
|
2232 | 3929 |
! |
3930 |
||
2151 | 3931 |
viewIdFromPoint:aPoint in:windowId |
3932 |
"given a point in rootWindow, return the viewId of the subview of windowId |
|
3933 |
hit by this coordinate. Return nil if no view was hit. |
|
3934 |
The returned id may be the id of a non ST view. |
|
3935 |
- used to find the window to drop objects after a cross-view drag." |
|
3936 |
||
3937 |
windowId notNil ifTrue:[ |
|
3938 |
aPoint isPoint ifTrue:[ |
|
2232 | 3939 |
"/(aPoint x > 30000) ifTrue:[self halt.]. |
3940 |
"/(aPoint y > 30000) ifTrue:[self halt.]. |
|
3941 |
"/aPoint printString errorPrintCR. |
|
2151 | 3942 |
^ self primViewIdFromPoint:aPoint asPoint truncated in:windowId |
3943 |
] |
|
3944 |
]. |
|
3945 |
||
3946 |
^ nil |
|
2232 | 3947 |
! |
3948 |
||
1127 | 3949 |
whitepixel |
3950 |
"return the colornumber of white" |
|
3951 |
||
3952 |
^ whitepixel |
|
2232 | 3953 |
! ! |
3954 |
||
3955 |
!WinWorkstation methodsFor:'accessing display capabilities'! |
|
3956 |
||
1127 | 3957 |
iconSizes |
3958 |
"Get the preferred/supported icon sizes." |
|
3959 |
||
3960 |
|d| |
|
3961 |
||
3962 |
d := IdentityDictionary new. |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3963 |
d at:#minWidth put:(self class getSystemMetrics:#iconWidth). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3964 |
d at:#maxWidth put:(self class getSystemMetrics:#iconHeight). |
1127 | 3965 |
d at:#widthStep put:1. |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3966 |
d at:#minHeight put:(self class getSystemMetrics:#iconWidth). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
3967 |
d at:#maxHeight put:(self class getSystemMetrics:#iconHeight). |
1127 | 3968 |
d at:#heightStep put:1. |
3969 |
||
3970 |
^ OrderedCollection with:d |
|
3971 |
||
3972 |
" |
|
3973 |
Display iconSizes |
|
3974 |
" |
|
2232 | 3975 |
! |
3976 |
||
2151 | 3977 |
scrollsAsynchronous |
3978 |
"return true, if this display asynchronously sends expose events after a |
|
3979 |
scroll operation. False otherwise. Asynchronous expose events are an X |
|
3980 |
speciality, which affects a few methods outside of the display class (sorry)" |
|
3981 |
||
3982 |
"/ event Handling erst verbessern |
|
2232 | 3983 |
^ true "/ false |
3984 |
! |
|
3985 |
||
2151 | 3986 |
supportedImageFormats |
3987 |
"return an array with supported image formats; each array entry |
|
3988 |
is another array, consisting of depth and bitsPerPixel values." |
|
3989 |
||
3990 |
|info| |
|
3991 |
||
3992 |
info := IdentityDictionary new. |
|
3993 |
info at:#depth put:depth. |
|
3994 |
info at:#bitsPerPixel put:depth. |
|
3995 |
info at:#padding put:32. |
|
3996 |
^ Array with:info |
|
2232 | 3997 |
! |
3998 |
||
2151 | 3999 |
supportsDeepIcons |
4000 |
"return true, if this device supports deepicons." |
|
4001 |
||
4002 |
^ true |
|
4003 |
||
2232 | 4004 |
! |
4005 |
||
1127 | 4006 |
supportsIconViews |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4007 |
"return true, if this device supports views as icons." |
1127 | 4008 |
|
4009 |
^ true |
|
4010 |
||
4011 |
" |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4012 |
Display supportsIconViews |
1127 | 4013 |
" |
4014 |
||
4015 |
"Modified: 10.6.1996 / 20:11:48 / cg" |
|
4016 |
"Created: 10.6.1996 / 21:08:18 / cg" |
|
2232 | 4017 |
! |
4018 |
||
1705 | 4019 |
usableExtent |
4020 |
"return the usable extent of the display (in pixels). |
|
4021 |
Normally, the same as extent, but may be smaller, in |
|
4022 |
case some menu space is taken up by the window manager (windows)" |
|
4023 |
||
4024 |
^ (self class getSystemMetrics:#fullScreenWindowWidth) |
|
4025 |
@ |
|
4026 |
(self class getSystemMetrics:#fullScreenWindowHeight) |
|
2232 | 4027 |
! ! |
4028 |
||
4029 |
!WinWorkstation methodsFor:'bitmap/window creation'! |
|
4030 |
||
1127 | 4031 |
createBitmapFromArray:anArray width:w height:h |
4032 |
|bitmapId| |
|
4033 |
||
4034 |
bitmapId := self primCreateBitmapFromArray:anArray width:w height:h. |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4035 |
|
1127 | 4036 |
bitmapId isNil ifTrue:[ |
4037 |
'WINWORKSTATION: cannot create bitmap' errorPrintCR. |
|
4038 |
]. |
|
4039 |
^ bitmapId |
|
2232 | 4040 |
! |
4041 |
||
1127 | 4042 |
createBitmapWidth:w height:h |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4043 |
|
2232 | 4044 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4045 |
HANDLE newBitmapHandle; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4046 |
int b_width, b_height; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4047 |
/* printf("CreateBitmap B/W\n");*/ |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4048 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4049 |
if (__bothSmallInteger(w, h)) { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4050 |
b_width = __intVal(w); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4051 |
b_height = __intVal(h); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4052 |
newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, NULL); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4053 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4054 |
if (newBitmapHandle) |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4055 |
{ |
2232 | 4056 |
#ifdef COUNT_BMP_RESOURCES |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4057 |
__cnt_bitmap++; |
2232 | 4058 |
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
|
4059 |
#endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4060 |
RETURN ( __MKOBJ(newBitmapHandle)); |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4061 |
} |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4062 |
DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle)); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4063 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4064 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4065 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4066 |
%} |
2232 | 4067 |
! |
4068 |
||
1127 | 4069 |
createPixmapWidth:w height:h depth:d |
4070 |
"allocate a pixmap on the Xserver, the contents is undefined |
|
4071 |
(i.e. random). Return a bitmap id or nil" |
|
4072 |
||
2232 | 4073 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4074 |
HANDLE newBitmapHandle; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4075 |
/*printf("CreateBitmap Color\n");*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4076 |
if (__bothSmallInteger(w, h) && __isSmallInteger(d) && ISCONNECTED) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4077 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4078 |
if (__intVal(d) == 1) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4079 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4080 |
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
|
4081 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4082 |
else |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4083 |
{ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4084 |
/*if (__intVal(d) != __depth) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4085 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4086 |
printf("invalite depth\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4087 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4088 |
} */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4089 |
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
|
4090 |
} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4091 |
if (newBitmapHandle) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4092 |
{ |
2232 | 4093 |
#ifdef COUNT_BMP_RESOURCES |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4094 |
__cnt_bitmap++; |
2232 | 4095 |
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
|
4096 |
#endif |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4097 |
RETURN ( __MKOBJ(newBitmapHandle)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4098 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4099 |
DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4100 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4101 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4102 |
%} |
2232 | 4103 |
! |
4104 |
||
1467
9629ce710c53
added type argument to createWindowFor - prepare for native window support (windows)
Claus Gittinger <cg@exept.de>
parents:
1461
diff
changeset
|
4105 |
createWindowFor:aView type:typeSymbol |
1127 | 4106 |
origin:origin |
4107 |
extent:extent |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4108 |
minExtent:minExt |
1127 | 4109 |
maxExtent:maxExt |
4110 |
borderWidth:bWidth |
|
4111 |
subViewOf:wsuperView |
|
1705 | 4112 |
style:wStyle |
1127 | 4113 |
inputOnly:winputOnly |
4114 |
label:wlabel |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4115 |
owner:wowner |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4116 |
icon:wicon |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4117 |
iconMask:wiconMask |
1127 | 4118 |
iconView:wiconView |
4119 |
||
2232 | 4120 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4121 |
|xpos ypos wwidth wheight minWidth minHeight maxWidth maxHeight |
2232 | 4122 |
wsuperViewId wiconId wiconMaskId windowId |
4123 |
weventMask wiconHeight |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4124 |
wiconWidth windowType windowClass moreArgs| |
1127 | 4125 |
|
2232 | 4126 |
"/ bColorId wiconViewId bitGravity vBgColor vBgForm deepForm |
4127 |
"/ preferredVisual preferredDepth viewGravity wcursorId |
|
4128 |
||
1127 | 4129 |
displayId isNil ifTrue:[ |
4130 |
self primitiveFailed. |
|
4131 |
^ nil |
|
4132 |
]. |
|
4133 |
||
4134 |
origin notNil ifTrue:[ |
|
4135 |
xpos := origin x. |
|
4136 |
ypos := origin y. |
|
4137 |
] ifFalse:[ |
|
4138 |
xpos := ypos := 0. |
|
4139 |
]. |
|
4140 |
extent notNil ifTrue:[ |
|
4141 |
wwidth := extent x. |
|
4142 |
wheight := extent y. |
|
4143 |
] ifFalse:[ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4144 |
wwidth := 100. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4145 |
wheight := 40. |
1127 | 4146 |
]. |
4147 |
minExt notNil ifTrue:[ |
|
4148 |
minWidth := minExt x. |
|
4149 |
minHeight := minExt y |
|
4150 |
]. |
|
4151 |
maxExt notNil ifTrue:[ |
|
4152 |
maxWidth := maxExt x. |
|
4153 |
maxHeight := maxExt y |
|
4154 |
]. |
|
4155 |
||
4156 |
wsuperView notNil ifTrue:[ |
|
4157 |
wsuperViewId := wsuperView id |
|
4158 |
]. |
|
4159 |
||
4160 |
wicon notNil ifTrue:[ |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4161 |
wiconId := wicon id. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4162 |
wiconHeight := wicon height. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4163 |
wiconWidth := wicon width. |
1418 | 4164 |
wiconMask notNil ifTrue:[ |
4165 |
wiconMaskId := wiconMask id |
|
4166 |
] |
|
1127 | 4167 |
]. |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4168 |
"/ wiconView notNil ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4169 |
"/ wiconViewId := wiconView id |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4170 |
"/ ]. |
2151 | 4171 |
weventMask := aView eventMask. |
1127 | 4172 |
|
1705 | 4173 |
NativeWindows ifTrue:[ |
1723 | 4174 |
windowType := aView nativeWindowType. |
1705 | 4175 |
|
4176 |
"/ if it is already a string, take it as it is; |
|
4177 |
"/ otherwise, it must be a symbol and is used |
|
4178 |
"/ as a key into the nativeClass translation map. |
|
4179 |
||
4180 |
windowType isString ifTrue:[ |
|
4181 |
windowClass := windowType |
|
4182 |
] ifFalse:[ |
|
4183 |
windowClass := NativeWindowClassTable at:windowType ifAbsent:nil |
|
4184 |
] |
|
4185 |
]. |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4186 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4187 |
moreArgs := Array new:20. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4188 |
moreArgs at:1 put:xpos. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4189 |
moreArgs at:2 put:ypos. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4190 |
moreArgs at:3 put:wwidth. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4191 |
moreArgs at:4 put:wheight. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4192 |
moreArgs at:5 put:minWidth. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4193 |
moreArgs at:6 put:minHeight. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4194 |
moreArgs at:7 put:maxWidth. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4195 |
moreArgs at:8 put:maxHeight. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4196 |
moreArgs at:9 put:wsuperViewId. |
2232 | 4197 |
moreArgs at:10 put:nil. "/ wcursorId. |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4198 |
moreArgs at:11 put:wiconId. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4199 |
moreArgs at:12 put:wiconMaskId. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4200 |
moreArgs at:13 put:wiconWidth. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4201 |
moreArgs at:14 put:wiconHeight. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4202 |
moreArgs at:15 put:windowType. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4203 |
moreArgs at:16 put:windowClass. |
2151 | 4204 |
moreArgs at:17 put:weventMask. |
2232 | 4205 |
moreArgs at:18 put:(aView className asString). |
2151 | 4206 |
|
4207 |
[ |
|
4208 |
windowId := self |
|
4209 |
primCreateWindowFor:aView |
|
4210 |
type:typeSymbol |
|
4211 |
borderWidth:bWidth |
|
4212 |
subViewOf:wsuperView |
|
4213 |
style:wStyle |
|
4214 |
inputOnly:winputOnly |
|
4215 |
label:wlabel |
|
4216 |
owner:wowner |
|
4217 |
icon:wicon |
|
4218 |
iconMask:wiconMask |
|
4219 |
moreArgs:moreArgs. |
|
4220 |
aView setId:windowId. |
|
4221 |
] valueUninterruptably. |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4222 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4223 |
windowId notNil ifTrue:[self addKnownView:aView withId:windowId]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4224 |
^ windowId |
2232 | 4225 |
! |
4226 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4227 |
destroyGC:aGCId |
2232 | 4228 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4229 |
if (__isExternalAddress(aGCId)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4230 |
struct gcData *gcData = _GCDATA(aGCId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4231 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4232 |
#ifdef COUNT_RESOURCES |
2232 | 4233 |
__cnt_gcData--; |
4234 |
RESPRINTF(("DestroyGcData %d\n",__cnt_gcData)); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4235 |
#endif |
2232 | 4236 |
if (gcData->hBitmap) |
4237 |
{ |
|
4238 |
#ifdef COUNT_BMP_RESOURCES |
|
4239 |
__cnt_bmpdc--; |
|
4240 |
RES_BMP_PRINTF(("free BmpDC %d\n",__cnt_bmpdc)); |
|
4241 |
#endif |
|
4242 |
} |
|
4243 |
free(gcData); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4244 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4245 |
%} |
2232 | 4246 |
! |
4247 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4248 |
destroyPixmap:aDrawableId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4249 |
|
2232 | 4250 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4251 |
if (__isExternalAddress(aDrawableId) && ISCONNECTED) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4252 |
HANDLE bitmapHandle = _HANDLEVal(aDrawableId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4253 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4254 |
if (bitmapHandle) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4255 |
{ |
2232 | 4256 |
#ifdef COUNT_BMP_RESOURCES |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4257 |
__cnt_bitmap--; |
2232 | 4258 |
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
|
4259 |
#endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4260 |
if( DelObject(bitmapHandle) ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4261 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4262 |
DPRINTF(("Bitmap deleted!\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4263 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4264 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4265 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4266 |
%} |
2232 | 4267 |
! |
4268 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4269 |
destroyView:aView withId:aWindowId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4270 |
self primDestroyView:aView withId:aWindowId. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4271 |
self removeKnownView:aView withId:aWindowId |
2232 | 4272 |
! |
4273 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4274 |
gcFor:aDrawableId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4275 |
|
2232 | 4276 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4277 |
HWND hWnd; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4278 |
struct gcData *gcData; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4279 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4280 |
if (__isExternalAddress(aDrawableId)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4281 |
hWnd = _HWNDVal(aDrawableId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4282 |
gcData = newGcData(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4283 |
if (! gcData) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4284 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4285 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4286 |
#ifdef COUNT_RESOURCES |
2232 | 4287 |
__cnt_gcData++; |
4288 |
RESPRINTF(("CreateGcData %d\n",__cnt_gcData)); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4289 |
#endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4290 |
gcData->hWnd = hWnd; |
2232 | 4291 |
gcData->_hDC = 0; |
4292 |
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
|
4293 |
RETURN ( __MKOBJ(gcData) ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4294 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4295 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4296 |
%} |
2232 | 4297 |
! |
4298 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4299 |
gcForBitmap:aDrawableId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4300 |
|
2232 | 4301 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4302 |
struct gcData *gcData; |
2151 | 4303 |
BITMAP bitmap; |
2000
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 |
if (__isExternalAddress(aDrawableId)) { /* HBITMAP */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4306 |
HBITMAP hBitmap = _HBITMAPVAL(aDrawableId); |
2232 | 4307 |
HDC hDC; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4308 |
gcData = newGcData(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4309 |
if (! gcData) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4310 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4311 |
} |
2232 | 4312 |
#ifdef COUNT_BMP_RESOURCES |
4313 |
__cnt_bmpdc++; |
|
4314 |
RES_BMP_PRINTF(("CreateBmpDC %d\n",__cnt_bmpdc)); |
|
4315 |
#endif |
|
2151 | 4316 |
if (GetObject(hBitmap,sizeof(bitmap),&bitmap)) |
4317 |
{ |
|
4318 |
DPRINTF(("bitmap info:%d\n",bitmap.bmBitsPixel)); |
|
4319 |
} |
|
4320 |
else |
|
4321 |
{ |
|
4322 |
DPRINTF(("noinfo returned\n")); |
|
4323 |
} |
|
2244 | 4324 |
gcData->hBitmap = hBitmap; |
2151 | 4325 |
gcData->bitmapColorBitCount = bitmap.bmBitsPixel; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4326 |
#ifdef COUNT_RESOURCES |
2232 | 4327 |
__cnt_gcData++; |
4328 |
RESPRINTF(("CreateGcData %d\n",__cnt_gcData)); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4329 |
#endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4330 |
RETURN ( __MKOBJ(gcData) ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4331 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4332 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4333 |
%} |
2232 | 4334 |
! |
4335 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4336 |
primCreateBitmapFromArray:anArray width:w height:h |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4337 |
|
2232 | 4338 |
%{ /* xxLIMITEDSTACK */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4339 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4340 |
HBITMAP newBitmapHandle; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4341 |
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
|
4342 |
int row, col; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4343 |
unsigned char *cp, *bPits; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4344 |
unsigned char *b_bits; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4345 |
unsigned char *pBits; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4346 |
int index; |
2232 | 4347 |
OBJ num, *op; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4348 |
unsigned char *allocatedBits = 0; |
2232 | 4349 |
unsigned char fastBits[10000]; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4350 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4351 |
if (! ISCONNECTED) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4352 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4353 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4354 |
*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4355 |
if (__bothSmallInteger(w, h) && _isNonNilObject(anArray)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4356 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4357 |
b_width = __intVal(w); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4358 |
b_height = __intVal(h); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4359 |
bytesPerRowST = (b_width + 7) / 8; |
2151 | 4360 |
bytesPerRowWN = ((b_width + 15) / 16) * 2; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4361 |
padding = bytesPerRowWN - bytesPerRowST; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4362 |
nBytes = b_height * bytesPerRowWN; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4363 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4364 |
if (nBytes < sizeof(fastBits)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4365 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4366 |
cp = b_bits = fastBits; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4367 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4368 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4369 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4370 |
cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4371 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4372 |
if (cp) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4373 |
{ |
2232 | 4374 |
if (__qClass(anArray) == @global(Array)) |
4375 |
{ |
|
4376 |
index = 1; |
|
4377 |
op = &(__ArrayInstPtr(anArray)->a_element[index - 1]); |
|
4378 |
for (row = b_height; row; row--) |
|
4379 |
{ |
|
4380 |
for (col = bytesPerRowST; col; col--) |
|
4381 |
{ |
|
4382 |
num = *op++; |
|
4383 |
if (! __isSmallInteger(num)) |
|
4384 |
goto fail; |
|
4385 |
*cp++ = __intVal(num); |
|
4386 |
} |
|
4387 |
cp += padding; |
|
4388 |
} |
|
4389 |
} |
|
4390 |
else if (__qClass(anArray) == @global(ByteArray)) |
|
4391 |
{ |
|
4392 |
pBits = __ByteArrayInstPtr(anArray)->ba_element; |
|
4393 |
for (row = b_height; row; row--) |
|
4394 |
{ |
|
4395 |
for (col = bytesPerRowST; col; col--) |
|
4396 |
{ |
|
4397 |
*cp++ = ( *pBits++ /*^ 0xFF*/ ); |
|
4398 |
} |
|
4399 |
cp += padding; |
|
4400 |
} |
|
4401 |
} |
|
4402 |
else |
|
4403 |
{ |
|
4404 |
goto fail; |
|
4405 |
} |
|
4406 |
DPRINTF(("create bitmap ...\n")); |
|
4407 |
||
4408 |
newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, b_bits ); |
|
4409 |
||
4410 |
if( newBitmapHandle ) |
|
4411 |
{ |
|
4412 |
#ifdef COUNT_BMP_RESOURCES |
|
4413 |
__cnt_bitmap++; |
|
4414 |
RES_BMP_PRINTF(("CreateBitmap %x %d\n",newBitmapHandle,__cnt_bitmap)); |
|
4415 |
#endif |
|
4416 |
DPRINTF(("returning bitmap ...\n")); |
|
4417 |
if (allocatedBits) |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4418 |
{ |
2232 | 4419 |
free(allocatedBits); |
4420 |
} |
|
4421 |
RETURN ( __MKOBJ(newBitmapHandle)); |
|
4422 |
} |
|
4423 |
} |
|
4424 |
} |
|
4425 |
fail: ; |
|
4426 |
PRINTF(("create bitmap FAILED!!!\n")); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4427 |
if (allocatedBits) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4428 |
{ |
2232 | 4429 |
PRINTF(("freeing up bitmap bits ...\n")); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4430 |
free(allocatedBits); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4431 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4432 |
DPRINTF(("returning nil ...\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4433 |
RETURN ( nil ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4434 |
%} |
2232 | 4435 |
! |
4436 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4437 |
primCreateWindowFor:aView type:aSymbol |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4438 |
borderWidth:bWidth subViewOf:wsuperView |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4439 |
style:wStyle inputOnly:winputOnly |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4440 |
label:wlabel owner:wowner |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4441 |
icon:wicon iconMask:wiconMask |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4442 |
moreArgs:moreArgs |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4443 |
|
2232 | 4444 |
%{ /* xxLIMITEDSTACK */ |
1127 | 4445 |
|
4446 |
WNDCLASS wc; |
|
4447 |
long bg, bd, bw; |
|
1706 | 4448 |
int winStyleBits, winEXStyleBits; |
1127 | 4449 |
int w, h, x, y; |
4450 |
int min_width, min_height; |
|
4451 |
int max_width, max_height; |
|
2151 | 4452 |
OBJ eventMask; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4453 |
RECT rec; |
1127 | 4454 |
HANDLE parentHandle; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4455 |
OBJ xpos, ypos, wwidth, wheight; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4456 |
OBJ minWidth, minHeight, maxWidth, maxHeight; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4457 |
OBJ wsuperViewId, wcursorId, wiconId, wiconMaskId; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4458 |
OBJ wiconWidth, wiconHeight; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4459 |
OBJ windowType, windowClass, windowId; |
2232 | 4460 |
OBJ stClassName; |
1127 | 4461 |
int isTopWindow = 0; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4462 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4463 |
unsigned char* cp; |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4464 |
HBITMAP xBitMap, maskBitmap; |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4465 |
int height, width; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4466 |
int nBytes, nBits; |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4467 |
int index; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4468 |
HICON xIcon = (HICON)0; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4469 |
SIZE oldSize; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4470 |
ICONINFO iconInfo; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4471 |
char *className; |
2232 | 4472 |
unsigned char *allocatedBits = 0; |
4473 |
unsigned char fastBits[10000]; |
|
1127 | 4474 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4475 |
xpos = __ArrayInstPtr(moreArgs)->a_element[0]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4476 |
ypos = __ArrayInstPtr(moreArgs)->a_element[1]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4477 |
wwidth = __ArrayInstPtr(moreArgs)->a_element[2]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4478 |
wheight = __ArrayInstPtr(moreArgs)->a_element[3]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4479 |
minWidth = __ArrayInstPtr(moreArgs)->a_element[4]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4480 |
minHeight = __ArrayInstPtr(moreArgs)->a_element[5]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4481 |
maxWidth = __ArrayInstPtr(moreArgs)->a_element[6]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4482 |
maxHeight = __ArrayInstPtr(moreArgs)->a_element[7]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4483 |
wsuperViewId = __ArrayInstPtr(moreArgs)->a_element[8]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4484 |
wcursorId = __ArrayInstPtr(moreArgs)->a_element[9]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4485 |
wiconId = __ArrayInstPtr(moreArgs)->a_element[10]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4486 |
wiconMaskId = __ArrayInstPtr(moreArgs)->a_element[11]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4487 |
wiconWidth = __ArrayInstPtr(moreArgs)->a_element[12]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4488 |
wiconHeight = __ArrayInstPtr(moreArgs)->a_element[13]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4489 |
windowType = __ArrayInstPtr(moreArgs)->a_element[14]; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4490 |
windowClass = __ArrayInstPtr(moreArgs)->a_element[15]; |
2151 | 4491 |
eventMask = __ArrayInstPtr(moreArgs)->a_element[16]; |
2232 | 4492 |
stClassName = __ArrayInstPtr(moreArgs)->a_element[17]; |
1127 | 4493 |
bg = WhitePixel; |
4494 |
bd = BlackPixel; |
|
2151 | 4495 |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4496 |
/* get bitmap for icon */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4497 |
if( __isExternalAddress(wiconId) ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4498 |
{ |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4499 |
xBitMap = _HBITMAPVAL( wiconId ); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4500 |
if( xBitMap != 0 ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4501 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4502 |
BITMAP bm; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4503 |
if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4504 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4505 |
int d = bm.bmPlanes * bm.bmBitsPixel; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4506 |
BYTE *ep; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4507 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4508 |
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
|
4509 |
height = __intVal( wiconHeight ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4510 |
width = __intVal( wiconWidth ); |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4511 |
nBytes = ( width + 15 ) / 16; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4512 |
nBytes = height * nBytes * 2; |
2232 | 4513 |
if (nBytes < sizeof(fastBits)) |
4514 |
{ |
|
4515 |
ep = fastBits; |
|
4516 |
} |
|
4517 |
else |
|
4518 |
{ |
|
4519 |
ep = allocatedBits = (unsigned char *) malloc(nBytes); |
|
4520 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4521 |
if ( ep != 0 ) |
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(ep,0,nBytes); |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4524 |
maskBitmap = CreateBitmap(width, height, 1, 1, ep ); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4525 |
if( maskBitmap != NULL ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4526 |
{ |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4527 |
DPRINTF(( "BITMAP mask CREATED!!!\n" )); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4528 |
iconInfo.fIcon = TRUE; |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4529 |
iconInfo.hbmMask = maskBitmap; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4530 |
iconInfo.hbmColor = xBitMap; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4531 |
xIcon = CreateIconIndirect( &iconInfo ); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4532 |
DPRINTF(( "ICON CREATED!!!\n" )); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4533 |
DelObject( maskBitmap ); |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4534 |
} else { |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4535 |
DPRINTF(( "BITMAP mask CREATION failed!!!\n" )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4536 |
} |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4537 |
} else { |
2232 | 4538 |
PRINTF(( " malloc failed\n" )); |
4539 |
} |
|
2244 | 4540 |
if (allocatedBits) |
2232 | 4541 |
free(allocatedBits); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4542 |
} |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4543 |
} else { |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4544 |
DPRINTF((" xBitMap is zero \n" )); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4545 |
} |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4546 |
} else { |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4547 |
if (wiconId == nil) { |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4548 |
DPRINTF((" wiconId is nil\n")); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4549 |
} else { |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4550 |
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
|
4551 |
} |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4552 |
} |
2232 | 4553 |
|
1127 | 4554 |
if (__bothSmallInteger(wwidth, wheight)) { |
4555 |
w = __intVal(wwidth); |
|
4556 |
h = __intVal(wheight); |
|
4557 |
} else { |
|
4558 |
w = h = 100; |
|
4559 |
} |
|
4560 |
||
4561 |
if (__bothSmallInteger(xpos, ypos)) { |
|
4562 |
x = __intVal(xpos); |
|
4563 |
y = __intVal(ypos); |
|
4564 |
} else { |
|
4565 |
x = y = 0; |
|
4566 |
} |
|
4567 |
||
4568 |
if (__bothSmallInteger(minWidth, minHeight)) { |
|
4569 |
min_width = __intVal(minWidth); |
|
4570 |
min_height = __intVal(minHeight); |
|
4571 |
} else { |
|
4572 |
min_width = min_height = 0; |
|
4573 |
} |
|
4574 |
||
4575 |
if (__bothSmallInteger(maxWidth, maxHeight)) { |
|
4576 |
max_width = __intVal(maxWidth); |
|
4577 |
max_height = __intVal(maxHeight); |
|
4578 |
} else { |
|
4579 |
max_width = max_height = 10000; |
|
4580 |
} |
|
4581 |
||
1706 | 4582 |
winStyleBits = winEXStyleBits = 0; |
1127 | 4583 |
|
4584 |
if (__isSmallInteger(bWidth)) { |
|
4585 |
bw = __intVal(bWidth); |
|
4586 |
if (bw) { |
|
1705 | 4587 |
winStyleBits |= WS_BORDER; |
1127 | 4588 |
bw = 1; |
4589 |
} |
|
4590 |
} else { |
|
4591 |
bw = 0; |
|
4592 |
} |
|
4593 |
||
1705 | 4594 |
className = app_name; |
4595 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4596 |
/* if (__isString(windowClass)) { |
1705 | 4597 |
className = __stringVal(windowClass); |
4598 |
} |
|
4599 |
||
4600 |
if (__isString(windowClass)) { |
|
4601 |
if (__isInteger(wStyle)) { |
|
4602 |
winStyleBits |= __longIntVal(wStyle); |
|
4603 |
} else { |
|
1723 | 4604 |
if (windowType == @symbol(RadioButton)) { |
4605 |
winStyleBits |= BS_RADIOBUTTON; |
|
4606 |
} else if (windowType == @symbol(CheckBox)) { |
|
4607 |
winStyleBits |= BS_CHECKBOX; |
|
4608 |
} else if (windowType == @symbol(HorizontalScrollbar)) { |
|
4609 |
winStyleBits |= SBS_HORZ; |
|
4610 |
} else if (windowType == @symbol(VerticalScrollBar)) { |
|
4611 |
winStyleBits |= SBS_VERT; |
|
4612 |
} |
|
1705 | 4613 |
} |
4614 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4615 |
*/ |
1127 | 4616 |
if (__isExternalAddress(wsuperViewId)) { |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4617 |
/* |
1127 | 4618 |
* a child window |
4619 |
*/ |
|
4620 |
parentHandle = _HANDLEVal(wsuperViewId); |
|
2151 | 4621 |
winStyleBits |= WS_CHILD; |
4622 |
if (winputOnly != true) |
|
2232 | 4623 |
{ |
2151 | 4624 |
winStyleBits |= (WS_CLIPSIBLINGS|WS_CLIPCHILDREN); |
2232 | 4625 |
/*winStyleBits |= WS_CLIPCHILDREN;*/ |
4626 |
DPRINTF(("parent handle=%x\n", parentHandle)); |
|
4627 |
} |
|
2151 | 4628 |
else |
4629 |
{ |
|
2232 | 4630 |
winEXStyleBits |= WS_EX_TRANSPARENT; |
4631 |
DPRINTF(("inputview parent handle=%x\n", parentHandle)); |
|
4632 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4633 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4634 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4635 |
{ |
2232 | 4636 |
char buf[300]; |
4637 |
char *stName; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4638 |
static winCount; |
2232 | 4639 |
# ifdef __BORLANDC__ |
4640 |
struct timeb timebuffer; |
|
4641 |
ftime(&timebuffer); |
|
4642 |
# else |
|
4643 |
struct _timeb timebuffer; |
|
4644 |
_ftime(&timebuffer); |
|
4645 |
# endif |
|
4646 |
if (__isString(stClassName)) |
|
4647 |
{ |
|
4648 |
stName = __stringVal(stClassName); |
|
4649 |
} |
|
4650 |
else |
|
4651 |
stName = app_name; |
|
4652 |
||
4653 |
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
|
4654 |
/* |
1127 | 4655 |
* a top window |
4656 |
*/ |
|
4657 |
parentHandle = NULL; |
|
4658 |
isTopWindow = 1; |
|
2232 | 4659 |
DPRINTF(("topview - registerClass:%s\n",buf)); |
4660 |
||
4661 |
||
4662 |
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
|
4663 |
wc.lpfnWndProc = (WNDPROC) MainWndProc; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4664 |
wc.cbClsExtra = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4665 |
wc.cbWndExtra = N_WINDOW_PRIVATE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4666 |
wc.hInstance = (HANDLE) __getHInstance(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4667 |
if (xIcon) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4668 |
wc.hIcon = xIcon; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4669 |
/* 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
|
4670 |
} else { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4671 |
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
|
4672 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4673 |
wc.hCursor = 0 /* LoadCursor(NULL, IDC_ARROW) */; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4674 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4675 |
wc.hbrBackground = 0; /*CreateSolidBrush (bg);*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4676 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4677 |
wc.lpszMenuName = NULL; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4678 |
wc.lpszClassName = buf; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4679 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4680 |
if (!RegisterClass(&wc)) { |
2151 | 4681 |
PRINTF(("RegisterClass failed\n")); |
4682 |
RETURN( nil ); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4683 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4684 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4685 |
className = buf; |
2232 | 4686 |
|
1705 | 4687 |
if (wStyle == @symbol(popUp)) { |
4688 |
winStyleBits |= WS_POPUP; |
|
2244 | 4689 |
winStyleBits |= WS_DISABLED; |
4690 |
winEXStyleBits |= WS_EX_TOOLWINDOW; |
|
4691 |
CPRINTF(("Create popUpWindow\n")); |
|
1705 | 4692 |
} else if (wStyle == @symbol(dialog)) { |
4693 |
/* |
|
4694 |
winStyleBits |= WS_OVERLAPPED | WS_CAPTION | WS_THICKFRAME; |
|
4695 |
*/ |
|
4696 |
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
|
4697 |
if ((min_width || min_height) |
1705 | 4698 |
&& (min_width == max_width) |
4699 |
&& (min_height == max_height)) { |
|
4700 |
winStyleBits &= ~WS_THICKFRAME; |
|
4701 |
} |
|
1127 | 4702 |
} else { |
1705 | 4703 |
winStyleBits |= WS_OVERLAPPEDWINDOW; |
1706 | 4704 |
winEXStyleBits |= WS_EX_CLIENTEDGE; |
4705 |
||
1127 | 4706 |
} |
2151 | 4707 |
winStyleBits |= WS_CLIPCHILDREN; |
1127 | 4708 |
} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4709 |
rec.left = x; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4710 |
rec.top = y; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4711 |
rec.right = x + w; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4712 |
rec.bottom = y+ h; |
2151 | 4713 |
_thread_winStyleBitsEx = WS_EX_LEFT | WS_EX_NOPARENTNOTIFY | winEXStyleBits; |
2232 | 4714 |
#ifdef ADJUSTWINDOW |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4715 |
AdjustWindowRectEx(&rec,winStyleBits,0,_thread_winStyleBitsEx); |
2232 | 4716 |
w = rec.right - rec.left; |
4717 |
h = rec.bottom - rec.top; |
|
4718 |
#endif |
|
2151 | 4719 |
DPRINTF(("create%s pos==%d/%d size=%d/%d bw=%d parent %x class='%s'...\n", |
4720 |
((wStyle == @symbol(popUp)) ? " popUp" : ""), x, y, w, h, bw,parentHandle, className)); |
|
1127 | 4721 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4722 |
/* allocate localMemory for Window */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4723 |
_thread_local = (localWindowInfo*)malloc(sizeof(localWindowInfo)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4724 |
if (_thread_local) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4725 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4726 |
memset(_thread_local,0,sizeof(*_thread_local)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4727 |
if (isTopWindow) |
2232 | 4728 |
{ |
4729 |
if (rec.left < 0) |
|
4730 |
{ |
|
4731 |
rec.left = 0; |
|
4732 |
rec.right = w; |
|
4733 |
} |
|
4734 |
if (rec.top < 0) |
|
4735 |
{ |
|
4736 |
rec.top = 0; |
|
4737 |
rec.bottom = h; |
|
4738 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4739 |
_thread_local->flag = LI_TOPWIN; |
2232 | 4740 |
} |
2151 | 4741 |
if (winputOnly == true) |
2232 | 4742 |
_thread_local->flag |= LI_INPUTWIN; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4743 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4744 |
_thread_className = className; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4745 |
_thread_winStyleBits = winStyleBits; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4746 |
_thread_parentHandle = parentHandle; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4747 |
_thread_x = rec.left; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4748 |
_thread_y = rec.top; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4749 |
_thread_dx = rec.right - rec.left; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4750 |
_thread_dy = rec.bottom - rec.top; |
2151 | 4751 |
rec.left = 0; |
4752 |
rec.top = 0; |
|
4753 |
rec.right = min_width; |
|
4754 |
rec.bottom = min_height; |
|
2232 | 4755 |
#ifdef ADJUSTWINDOW |
2151 | 4756 |
AdjustWindowRectEx(&rec,winStyleBits,0,_thread_winStyleBitsEx); |
2232 | 4757 |
#endif |
2151 | 4758 |
_thread_local->minWidth = rec.right - rec.left; |
4759 |
_thread_local->minHeight = rec.bottom - rec.top; |
|
4760 |
||
4761 |
rec.left = 0; |
|
4762 |
rec.top = 0; |
|
4763 |
rec.right = max_width; |
|
4764 |
rec.bottom = max_height; |
|
2232 | 4765 |
#ifdef ADJUSTWINDOW |
2151 | 4766 |
AdjustWindowRectEx(&rec,winStyleBits,0,_thread_winStyleBitsEx); |
2232 | 4767 |
#endif |
2151 | 4768 |
_thread_local->maxWidth = rec.right - rec.left; |
4769 |
_thread_local->maxHeight = rec.bottom - rec.top; |
|
4770 |
_thread_local->bgBrush = 0; /*GetStockObject(HOLLOW_BRUSH);*/ |
|
4771 |
||
4772 |
if (__isSmallInteger(eventMask)) |
|
4773 |
_thread_local->eventMask = __intVal(eventMask); |
|
4774 |
else |
|
4775 |
_thread_local->eventMask = 0xffffffff; |
|
4776 |
DPRINTF(("eventMask is %x\n")); |
|
2232 | 4777 |
#ifdef DEBUGMASK1 |
2151 | 4778 |
printMask(_thread_local->eventMask); |
4779 |
#endif |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4780 |
_thread_newWinHandle = 0; |
2232 | 4781 |
_thread_windowName = 0; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4782 |
if (isTopWindow) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4783 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4784 |
if (__isString(wlabel) || __isSymbol(wlabel)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4785 |
_thread_windowName = (char *) __stringVal(wlabel); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4786 |
DPRINTF(("title = %s\n", _thread_windowName)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4787 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4788 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4789 |
PostThreadMessage(_dispatchThreadId,WM_THREADCREATEWINDOW,0,0); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4790 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4791 |
DWORD dwWaitResult; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4792 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4793 |
/* Request ownership of mutex. */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4794 |
dwWaitResult = WaitForSingleObject( |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4795 |
hCreateEvent, /* handle of mutex */ |
2151 | 4796 |
15000L); /* time-out interval */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4797 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4798 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4799 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4800 |
DPRINTF(("handle = %x\n", _thread_newWinHandle)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4801 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4802 |
if (! _thread_newWinHandle) { |
2232 | 4803 |
DPRINTF(("handle is nil\n")); |
1127 | 4804 |
RETURN ( nil ); |
4805 |
} |
|
4806 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4807 |
windowId = __MKOBJ(_thread_newWinHandle); |
2232 | 4808 |
if (_thread_newWinHandle) |
4809 |
SetWindowPos(_thread_newWinHandle, HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE); |
|
1127 | 4810 |
DPRINTF(("done - create\n")); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4811 |
RETURN (windowId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4812 |
%} |
2232 | 4813 |
! |
4814 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4815 |
primDestroyView:aView withId:aWindowId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4816 |
|
2232 | 4817 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4818 |
HICON yIcon; |
1127 | 4819 |
if (__isExternalAddress(aWindowId)) { |
4820 |
HWND win = _HWNDVal(aWindowId); |
|
4821 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4822 |
if (win && IsWindow(win)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4823 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4824 |
yIcon = (HICON)GetClassLong(_thread_newWinHandle,GCL_HICON); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4825 |
SetClassLong(_thread_newWinHandle,GCL_HICON,(DWORD)0); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4826 |
/* 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
|
4827 |
if( yIcon ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4828 |
{ |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
4829 |
if( DestroyIcon( yIcon ) ) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4830 |
DPRINTF(( "Old icon deleted\n" )); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4831 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4832 |
/*printf("post WM_THREADDESTROYWINDOW\n");*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4833 |
PostMessage(win,WM_THREADDESTROYWINDOW,0,0); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4834 |
} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4835 |
} |
1127 | 4836 |
%} |
2232 | 4837 |
! |
4838 |
||
1127 | 4839 |
rootWindowId |
4840 |
"return the id of the root window. |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4841 |
This is the window you see as background, |
1127 | 4842 |
however, it may or may not be the real physical root window, |
4843 |
since some window managers install a virtual root window on top |
|
4844 |
of the real one. If this is the case, that views id is returned here." |
|
4845 |
||
4846 |
^ rootWin |
|
2232 | 4847 |
! ! |
4848 |
||
4849 |
!WinWorkstation methodsFor:'color stuff'! |
|
4850 |
||
1127 | 4851 |
colorRed:redVal green:greenVal blue:blueVal |
4852 |
"allocate a color with rgb values (0..100) - return the color index (i.e. colorID). |
|
4853 |
This method is obsoleted by #colorScaledRed:scaledGreen:scaledBlue:" |
|
4854 |
||
4855 |
|r g b| |
|
4856 |
||
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4857 |
r := self percentToDeviceColorValue:redVal. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4858 |
g := self percentToDeviceColorValue:greenVal. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
4859 |
b := self percentToDeviceColorValue:blueVal. |
1127 | 4860 |
^ self colorScaledRed:r scaledGreen:g scaledBlue:b |
2232 | 4861 |
! |
4862 |
||
1127 | 4863 |
colorScaledRed:r scaledGreen:g scaledBlue:b |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4864 |
"allocate a color with rgb values (0..16rFFFF) - return the color index |
1127 | 4865 |
(i.e. colorID)" |
4866 |
%{ |
|
4867 |
int id, ir, ig, ib; |
|
4868 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4869 |
if (__bothSmallInteger(r, g) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4870 |
&& __isSmallInteger(b)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4871 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4872 |
id = RGB2st(__intVal(r),__intVal(g),__intVal(b)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4873 |
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
|
4874 |
RETURN ( __MKSMALLINT(id) ); |
1127 | 4875 |
} |
4876 |
%}. |
|
4877 |
self primitiveFailed. |
|
4878 |
^ nil |
|
2232 | 4879 |
! |
4880 |
||
1127 | 4881 |
freeColor:colorIndex |
4882 |
"free a display color when its no longer needed" |
|
4883 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4884 |
'free color' printCR. |
1127 | 4885 |
^ self |
2232 | 4886 |
! |
4887 |
||
1127 | 4888 |
getRGBFrom:index into:aBlock |
4889 |
"get rgb components (0..100) of color in map at:index, |
|
4890 |
and evaluate the 3-arg block, aBlock with them" |
|
4891 |
||
4892 |
|val| |
|
4893 |
||
4894 |
self getScaledRGBFrom:index into:[:r :g :b | |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4895 |
val := aBlock |
1127 | 4896 |
value:(r * 100.0 / 16rFFFF) |
4897 |
value:(g * 100.0 / 16rFFFF) |
|
4898 |
value:(b * 100.0 / 16rFFFF) |
|
4899 |
]. |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4900 |
'get RGB' printCR. |
1127 | 4901 |
^ val |
2232 | 4902 |
! |
4903 |
||
2151 | 4904 |
getRGBFromName:colorName into:aBlock |
4905 |
"get rgb components (0..100) of color named colorName, |
|
4906 |
and evaluate the 3-arg block, aBlock with them" |
|
4907 |
||
4908 |
|val| |
|
4909 |
||
4910 |
self getScaledRGBFromName:colorName into:[:r :g :b | |
|
4911 |
r isNil ifTrue:[^nil]. |
|
4912 |
val := aBlock |
|
4913 |
value:(r * 100.0 / 16rFFFF) |
|
4914 |
value:(g * 100.0 / 16rFFFF) |
|
4915 |
value:(b * 100.0 / 16rFFFF) |
|
4916 |
]. |
|
4917 |
^val |
|
2232 | 4918 |
! |
4919 |
||
1127 | 4920 |
getScaledRGBFrom:index into:aBlock |
4921 |
"get rgb components (0 .. 16rFFFF) of color in map at:index, |
|
4922 |
and evaluate the 3-arg block, aBlock with them" |
|
4923 |
||
4924 |
|r g b| |
|
4925 |
%{ |
|
4926 |
int id = __intVal(index); |
|
4927 |
int iR, iG, iB; |
|
4928 |
||
2151 | 4929 |
id = st2RGB(id,0); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4930 |
iR = id & 0xFF; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4931 |
iG = (id >> 8) & 0xFF; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4932 |
iB = (id >> 16) & 0xFF; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4933 |
iR = (iR << 8) | iR; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4934 |
iG = (iG << 8) | iG; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4935 |
iB = (iB << 8) | iB; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4936 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4937 |
r = __MKSMALLINT(iR); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4938 |
g = __MKSMALLINT(iG); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4939 |
b = __MKSMALLINT(iB); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
4940 |
/*printf("get color %x -> %x/%x/%x\n",id, iR, iG, iB);*/ |
1127 | 4941 |
%}. |
4942 |
^ aBlock value:r value:g value:b |
|
2232 | 4943 |
! |
4944 |
||
2151 | 4945 |
getScaledRGBFromName:colorName into:aBlock |
4946 |
"get scaled rgb components (0..16rFFFF) of color named colorName, |
|
4947 |
and evaluate the 3-arg block, aBlock with them" |
|
4948 |
||
4949 |
|triple r g b found| |
|
4950 |
||
4951 |
r := g := b := 0. |
|
4952 |
found := false. |
|
4953 |
(colorName startsWith:$#) ifTrue:[ |
|
4954 |
"/ color in r/g/b hex notation |
|
4955 |
r := Integer readFrom:(colorName copyFrom:2 to:3) radix:16. |
|
4956 |
g := Integer readFrom:(colorName copyFrom:4 to:5) radix:16. |
|
4957 |
b := Integer readFrom:(colorName copyFrom:6 to:7) radix:16. |
|
4958 |
found := true. |
|
4959 |
] ifFalse:[ |
|
4960 |
||
4961 |
triple := StandardColorValues at:colorName asString ifAbsent:nil. |
|
4962 |
triple isNil ifTrue:[ |
|
4963 |
triple := StandardColorValues at:colorName asString asLowercase ifAbsent:nil. |
|
4964 |
]. |
|
4965 |
triple notNil ifTrue:[ |
|
4966 |
r := triple at:1. |
|
4967 |
g := triple at:2. |
|
4968 |
b := triple at:3. |
|
4969 |
found := true. |
|
4970 |
]. |
|
4971 |
]. |
|
4972 |
found ifFalse:[ |
|
4973 |
('WinWorkstation: unknown color: ' , colorName) infoPrintCR. |
|
4974 |
]. |
|
4975 |
||
4976 |
^ aBlock value:((r * 256) + r) value:((g * 256) + g) value:((b * 256) + b) |
|
2232 | 4977 |
! |
4978 |
||
2151 | 4979 |
listOfAvailableColors |
4980 |
"return a list of all available colornames. |
|
4981 |
This should not be used, since colornames are very |
|
4982 |
display-specific (here X-specific)." |
|
4983 |
||
4984 |
|aStream list line index colorName| |
|
4985 |
||
4986 |
aStream := FileStream readonlyFileNamed:'/usr/lib/X11/rgb.txt'. |
|
4987 |
aStream isNil ifTrue:[^ nil]. |
|
4988 |
list := OrderedCollection new. |
|
4989 |
[aStream atEnd] whileFalse:[ |
|
4990 |
line := aStream nextLine. |
|
4991 |
line notNil ifTrue:[ |
|
4992 |
"skip the r/g/b numbers" |
|
4993 |
index := 1. |
|
4994 |
[(line at:index) isSeparator] whileTrue:[index := index + 1]. |
|
4995 |
[(line at:index) isDigit] whileTrue:[index := index + 1]. |
|
4996 |
[(line at:index) isSeparator] whileTrue:[index := index + 1]. |
|
4997 |
[(line at:index) isDigit] whileTrue:[index := index + 1]. |
|
4998 |
[(line at:index) isSeparator] whileTrue:[index := index + 1]. |
|
4999 |
[(line at:index) isDigit] whileTrue:[index := index + 1]. |
|
5000 |
[(line at:index) isSeparator] whileTrue:[index := index + 1]. |
|
5001 |
colorName := line copyFrom:index. |
|
5002 |
((colorName occurrencesOf:(Character space)) == 0) ifTrue:[ |
|
5003 |
list add:colorName |
|
5004 |
] |
|
5005 |
] |
|
5006 |
]. |
|
5007 |
aStream close. |
|
5008 |
^ list sort |
|
5009 |
||
5010 |
" |
|
5011 |
Screen current listOfAvailableColors |
|
5012 |
" |
|
5013 |
||
5014 |
"Modified: 11.9.1996 / 15:26:28 / stefan" |
|
2232 | 5015 |
! |
5016 |
||
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
5017 |
percentToDeviceColorValue:aPercentage |
1127 | 5018 |
"given a color-component value in percent (0..100), return the corresponding |
5019 |
WIN-component value (0..16rFFFF) as an integer" |
|
5020 |
||
5021 |
%{ /* NOCONTEXT */ |
|
5022 |
||
5023 |
if (__isSmallInteger(aPercentage)) { |
|
5024 |
RETURN ( __MKSMALLINT(0xFFFF * __intVal(aPercentage) / 100) ); |
|
5025 |
} |
|
5026 |
if (__isFloat(aPercentage)) { |
|
5027 |
RETURN ( __MKSMALLINT(0xFFFF * (int)(__floatVal(aPercentage)) / 100) ); |
|
5028 |
} |
|
5029 |
%}. |
|
5030 |
^ (16rFFFF * aPercentage / 100) rounded |
|
2232 | 5031 |
! |
5032 |
||
2151 | 5033 |
setColor:index scaledRed:sred scaledGreen:sgreen scaledBlue:sblue |
5034 |
||
5035 |
'setColor:index scaledRed:sred scaledGreen:sgreen scaledBlue:sblue' printCR. |
|
5036 |
^ self. |
|
5037 |
||
5038 |
"Created: 30.1.1998 / 09:27:48 / md" |
|
5039 |
"Modified: 30.1.1998 / 09:30:22 / md" |
|
2232 | 5040 |
! ! |
5041 |
||
5042 |
!WinWorkstation methodsFor:'cursor stuff'! |
|
5043 |
||
1723 | 5044 |
builtInCursorShapes |
5045 |
"return a collection of standard cursor names. |
|
5046 |
Those are built into Windows and need not be created as |
|
5047 |
user cursors. |
|
5048 |
(actually, there are more than those below ...)" |
|
5049 |
||
5050 |
"/ if you add something here, also add to #shapeNumberFromCursor ... |
|
5051 |
||
5052 |
^ #( |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5053 |
#upLeftArrow "/ IDC_ARROW |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5054 |
#upDownArrow "/ IDC_SIZENS |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5055 |
#leftRightArrow "/ IDC_SIZEWE |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5056 |
#text "/ IDC_IBEAM |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5057 |
#wait "/ IDC_WAIT |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5058 |
#execute "/ IDC_APPSTARTING |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5059 |
#crossHair "/ IDC_CROSS |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5060 |
#fourWay "/ IDC_SIZEALL |
2151 | 5061 |
#upRightHand "/ IDC_ARROW |
1723 | 5062 |
) |
2232 | 5063 |
! |
5064 |
||
1127 | 5065 |
createCursorShape:aShape |
5066 |
"create a cursor given a shape-symbol" |
|
5067 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5068 |
|number| |
1127 | 5069 |
|
5070 |
number := self shapeNumberFromSymbol:aShape. |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5071 |
^ self primCreateCursorShapeNr:number |
2232 | 5072 |
! |
5073 |
||
2151 | 5074 |
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
|
5075 |
"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
|
5076 |
|
2232 | 5077 |
|padding bpl bplPadded srcOffs dstOffs |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5078 |
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
|
5079 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5080 |
cW := self class getSystemMetrics:#cursorWidth. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5081 |
cH := self class getSystemMetrics:#cursorHeight. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5082 |
"/ ('cursorWidth ',cW printString,'cursorHeight ',cH printString) infoPrintCR. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5083 |
src := sourceBytes. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5084 |
mask := maskBytes. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5085 |
padding := self cursorBitmapPadding. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5086 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5087 |
"/ repadding and/or resizing required ? |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5088 |
bpl := sourceBytes size / h. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5089 |
bplPadded := (cW + padding - 1) // padding * 2. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5090 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5091 |
bpl ~~ bplPadded ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5092 |
"/ 'repad cursor bits' infoPrintCR. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5093 |
srcPadded := ByteArray new:(bplPadded * cH). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5094 |
nB := bpl min: bplPadded. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5095 |
nR := cH min: h. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5096 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5097 |
dstOffs := srcOffs := 1. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5098 |
1 to:nR do:[:row | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5099 |
srcPadded |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5100 |
replaceFrom:dstOffs |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5101 |
to:(dstOffs+nB-1) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5102 |
with:src |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5103 |
startingAt:srcOffs. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5104 |
dstOffs := dstOffs + bplPadded. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5105 |
srcOffs := srcOffs + bpl. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5106 |
]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5107 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5108 |
maskPadded := ByteArray new:(bplPadded * cH). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5109 |
dstOffs := srcOffs := 1. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5110 |
1 to:nR do:[:row | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5111 |
maskPadded |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5112 |
replaceFrom:dstOffs |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5113 |
to:(dstOffs+nB-1) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5114 |
with:mask |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5115 |
startingAt:srcOffs. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5116 |
dstOffs := dstOffs + bplPadded. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5117 |
srcOffs := srcOffs + bpl. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5118 |
]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5119 |
src := srcPadded. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5120 |
mask := maskPadded. |
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 |
]. |
2232 | 5123 |
src invert. |
5124 |
1 to:src size do:[:index | |
|
5125 |
src byteAt:index put:((src byteAt:index) bitAnd:(mask byteAt:index)). |
|
5126 |
]. |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5127 |
mask invert. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5128 |
cursor := self |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5129 |
primCreateCursorSourceBits:src |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5130 |
maskBits:mask |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5131 |
hotX:hx hotY:hy |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5132 |
width:cW height:cH. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5133 |
cursor notNil ifTrue:[ ^ cursor ]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5134 |
self halt. |
2232 | 5135 |
! |
5136 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5137 |
cursorBitmapPadding |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5138 |
^ 16 "/ windows requires short-padded rows |
2232 | 5139 |
! |
5140 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5141 |
destroyCursor:aCursorId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5142 |
|
2232 | 5143 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5144 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5145 |
if (ISCONNECTED) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5146 |
if (__isExternalAddress(aCursorId)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5147 |
HCURSOR curs = _HCURSORVal(aCursorId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5148 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5149 |
if (curs) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5150 |
#ifdef KEEP_STD_CURSORS |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5151 |
if ((curs != H_C_ARROW) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5152 |
&& (curs != H_C_CROSS) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5153 |
&& (curs != H_C_IBEAM) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5154 |
&& (curs != H_C_ICON) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5155 |
&& (curs != H_C_NO) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5156 |
&& (curs != H_C_SIZE) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5157 |
&& (curs != H_C_SIZEALL) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5158 |
&& (curs != H_C_SIZENESW) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5159 |
&& (curs != H_C_SIZENS) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5160 |
&& (curs != H_C_SIZENWSE) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5161 |
&& (curs != H_C_UPARROW) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5162 |
&& (curs != H_C_WAIT)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5163 |
#endif /* KEEP_STD_CURSORS */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5164 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5165 |
DestroyCursor(curs); |
2232 | 5166 |
#ifdef COUNT_RESOURCES |
5167 |
__cnt_cur--; |
|
5168 |
RESPRINTF(("DestroyCursor %d\n",__cnt_cur)); |
|
5169 |
#endif |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5170 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5171 |
} |
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 |
%} |
2232 | 5176 |
! |
5177 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5178 |
needDeviceFormsForCursor |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5179 |
^ false |
2232 | 5180 |
! |
5181 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5182 |
primCreateCursorShapeNr:number |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5183 |
|
2232 | 5184 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 5185 |
HCURSOR newCursor; |
5186 |
LPCTSTR cId; |
|
5187 |
||
5188 |
if (__isSmallInteger(number)) { |
|
5189 |
cId = (LPCTSTR)(__intVal(number)); |
|
5190 |
newCursor = LoadCursor(NULL, cId); |
|
1705 | 5191 |
if (newCursor) { |
1685 | 5192 |
#ifdef KEEP_STD_CURSORS |
1127 | 5193 |
if (cId == IDC_ARROW) |
5194 |
H_C_ARROW = newCursor; |
|
5195 |
else if (cId == IDC_CROSS) |
|
5196 |
H_C_CROSS = newCursor; |
|
5197 |
else if (cId == IDC_IBEAM) |
|
5198 |
H_C_IBEAM = newCursor; |
|
5199 |
else if (cId == IDC_ICON) |
|
5200 |
H_C_ICON = newCursor; |
|
5201 |
else if (cId == IDC_NO) |
|
5202 |
H_C_NO = newCursor; |
|
5203 |
else if (cId == IDC_SIZE) |
|
5204 |
H_C_SIZE = newCursor; |
|
5205 |
else if (cId == IDC_SIZEALL) |
|
5206 |
H_C_SIZEALL = newCursor; |
|
5207 |
else if (cId == IDC_SIZENESW) |
|
5208 |
H_C_SIZENESW = newCursor; |
|
5209 |
else if (cId == IDC_SIZENS) |
|
5210 |
H_C_SIZENS = newCursor; |
|
5211 |
else if (cId == IDC_SIZENWSE) |
|
5212 |
H_C_SIZENWSE = newCursor; |
|
5213 |
else if (cId == IDC_UPARROW) |
|
5214 |
H_C_UPARROW = newCursor; |
|
5215 |
else if (cId == IDC_WAIT) |
|
5216 |
H_C_WAIT = newCursor; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5217 |
#endif /* KEEP_STD_CURSORS */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5218 |
RETURN ( __MKOBJ(newCursor) ); |
1127 | 5219 |
} |
5220 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5221 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5222 |
%} |
2232 | 5223 |
! |
5224 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5225 |
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
|
5226 |
|
2232 | 5227 |
%{ /* xxLIMITEDSTACK (WIN95) */ |
1127 | 5228 |
HCURSOR newCursor; |
5229 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5230 |
if (__isByteArray(src) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5231 |
&& __isByteArray(mask) |
1127 | 5232 |
&& __bothSmallInteger(hx, hy) |
5233 |
&& __bothSmallInteger(w, h)) { |
|
5234 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5235 |
newCursor = CreateCursor((HANDLE) __getHInstance(), |
1127 | 5236 |
__intVal(hx), __intVal(hy), |
5237 |
__intVal(w), __intVal(h), |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5238 |
__ByteArrayInstPtr(mask)->ba_element, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5239 |
__ByteArrayInstPtr(src)->ba_element); |
1127 | 5240 |
if (newCursor) { |
2232 | 5241 |
#ifdef COUNT_RESOURCES |
5242 |
__cnt_cur++; |
|
5243 |
RESPRINTF(("CreateCursor %d\n",__cnt_cur)); |
|
5244 |
#endif |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5245 |
RETURN ( __MKOBJ(newCursor)); |
1127 | 5246 |
} |
5247 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5248 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5249 |
%} |
2232 | 5250 |
! |
5251 |
||
1127 | 5252 |
shapeNumberFromSymbol:shape |
5253 |
"given a shape-symbol, return the corresponding cursor-number, |
|
5254 |
or nil if no such standard cursor exists." |
|
5255 |
||
5256 |
"this is pure Win-knowlegde - but you may easily add more" |
|
5257 |
||
5258 |
%{ /* NOCONTEXT */ |
|
2151 | 5259 |
if (shape == @symbol(upRightHand)) { |
5260 |
RETURN ( __MKSMALLINT( (INT)IDC_ARROW)); |
|
5261 |
} |
|
1127 | 5262 |
if (shape == @symbol(upLeftArrow)) { |
5263 |
RETURN ( __MKSMALLINT( (INT)IDC_ARROW)); |
|
5264 |
} |
|
5265 |
if (shape == @symbol(upDownArrow)) { |
|
5266 |
RETURN ( __MKSMALLINT( (INT)IDC_SIZENS)); |
|
5267 |
} |
|
5268 |
if (shape == @symbol(leftRightArrow)) { |
|
5269 |
RETURN ( __MKSMALLINT( (INT)IDC_SIZEWE)); |
|
5270 |
} |
|
5271 |
if (shape == @symbol(text)) { |
|
5272 |
RETURN ( __MKSMALLINT( (INT)IDC_IBEAM)); |
|
5273 |
} |
|
5274 |
if (shape == @symbol(wait)) { |
|
5275 |
RETURN ( __MKSMALLINT( (INT)IDC_WAIT)); |
|
5276 |
} |
|
5277 |
if (shape == @symbol(crossHair)) { |
|
5278 |
RETURN ( __MKSMALLINT( (INT)IDC_CROSS)); |
|
5279 |
} |
|
5280 |
if (shape == @symbol(fourWay)) { |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5281 |
RETURN ( __MKSMALLINT( (INT)IDC_SIZEALL)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5282 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5283 |
if (shape == @symbol(execute)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5284 |
RETURN ( __MKSMALLINT( (INT)IDC_APPSTARTING)); |
1127 | 5285 |
} |
5286 |
%}. |
|
5287 |
"/ ('WINWORKSTATION: invalid cursorShape:' , shape printString) infoPrintNL. |
|
5288 |
^ nil |
|
2232 | 5289 |
! ! |
5290 |
||
5291 |
!WinWorkstation methodsFor:'drawing'! |
|
5292 |
||
1127 | 5293 |
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
|
5294 |
width:w height:h |
1127 | 5295 |
"do a bit-blt; copy bits from the rectangle defined by |
5296 |
srcX/srcY and w/h from the sourceId drawable to the rectangle |
|
5297 |
below dstX/dstY in the destId drawable. Trigger an error if any |
|
5298 |
argument is not integer." |
|
5299 |
||
2232 | 5300 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5301 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5302 |
struct gcData *gcData = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5303 |
struct gcData *srcGcData = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5304 |
HDC srcDC = (HDC)0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5305 |
HDC dstDC = (HDC)0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5306 |
|
2232 | 5307 |
if (__isExternalAddress(srcGCId)) |
5308 |
{ |
|
5309 |
srcGcData = _GCDATA(srcGCId); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5310 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5311 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5312 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5313 |
goto fail; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5314 |
} |
2232 | 5315 |
if (__isExternalAddress(dstGCId)) { |
5316 |
gcData = _GCDATA(dstGCId); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5317 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5318 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5319 |
{ |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
5320 |
goto fail; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
5321 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
5322 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
5323 |
if (__bothSmallInteger(w, h) |
1127 | 5324 |
&& __bothSmallInteger(srcX, srcY) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5325 |
&& __bothSmallInteger(dstX, dstY)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5326 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5327 |
int fun = BITBLT_COPY; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5328 |
if (srcGcData && gcData) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5329 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5330 |
fun = gcData->bitbltrop2; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5331 |
#if 0 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5332 |
switch (fun) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5333 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5334 |
case BITBLT_COPY: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5335 |
printf("BITBLT_COPY\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5336 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5337 |
case BITBLT_COPYINVERTED: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5338 |
printf("BITBLT_COPYINVERTED\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5339 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5340 |
case BITBLT_XOR: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5341 |
printf("BITBLT_XOR\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5342 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5343 |
case BITBLT_AND: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5344 |
printf("BITBLT_AND\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5345 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5346 |
case BITBLT_OR: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5347 |
printf("BITBLT_OR\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5348 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5349 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5350 |
#endif |
2244 | 5351 |
if (srcGcData->hWnd && ((srcGcData->hWnd == gcData->hWnd) && (fun == BITBLT_COPY))) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5352 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5353 |
RECT rec,uprec; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5354 |
rec.left = __intVal(srcX); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5355 |
rec.top = __intVal(srcY); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5356 |
rec.right = rec.left + __intVal(w); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5357 |
rec.bottom = rec.top + __intVal(h); |
2232 | 5358 |
DPRINTF(("dst and src is HWND %x fun == BITBLT_COPY --> scrolling %d %d\n",srcGcData->hWnd,__intVal(dstX) - __intVal(srcX),__intVal(dstY) - __intVal(srcY))); |
5359 |
ScrollWindow(srcGcData->hWnd,__intVal(dstX) - __intVal(srcX),__intVal(dstY) - __intVal(srcY),&rec,0); |
|
5360 |
UpdateWindow(srcGcData->hWnd); |
|
5361 |
if (GetWindow_eventMask(srcGcData->hWnd) & ExposureMask) |
|
5362 |
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
|
5363 |
RETURN ( self ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5364 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5365 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5366 |
if (srcGcData->hWnd) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5367 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5368 |
/*printf("src is HWND %x\n",srcGcData->hWnd);*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5369 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5370 |
fun = gcData->bitbltrop2; |
2232 | 5371 |
if ((srcGcData == gcData) && (fun == BITBLT_COPY)) |
5372 |
{ |
|
5373 |
RECT rec,uprec; |
|
5374 |
rec.left = __intVal(srcX); |
|
5375 |
rec.top = __intVal(srcY); |
|
5376 |
rec.right = rec.left + __intVal(w); |
|
5377 |
rec.bottom = rec.top + __intVal(h); |
|
5378 |
srcDC = _getDC(srcGcData); |
|
5379 |
DPRINTF(("dst and src is DC %x fun == BITBLT_COPY --> scrolling %d %d\n",srcDC,__intVal(dstX) - __intVal(srcX),__intVal(dstY) - __intVal(srcY))); |
|
5380 |
ScrollDC(srcDC,__intVal(dstX) - __intVal(srcX),__intVal(dstY) - __intVal(srcY),&rec,0,0,&uprec); |
|
5381 |
_releaseDC(srcGcData); |
|
5382 |
RETURN ( self ); |
|
5383 |
||
5384 |
} |
|
5385 |
else |
|
2244 | 5386 |
{ |
5387 |
srcDC = _getDC(srcGcData); |
|
5388 |
dstDC = _getDC(gcData); |
|
5389 |
if (BitBlt(dstDC, |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5390 |
__intVal(dstX), __intVal(dstY), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5391 |
__intVal(w), __intVal(h), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5392 |
srcDC, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5393 |
__intVal(srcX), __intVal(srcY), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5394 |
fun) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5395 |
== 0 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5396 |
) |
2244 | 5397 |
{ |
5398 |
printf("ERROR in BitBlt\n"); |
|
5399 |
} |
|
5400 |
} |
|
5401 |
_releaseDC(gcData); |
|
5402 |
_releaseDC(srcGcData); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5403 |
RETURN ( self ); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
5404 |
} |
1127 | 5405 |
} |
1685 | 5406 |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
5407 |
fail: ; |
1127 | 5408 |
%}. |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5409 |
^ nil |
2232 | 5410 |
|
5411 |
! |
|
5412 |
||
1127 | 5413 |
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
|
5414 |
width:w height:h |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5415 |
"do a bit-blt, but only copy the low-bit plane; |
1127 | 5416 |
copy bits from the rectangle defined by |
5417 |
srcX/srcY and w/h from the sourceId drawable to the rectangle |
|
5418 |
below dstX/dstY in the destId drawable. Trigger an error if any |
|
5419 |
argument is not integer." |
|
5420 |
||
5421 |
^ self |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5422 |
copyFromId:sourceId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5423 |
x:srcX y:srcY gc:srcDCId |
1127 | 5424 |
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
|
5425 |
width:w height:h |
2232 | 5426 |
! |
5427 |
||
1127 | 5428 |
displayArcX:x y:y width:width height:height from:startAngle angle:angle in:aDrawableId with:aGCId |
5429 |
"draw an arc. If any of x,y, w or h is not an integer, an error is triggered. |
|
5430 |
The angles may be floats or integer - they are given in degrees." |
|
5431 |
||
2232 | 5432 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5433 |
int __x, __y, w, h; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5434 |
float angle1, angle2; |
1127 | 5435 |
double f; |
5436 |
||
5437 |
if (__isSmallInteger(startAngle)) |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5438 |
angle1 = (float)(__intVal(startAngle)); |
1127 | 5439 |
else if (__isFloat(startAngle)) { |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5440 |
angle1 = __floatVal(startAngle); |
1127 | 5441 |
} |
5442 |
if (__isSmallInteger(angle)) |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5443 |
angle2 = (float)(__intVal(angle)); |
1127 | 5444 |
else if (__isFloat(angle)) { |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5445 |
angle2 = __floatVal(angle); |
1127 | 5446 |
} |
5447 |
if (__isExternalAddress(aGCId) |
|
5448 |
&& __isExternalAddress(aDrawableId) |
|
5449 |
&& __bothSmallInteger(x, y) |
|
2232 | 5450 |
&& __bothSmallInteger(width, height)) |
5451 |
{ |
|
1127 | 5452 |
struct gcData *gcData = _GCDATA(aGCId); |
5453 |
HDC hDC; |
|
1725 | 5454 |
POINT p; |
2244 | 5455 |
HPEN hPen; |
1127 | 5456 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5457 |
w = __intVal(width); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5458 |
h = __intVal(height); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5459 |
__x = __intVal(x); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5460 |
__y = __intVal(y); |
1127 | 5461 |
|
2232 | 5462 |
hDC = _getDC(gcData); |
5463 |
||
5464 |
if (!(hPen = GcDataGetPen(hDC,gcData))) { |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5465 |
DPRINTF(("displayArc: no pen\n")); |
2232 | 5466 |
} |
5467 |
else |
|
5468 |
{ |
|
5469 |
double xB, yB, xE, yE, xR, yR; |
|
2244 | 5470 |
HPEN hSavePen = SelectObject(hDC, hPen); |
2232 | 5471 |
xR = w / 2; |
5472 |
yR = h / 2; |
|
5473 |
if (angle2 - angle1 >= 360) |
|
5474 |
{ |
|
5475 |
xB = xE = __x + xR + 0.5; |
|
5476 |
yB = yE = __y /*+ yR + 0.5*/; |
|
5477 |
} |
|
5478 |
else |
|
5479 |
{ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5480 |
double sin(), cos(); |
2232 | 5481 |
if (angle1 <= 180) |
5482 |
angle1 = 180 - angle1; |
|
5483 |
else |
|
5484 |
angle1 = 360 + 180 - angle1; |
|
5485 |
angle2 = angle1 - angle2; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5486 |
/* sigh - compute the intersections ... */ |
2232 | 5487 |
xB = (cos((angle1 * 3.14159265359) / 180.0)*xR); |
5488 |
yB = (sin((angle1 * 3.14159265359) / 180.0)*yR); |
|
5489 |
xE = (cos((angle2 * 3.14159265359) / 180.0)*xR); |
|
5490 |
yE = (sin((angle2 * 3.14159265359) / 180.0)*yR); |
|
5491 |
xB = __x + xR - xB+0.5; |
|
5492 |
yB = __y + yR - yB+0.5; |
|
5493 |
xE = __x + xR - xE+0.5; |
|
5494 |
yE = __y + yR - yE+0.5; |
|
5495 |
} |
|
5496 |
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
|
5497 |
Arc(hDC, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5498 |
__x, __y, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5499 |
__x + w, __y + h, |
2232 | 5500 |
(int)xB, (int)yB, |
5501 |
(int)xE, (int)yE); |
|
5502 |
||
2244 | 5503 |
SelectObject(hDC,hSavePen); |
5504 |
DelObject(hPen); |
|
2232 | 5505 |
} |
5506 |
_releaseDC(gcData); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5507 |
RETURN ( self ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5508 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5509 |
%} |
2232 | 5510 |
! |
5511 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5512 |
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
|
5513 |
"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
|
5514 |
|
2232 | 5515 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5516 |
if (__isExternalAddress(aGCId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5517 |
/*&& __isExternalAddress(aDrawableId)*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5518 |
&& __bothSmallInteger(x0, y0) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5519 |
&& __bothSmallInteger(x1, y1)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5520 |
struct gcData *gcData = _GCDATA(aGCId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5521 |
int __x1 = __intVal(x1), __y1 = __intVal(y1); |
2244 | 5522 |
HPEN hPen; |
2232 | 5523 |
HDC hDC = _getDC(gcData); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5524 |
/* 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
|
5525 |
__intVal(x0), __intVal(y0), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5526 |
__x1, __y1,_HWNDVal(aDrawableId))); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5527 |
*/ |
2232 | 5528 |
if (!(hPen = GcDataGetPen(hDC,gcData))) { |
1127 | 5529 |
DPRINTF(("displayLine: no pen\n")); |
5530 |
} else { |
|
2244 | 5531 |
HPEN hSavePen = SelectObject(hDC, hPen); |
2232 | 5532 |
MoveToEx(hDC, __intVal(x0), __intVal(y0), NULL); |
5533 |
||
5534 |
LineTo(hDC, __x1, __y1); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5535 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5536 |
* end-point ... |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5537 |
*/ |
2232 | 5538 |
LineTo(hDC, __x1+1, __y1); |
2244 | 5539 |
SelectObject(hDC,hSavePen); |
5540 |
DelObject(hPen); |
|
2232 | 5541 |
} |
5542 |
_releaseDC(gcData); |
|
1127 | 5543 |
RETURN ( self ); |
5544 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5545 |
%} |
2232 | 5546 |
! |
5547 |
||
1725 | 5548 |
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
|
5549 |
"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
|
5550 |
|
2232 | 5551 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 5552 |
if (__isExternalAddress(aGCId) |
5553 |
&& __isExternalAddress(aDrawableId) |
|
1725 | 5554 |
&& __bothSmallInteger(px, py)) { |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
5555 |
struct gcData *gcData = _GCDATA(aGCId); |
2232 | 5556 |
HDC hDC; |
1725 | 5557 |
POINT p; |
2244 | 5558 |
HPEN hPen; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5559 |
int __x = __intVal(px), __y = __intVal(py); |
2232 | 5560 |
hDC = _getDC(gcData); |
5561 |
||
5562 |
if (!(hPen = GcDataGetPen(hDC,gcData))) { |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5563 |
DPRINTF(("displayPoint: no pen\n")); |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
5564 |
} else { |
2244 | 5565 |
HPEN hSavePen = SelectObject(hDC, hPen); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5566 |
MoveToEx(hDC, __x, __y, NULL); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5567 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5568 |
* end-point ... |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5569 |
*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5570 |
LineTo(hDC, __x+1, __y); |
2244 | 5571 |
SelectObject(hDC,hSavePen); |
5572 |
DelObject(hPen); |
|
2232 | 5573 |
} |
5574 |
_releaseDC(gcData); |
|
1127 | 5575 |
RETURN ( self ); |
5576 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5577 |
%} |
2232 | 5578 |
! |
5579 |
||
1127 | 5580 |
displayPolygon:aPolygon in:aDrawableId with:aGCId |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5581 |
"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
|
5582 |
which define the polygon. |
1127 | 5583 |
If any coordinate is not integer, an error is triggered." |
5584 |
||
2232 | 5585 |
|numberOfPoints | |
1127 | 5586 |
|
5587 |
numberOfPoints := aPolygon size. |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5588 |
self |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5589 |
primDisplayPolygon:aPolygon n:numberOfPoints |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5590 |
in:aDrawableId with:aGCId |
2232 | 5591 |
! |
5592 |
||
1127 | 5593 |
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
|
5594 |
"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
|
5595 |
|
2232 | 5596 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 5597 |
int w, h; |
5598 |
int xL, yT; |
|
5599 |
if (__isExternalAddress(aGCId) |
|
5600 |
&& __isExternalAddress(aDrawableId) |
|
5601 |
&& __bothSmallInteger(x, y) |
|
5602 |
&& __bothSmallInteger(width, height)) { |
|
5603 |
struct gcData *gcData = _GCDATA(aGCId); |
|
2232 | 5604 |
HDC hDC = _getDC(gcData); |
2244 | 5605 |
HPEN hPen; |
1127 | 5606 |
|
5607 |
xL = __intVal(x); |
|
5608 |
yT = __intVal(y); |
|
5609 |
w = __intVal(width); |
|
5610 |
h = __intVal(height); |
|
5611 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5612 |
DPRINTF(("displayRectangle: %d/%d -> %d/%d\n", |
1127 | 5613 |
xL, yT, w, h)); |
5614 |
/* |
|
5615 |
* need this check here: some servers simply dump core with bad args |
|
5616 |
*/ |
|
5617 |
if ((w >= 0) && (h >= 0)) { |
|
2232 | 5618 |
if (!(hPen = GcDataGetPen(hDC,gcData))) { |
1127 | 5619 |
DPRINTF(("displayRect: no pen\n")); |
5620 |
} else { |
|
2244 | 5621 |
HPEN hSavePen = SelectObject(hDC, hPen); |
1127 | 5622 |
MoveToEx(hDC, xL, yT, NULL); |
5623 |
LineTo(hDC, xL+w-1, yT); |
|
5624 |
LineTo(hDC, xL+w-1, yT+h-1); |
|
5625 |
LineTo(hDC, xL, yT+h-1); |
|
5626 |
LineTo(hDC, xL, yT); |
|
2244 | 5627 |
SelectObject(hDC,hSavePen); |
5628 |
DelObject(hPen); |
|
2232 | 5629 |
} |
5630 |
} |
|
5631 |
_releaseDC(gcData); |
|
1127 | 5632 |
RETURN ( self ); |
5633 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5634 |
%} |
2232 | 5635 |
! |
5636 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5637 |
displayString:aString from:index1 to:index2 x:x y:y in:aDrawableId with:aGCId opaque:opaque |
1127 | 5638 |
"draw a sub-string - if opaque is false, draw foreground only; otherwise, draw both |
5639 |
foreground and background characters. |
|
5640 |
If the coordinates are not integers, an error is triggered." |
|
5641 |
||
2232 | 5642 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 5643 |
unsigned char *cp; |
5644 |
OBJ cls; |
|
5645 |
int i1, i2, l, n; |
|
5646 |
# define NLOCALBUFFER 200 |
|
5647 |
short xlatebuffer[NLOCALBUFFER]; |
|
5648 |
int nInstBytes; |
|
5649 |
||
5650 |
if (__isExternalAddress(aGCId) |
|
5651 |
&& __isExternalAddress(aDrawableId) |
|
5652 |
&& __isNonNilObject(aString) |
|
5653 |
&& __bothSmallInteger(index1, index2) |
|
2232 | 5654 |
&& __bothSmallInteger(x, y)) |
5655 |
{ |
|
1127 | 5656 |
struct gcData *gcData = _GCDATA(aGCId); |
5657 |
int pX, pY; |
|
2232 | 5658 |
HDC hDC = _getDC(gcData); |
5659 |
HFONT hOldFont; |
|
1127 | 5660 |
pX = __intVal(x); |
5661 |
pY = __intVal(y); |
|
5662 |
pY -= gcData->fontAscent; |
|
5663 |
||
5664 |
cls = __qClass(aString); |
|
5665 |
||
5666 |
i1 = __intVal(index1) - 1; |
|
5667 |
if (i1 >= 0) { |
|
5668 |
i2 = __intVal(index2) - 1; |
|
5669 |
if (i2 < i1) { |
|
2232 | 5670 |
goto ret; |
1127 | 5671 |
} |
5672 |
||
5673 |
cp = _stringVal(aString); |
|
5674 |
l = i2 - i1 + 1; |
|
5675 |
||
2232 | 5676 |
if ((cls == @global(String)) || (cls == @global(Symbol))) |
5677 |
{ |
|
1127 | 5678 |
n = _stringSize(aString); |
2232 | 5679 |
if (i2 < n) |
5680 |
{ |
|
1127 | 5681 |
cp += i1; |
2253 | 5682 |
DDPRINTF(("string1: %s pos=%d/%d l=%d hDC=%x hWnd=%x\n", cp, pX, pY,l,hDC,_HWNDVal(aDrawableId))); |
1127 | 5683 |
if (opaque == true) { |
5684 |
SetBkMode(hDC, OPAQUE); |
|
5685 |
} else { |
|
5686 |
SetBkMode(hDC, TRANSPARENT); |
|
5687 |
} |
|
2232 | 5688 |
hOldFont = SelectObject(hDC, gcData->hFont); |
5689 |
SetTextColor(hDC, gcData->fgColor); |
|
5690 |
SetBkColor(hDC, gcData->bgColor); |
|
5691 |
||
5692 |
if (!TextOut(hDC, pX, pY, (char *)cp, l)) |
|
5693 |
{ |
|
5694 |
PRINTF(("Textout failed. %d\n",GetLastError())); |
|
5695 |
} |
|
5696 |
SelectObject(hDC, hOldFont); |
|
5697 |
goto ret; |
|
1127 | 5698 |
} |
5699 |
} |
|
5700 |
||
5701 |
nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars)); |
|
5702 |
cp += nInstBytes; |
|
5703 |
||
2232 | 5704 |
if (__isBytes(aString)) |
5705 |
{ |
|
1127 | 5706 |
n = __byteArraySize(aString) - nInstBytes - 1; |
5707 |
||
2232 | 5708 |
if (i2 < n) |
5709 |
{ |
|
1127 | 5710 |
cp += i1; |
2253 | 5711 |
DDPRINTF(("string: %s pos=%d/%d\n", cp, pX, pY)); |
1127 | 5712 |
if (opaque == true) { |
5713 |
SetBkMode(hDC, OPAQUE); |
|
5714 |
} else { |
|
5715 |
SetBkMode(hDC, TRANSPARENT); |
|
5716 |
} |
|
2232 | 5717 |
hOldFont = SelectObject(hDC, gcData->hFont); |
5718 |
SetTextColor(hDC, gcData->fgColor); |
|
5719 |
SetBkColor(hDC, gcData->bgColor); |
|
1127 | 5720 |
TextOut(hDC, pX, pY, (char *)cp, l); |
2232 | 5721 |
SelectObject(hDC, hOldFont); |
5722 |
goto ret; |
|
1127 | 5723 |
} |
5724 |
} |
|
5725 |
||
5726 |
#ifdef NOTDEF |
|
5727 |
/* TWOBYTESTRINGS */ |
|
5728 |
if (__isWords(aString)) { |
|
5729 |
n = (__byteArraySize(aString) - nInstBytes) / 2; |
|
5730 |
||
5731 |
if (i2 < n) { |
|
5732 |
union { |
|
5733 |
char b[2]; |
|
5734 |
unsigned short s; |
|
5735 |
} u; |
|
5736 |
int i; |
|
5737 |
XChar2b *cp2 = (XChar2b *)0; |
|
5738 |
int mustFree = 0; |
|
5739 |
||
5740 |
cp += (i1 * 2); |
|
5741 |
if (l > 1000) l = 1000; |
|
5742 |
||
5743 |
/* |
|
5744 |
* ST/X TwoByteStrings store the asciiValue in native byteOrder; |
|
5745 |
* X expects them MSB first |
|
5746 |
* convert as required |
|
5747 |
*/ |
|
5748 |
||
5749 |
u.s = 0x1234; |
|
5750 |
if (u.b[0] != 0x12) { |
|
5751 |
if (l <= NLOCALBUFFER) { |
|
5752 |
cp2 = xlatebuffer; |
|
5753 |
} else { |
|
5754 |
cp2 = (XChar2b *)(malloc(l * 2)); |
|
5755 |
mustFree = 1; |
|
5756 |
} |
|
5757 |
for (i=0; i<l; i++) { |
|
5758 |
cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2; |
|
5759 |
cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1; |
|
5760 |
} |
|
5761 |
cp = (char *) cp2; |
|
5762 |
} |
|
5763 |
||
5764 |
if (opaque == true) |
|
5765 |
XDrawImageString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l); |
|
5766 |
else |
|
5767 |
XDrawString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l); |
|
5768 |
||
5769 |
if (mustFree) { |
|
5770 |
free(cp2); |
|
5771 |
} |
|
5772 |
||
2232 | 5773 |
goto ret; |
1127 | 5774 |
} |
5775 |
} |
|
5776 |
#endif |
|
5777 |
} |
|
2232 | 5778 |
ret: |
5779 |
_releaseDC(gcData); |
|
1127 | 5780 |
} |
5781 |
#undef NLOCALBUFFER |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5782 |
%} |
2232 | 5783 |
! |
5784 |
||
2151 | 5785 |
drawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd |
5786 |
width:imageWidth height:imageHeight |
|
1127 | 5787 |
x:srcx y:srcy |
2151 | 5788 |
into:aDrawableId |
5789 |
x:dstx y:dsty |
|
5790 |
width:w height:h |
|
1127 | 5791 |
with:aGCId |
5792 |
||
5793 |
"draw a bitImage which has depth id, width iw and height ih into |
|
5794 |
the drawable. draw a region of w/h pixels from srcx/srcy to dstx/dsty. |
|
5795 |
Individual source pixels have bitsPerPixel bits, allowing to draw |
|
5796 |
depth and pixel-units to be different. |
|
5797 |
It has to be checked elsewhere, that the server can do it with the given |
|
5798 |
depth - otherwise, primitive failure will be signalled. |
|
5799 |
Also it is assumed, that the colormap is setup correctly and the |
|
5800 |
colors are allocated - otherwise the colors may be wrong." |
|
5801 |
||
5802 |
" |
|
5803 |
sorry; I had to separate it into 2 methods, since XPutImage needs |
|
5804 |
an unlimited stack, and thus cannot send primitiveFailed |
|
5805 |
" |
|
2151 | 5806 |
(self primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd |
5807 |
width:imageWidth height:imageHeight |
|
5808 |
x:srcx y:srcy |
|
5809 |
into:aDrawableId |
|
5810 |
x:dstx y:dsty |
|
5811 |
width:w height:h |
|
5812 |
with:aGCId) |
|
1127 | 5813 |
ifFalse:[ |
5814 |
" |
|
2151 | 5815 |
also happens, if a segmentation violation occurs in the |
1127 | 5816 |
XPutImage ... |
5817 |
" |
|
5818 |
self primitiveFailed |
|
5819 |
]. |
|
2232 | 5820 |
! |
5821 |
||
1127 | 5822 |
fillArcX:x y:y width:width height:height from:startAngle angle:angle |
5823 |
in:aDrawableId with:aGCId |
|
5824 |
"fill an arc. If any coordinate is not integer, an error is triggered. |
|
5825 |
The angles may be floats or integer - they are given in degrees." |
|
5826 |
||
2232 | 5827 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
5828 |
||
5829 |
int __x, __y, w, h; |
|
5830 |
float angle1, angle2; |
|
1127 | 5831 |
|
5832 |
if (__isSmallInteger(startAngle)) |
|
2232 | 5833 |
angle1 = (float)(__intVal(startAngle)); |
1127 | 5834 |
else if (__isFloat(startAngle)) { |
2232 | 5835 |
angle1 = __floatVal(startAngle); |
1127 | 5836 |
} |
5837 |
if (__isSmallInteger(angle)) |
|
2232 | 5838 |
angle2 = (float)(__intVal(angle)); |
1127 | 5839 |
else if (__isFloat(angle)) { |
2232 | 5840 |
angle2 = __floatVal(angle); |
1127 | 5841 |
} |
5842 |
if (__isExternalAddress(aGCId) |
|
5843 |
&& __isExternalAddress(aDrawableId) |
|
5844 |
&& __bothSmallInteger(x, y) |
|
2232 | 5845 |
&& __bothSmallInteger(width, height)) |
5846 |
{ |
|
5847 |
struct gcData *gcData = _GCDATA(aGCId); |
|
5848 |
HDC hDC; |
|
5849 |
HBRUSH hBrush; |
|
5850 |
||
1127 | 5851 |
w = __intVal(width); |
5852 |
h = __intVal(height); |
|
2232 | 5853 |
__x = __intVal(x); |
5854 |
__y = __intVal(y); |
|
5855 |
||
5856 |
hDC = _getDC(gcData); |
|
5857 |
||
5858 |
if (!(hBrush = GcDataGetBrush(hDC,gcData))) { |
|
5859 |
DPRINTF(("fillArc: no brush\n")); |
|
5860 |
} |
|
5861 |
else |
|
5862 |
{ |
|
2244 | 5863 |
HBRUSH hSaveBrush = SelectObject(hDC, hBrush); |
5864 |
HPEN hPen = 0; |
|
5865 |
HPEN hSavePen; |
|
2232 | 5866 |
if (__isWinNT) |
5867 |
{ |
|
5868 |
if (!(hPen = GcDataGetPen(hDC,gcData))) |
|
5869 |
{ |
|
5870 |
DPRINTF(("displayArc: no pen\n")); |
|
5871 |
goto failpen; |
|
5872 |
} |
|
2244 | 5873 |
hSavePen = SelectObject(hDC, hPen); |
2232 | 5874 |
} |
5875 |
else |
|
5876 |
{ |
|
5877 |
SelectObject(hDC,GetStockObject(NULL_PEN)); |
|
5878 |
w++; |
|
5879 |
h++; |
|
5880 |
} |
|
5881 |
{ |
|
5882 |
double xB, yB, xE, yE, xR, yR; |
|
5883 |
xR = w / 2; |
|
5884 |
yR = h / 2; |
|
5885 |
if (angle2 - angle1 >= 360) |
|
5886 |
{ |
|
5887 |
xB = xE = __x + xR + 0.5; |
|
5888 |
yB = yE = __y /*+ yR + 0.5*/; |
|
5889 |
} |
|
5890 |
else |
|
5891 |
{ |
|
5892 |
double sin(), cos(); |
|
5893 |
if (angle1 <= 180) |
|
5894 |
angle1 = 180 - angle1; |
|
5895 |
else |
|
5896 |
angle1 = 360 + 180 - angle1; |
|
5897 |
angle2 = angle1 - angle2; |
|
5898 |
/* sigh - compute the intersections ... */ |
|
5899 |
xB = (cos((angle1 * 3.14159265359) / 180.0)*xR); |
|
5900 |
yB = (sin((angle1 * 3.14159265359) / 180.0)*yR); |
|
5901 |
xE = (cos((angle2 * 3.14159265359) / 180.0)*xR); |
|
5902 |
yE = (sin((angle2 * 3.14159265359) / 180.0)*yR); |
|
5903 |
xB = __x + xR - xB+0.5; |
|
5904 |
yB = __y + yR - yB+0.5; |
|
5905 |
xE = __x + xR - xE+0.5; |
|
5906 |
yE = __y + yR - yE+0.5; |
|
5907 |
} |
|
5908 |
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)); |
|
5909 |
||
5910 |
Pie(hDC, |
|
5911 |
__x, __y, |
|
5912 |
__x + w, __y + h, |
|
5913 |
(int)xB, (int)yB, |
|
5914 |
(int)xE, (int)yE); |
|
5915 |
||
5916 |
if (hPen) { |
|
2244 | 5917 |
SelectObject(hDC,hSavePen); |
5918 |
DelObject(hPen); |
|
2232 | 5919 |
} |
5920 |
} |
|
5921 |
failpen: |
|
2244 | 5922 |
SelectObject(hDC,hSaveBrush); |
5923 |
DelObject(hBrush); |
|
2232 | 5924 |
} |
5925 |
_releaseDC(gcData); |
|
1127 | 5926 |
RETURN ( self ); |
5927 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5928 |
%} |
2232 | 5929 |
! |
5930 |
||
1127 | 5931 |
fillPolygon:aPolygon in:aDrawableId with:aGCId |
2232 | 5932 |
"fill a polygon given by its points. |
1127 | 5933 |
If any coordinate is not integer, an error is triggered." |
5934 |
||
5935 |
|numberOfPoints| |
|
5936 |
||
5937 |
numberOfPoints := aPolygon size. |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5938 |
self |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5939 |
primFillPolygon:aPolygon n:numberOfPoints |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5940 |
in:aDrawableId with:aGCId |
2232 | 5941 |
! |
5942 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5943 |
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
|
5944 |
"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
|
5945 |
|
2232 | 5946 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5947 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5948 |
int w, h; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5949 |
if (__isExternalAddress(aGCId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5950 |
&& __isExternalAddress(aDrawableId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5951 |
&& __bothSmallInteger(x, y) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5952 |
&& __bothSmallInteger(width, height)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5953 |
w = __intVal(width); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5954 |
h = __intVal(height); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5955 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5956 |
/*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
|
5957 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5958 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5959 |
* 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
|
5960 |
*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5961 |
if ((w >= 0) && (h >= 0)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5962 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5963 |
struct gcData *gcData = _GCDATA(aGCId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5964 |
HDC hDC; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5965 |
HBRUSH hBrush; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5966 |
RECT rct; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5967 |
|
2232 | 5968 |
hDC = _getDC(gcData); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5969 |
hBrush = GcDataGetBrush(hDC,gcData); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5970 |
if (! hBrush) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5971 |
{ |
2232 | 5972 |
PRINTF(("fillRectangle: no brush\n")); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5973 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5974 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5975 |
{ |
2244 | 5976 |
HBRUSH hSaveBrush = SelectObject(hDC, hBrush); |
2232 | 5977 |
rct.left = __intVal(x); |
5978 |
rct.top = __intVal(y); |
|
5979 |
rct.right = rct.left + w + 1; |
|
5980 |
rct.bottom = rct.top + h + 1; |
|
5981 |
||
5982 |
DPRINTF(("fillRectangle:%d.%d -> %d.%d\n",rct.left,rct.top,rct.right,rct.bottom)); |
|
5983 |
SelectObject(hDC, GetStockObject(NULL_PEN)); |
|
5984 |
Rectangle(hDC,rct.left,rct.top,rct.right,rct.bottom); |
|
2244 | 5985 |
SelectObject(hDC,hSaveBrush); |
5986 |
DelObject(hBrush); |
|
2232 | 5987 |
} |
5988 |
_releaseDC(gcData); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5989 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5990 |
RETURN ( self ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5991 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5992 |
%} |
2232 | 5993 |
! |
5994 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5995 |
primDisplayPolygon:aPolygon n:numberOfPoints in:aDrawableId with:aGCId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
5996 |
|
2232 | 5997 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1725 | 5998 |
OBJ point, px, py; |
1127 | 5999 |
int i, num; |
6000 |
||
6001 |
if (__isExternalAddress(aGCId) |
|
6002 |
&& __isExternalAddress(aDrawableId) |
|
6003 |
&& __isSmallInteger(numberOfPoints)) { |
|
1725 | 6004 |
struct gcData *gcData = _GCDATA(aGCId); |
2232 | 6005 |
HDC hDC = _getDC(gcData); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6006 |
POINT p; |
2244 | 6007 |
HPEN hPen; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6008 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6009 |
num = __intVal(numberOfPoints); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6010 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6011 |
for (i=0; i<num; i++) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6012 |
point = __AT_(aPolygon, __MKSMALLINT(i+1)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6013 |
if (! __isPoint(point)) goto fail; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6014 |
px = _point_X(point); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6015 |
py = _point_Y(point); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6016 |
if (! __bothSmallInteger(px, py)) |
2232 | 6017 |
{ |
6018 |
_releaseDC(gcData); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6019 |
goto fail; |
2232 | 6020 |
} |
6021 |
} |
|
6022 |
if (!(hPen = GcDataGetPen(hDC,gcData))) { |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6023 |
DPRINTF(("displayPolygon: no pen\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6024 |
} else { |
2244 | 6025 |
HPEN hSavePen = SelectObject(hDC, hPen); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6026 |
for (i=0; i<num; i++) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6027 |
point = __AT_(aPolygon, __MKSMALLINT(i+1)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6028 |
px = _point_X(point); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6029 |
py = _point_Y(point); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6030 |
if (i == 0) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6031 |
MoveToEx(hDC, __intVal(px), __intVal(py), NULL); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6032 |
} else { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6033 |
p.x = __intVal(px); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6034 |
p.y = __intVal(py); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6035 |
if (i == (num-1)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6036 |
PolylineTo(hDC, &p, 1); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6037 |
} else { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6038 |
LineTo(hDC, p.x, p.y); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6039 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6040 |
* end-point ... |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6041 |
*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6042 |
LineTo(hDC, p.x+1, p.y); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6043 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6044 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6045 |
} |
2244 | 6046 |
SelectObject(hDC,hSavePen); |
6047 |
DelObject(hPen); |
|
2232 | 6048 |
} |
6049 |
||
6050 |
_releaseDC(gcData); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6051 |
RETURN ( self ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6052 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6053 |
fail: ; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6054 |
%} |
2232 | 6055 |
! |
6056 |
||
2151 | 6057 |
primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd |
6058 |
width:imageWidth height:imageHeight |
|
6059 |
x:srcx y:srcy |
|
6060 |
into:aDrawableId |
|
6061 |
x:dstx y:dsty |
|
6062 |
width:w height:h |
|
6063 |
with:aGCId |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6064 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6065 |
"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
|
6066 |
(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
|
6067 |
|
2232 | 6068 |
%{ /* xxLIMITEDSTACK */ |
2151 | 6069 |
unsigned char fastBits[10000]; |
6070 |
unsigned char *b_bits = 0; |
|
6071 |
unsigned char *allocatedBits = 0; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6072 |
struct gcData *gcData = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6073 |
HDC hDC = (HDC)0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6074 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6075 |
if (ISCONNECTED |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6076 |
&& __isExternalAddress(aGCId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6077 |
&& __isExternalAddress(aDrawableId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6078 |
&& __bothSmallInteger(srcx, srcy) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6079 |
&& __bothSmallInteger(dstx, dsty) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6080 |
&& __bothSmallInteger(w, h) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6081 |
&& __bothSmallInteger(imageWidth, imageHeight) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6082 |
&& __bothSmallInteger(imageDepth, bitsPerPixel) |
2151 | 6083 |
&& __isSmallInteger(padd) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6084 |
&& __isByteArray(imageBits)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6085 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6086 |
struct |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6087 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6088 |
BITMAPINFOHEADER bmiHeader; |
2151 | 6089 |
DWORD r; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6090 |
DWORD g; |
2151 | 6091 |
DWORD b; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6092 |
} bitmap; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6093 |
gcData = _GCDATA(aGCId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6094 |
if (! gcData ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6095 |
goto fail; |
2232 | 6096 |
hDC = _getDC(gcData); |
6097 |
DDPRINTF(("hDC = %x\n", hDC)); |
|
2151 | 6098 |
|
6099 |
if (__intVal(padd) != WIN32PADDING) |
|
6100 |
{ |
|
6101 |
int row, col; |
|
6102 |
unsigned char *cp; |
|
6103 |
unsigned char *pBits; |
|
6104 |
int b_width, b_height, bytesPerRowST, bytesPerRowWN, padding, nBytes; |
|
6105 |
int bi = __intVal(bitsPerPixel); |
|
6106 |
b_width = __intVal(w); |
|
6107 |
b_height = __intVal(h); |
|
6108 |
bytesPerRowST = (b_width * bi + (__intVal(padd)-1)) / __intVal(padd); |
|
6109 |
bytesPerRowWN = (b_width * bi + (WIN32PADDING-1)) / WIN32PADDING * (WIN32PADDING/8); |
|
6110 |
padding = bytesPerRowWN - bytesPerRowST; |
|
6111 |
nBytes = b_height * bytesPerRowWN; |
|
6112 |
/*printf("padd %d bs %d bw %d p %d\n",__intVal(padd),bytesPerRowST,bytesPerRowWN,padding);*/ |
|
6113 |
if (padding) |
|
6114 |
{ |
|
6115 |
if (nBytes < sizeof(fastBits)) |
|
6116 |
{ |
|
6117 |
cp = b_bits = fastBits; |
|
6118 |
} |
|
6119 |
else |
|
6120 |
{ |
|
6121 |
cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes); |
|
6122 |
} |
|
6123 |
if (cp) |
|
6124 |
{ |
|
6125 |
pBits = __ByteArrayInstPtr(imageBits)->ba_element; |
|
6126 |
for (row = b_height; row; row--) |
|
6127 |
{ |
|
6128 |
for (col = bytesPerRowST; col; col--) |
|
6129 |
{ |
|
6130 |
*cp++ = ( *pBits++ ); |
|
6131 |
} |
|
6132 |
cp += padding; |
|
6133 |
} |
|
6134 |
} |
|
2232 | 6135 |
else |
6136 |
goto fail; |
|
2151 | 6137 |
} |
6138 |
} |
|
6139 |
if (b_bits == 0) |
|
6140 |
{ |
|
6141 |
b_bits = __ByteArrayInstPtr(imageBits)->ba_element; |
|
6142 |
} |
|
6143 |
||
6144 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6145 |
bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6146 |
bitmap.bmiHeader.biPlanes = 1; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6147 |
if (__intVal(imageDepth) == 24) |
2151 | 6148 |
{ |
6149 |
/*bitmap.bmiHeader.biCompression = BI_BITFIELDS; |
|
6150 |
bitmap.r = 0xff0000; |
|
6151 |
bitmap.g = 0x00ff00; |
|
6152 |
bitmap.b = 0x0000ff;*/ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6153 |
bitmap.bmiHeader.biCompression = BI_RGB; |
2151 | 6154 |
} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6155 |
else if (__intVal(imageDepth) == 16) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6156 |
{ |
2232 | 6157 |
/*bitmap.bmiHeader.biCompression = BI_RGB; |
6158 |
bitmap.bmiHeader.biCompression = BI_BITFIELDS; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6159 |
bitmap.b = 0x001f; |
2232 | 6160 |
bitmap.g = 0x07e0; |
6161 |
bitmap.r = 0xf800;*/ |
|
6162 |
bitmap.b = 0; |
|
6163 |
bitmap.g = 0; |
|
6164 |
bitmap.r = 0; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6165 |
bitmap.bmiHeader.biCompression = BI_RGB; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6166 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6167 |
bitmap.bmiHeader.biSizeImage = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6168 |
bitmap.bmiHeader.biXPelsPerMeter = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6169 |
bitmap.bmiHeader.biYPelsPerMeter = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6170 |
bitmap.bmiHeader.biClrUsed = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6171 |
bitmap.bmiHeader.biClrImportant = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6172 |
bitmap.bmiHeader.biWidth = __intVal(imageWidth); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6173 |
bitmap.bmiHeader.biHeight = -(__intVal(imageHeight)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6174 |
bitmap.bmiHeader.biBitCount = __intVal(bitsPerPixel); |
2151 | 6175 |
/*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
|
6176 |
SetDIBitsToDevice(hDC,__intVal(dstx),__intVal(dsty), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6177 |
__intVal(w), __intVal(h), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6178 |
__intVal(srcx), __intVal(srcy), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6179 |
0,__intVal(h), |
2151 | 6180 |
(void *)b_bits, |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6181 |
(BITMAPINFO*)&bitmap,DIB_RGB_COLORS); |
2151 | 6182 |
if (allocatedBits) |
6183 |
{ |
|
6184 |
free(allocatedBits); |
|
6185 |
} |
|
2232 | 6186 |
_releaseDC(gcData); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6187 |
RETURN ( true ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6188 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6189 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6190 |
fail: ; |
2232 | 6191 |
PRINTF(("create temp bitmap FAILED!!!\n")); |
6192 |
if (allocatedBits) |
|
6193 |
{ |
|
6194 |
PRINTF(("freeing up temp bitmap bits ...\n")); |
|
6195 |
free(allocatedBits); |
|
6196 |
} |
|
6197 |
if (gcData && hDC) |
|
6198 |
_releaseDC(gcData); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6199 |
%} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6200 |
. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6201 |
^ false |
2232 | 6202 |
! |
6203 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6204 |
primFillPolygon:aPolygon n:numberOfPoints in:aDrawableId with:aGCId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6205 |
|
2232 | 6206 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6207 |
OBJ point, px, py; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6208 |
int i, num; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6209 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6210 |
if (__isExternalAddress(aGCId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6211 |
&& __isExternalAddress(aDrawableId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6212 |
&& __isSmallInteger(numberOfPoints)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6213 |
struct gcData *gcData = _GCDATA(aGCId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6214 |
HDC hDC; |
1725 | 6215 |
POINT p; |
2244 | 6216 |
HBRUSH hBrush; |
2232 | 6217 |
|
1127 | 6218 |
num = __intVal(numberOfPoints); |
6219 |
if (num < 3) { |
|
6220 |
RETURN ( self ); |
|
6221 |
} |
|
6222 |
for (i=0; i<num; i++) { |
|
6223 |
point = __AT_(aPolygon, __MKSMALLINT(i+1)); |
|
6224 |
if (! __isPoint(point)) goto fail; |
|
1725 | 6225 |
px = _point_X(point); |
6226 |
py = _point_Y(point); |
|
6227 |
if (! __bothSmallInteger(px, py)) |
|
1127 | 6228 |
goto fail; |
6229 |
} |
|
1725 | 6230 |
|
2232 | 6231 |
hDC = _getDC(gcData); |
6232 |
||
6233 |
if (!(hBrush = GcDataGetBrush(hDC,gcData))) { |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6234 |
DPRINTF(("fillPolygon: no brush\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6235 |
} else { |
2244 | 6236 |
HBRUSH hSaveBrush = SelectObject(hDC, hBrush); |
1725 | 6237 |
BeginPath(hDC); |
6238 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6239 |
for (i=0; i<num; i++) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6240 |
point = __AT_(aPolygon, __MKSMALLINT(i+1)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6241 |
px = _point_X(point); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6242 |
py = _point_Y(point); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6243 |
if (i == 0) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6244 |
MoveToEx(hDC, __intVal(px), __intVal(py), NULL); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6245 |
} else { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6246 |
if (i == (num-1)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6247 |
p.x = __intVal(px); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6248 |
p.y = __intVal(py); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6249 |
PolylineTo(hDC, &p, 1); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6250 |
} else { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6251 |
LineTo(hDC, __intVal(px), __intVal(py)); |
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 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6254 |
} |
1725 | 6255 |
|
6256 |
EndPath(hDC); |
|
6257 |
FillPath(hDC); |
|
2244 | 6258 |
SelectObject(hDC,hSaveBrush); |
6259 |
DelObject(hBrush); |
|
2232 | 6260 |
} |
6261 |
_releaseDC(gcData); |
|
1127 | 6262 |
RETURN ( self ); |
6263 |
||
6264 |
fail: ; |
|
6265 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6266 |
%} |
2232 | 6267 |
! ! |
6268 |
||
6269 |
!WinWorkstation methodsFor:'event handling'! |
|
6270 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6271 |
configEventProcessedFor:aWindowId |
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 |
if (__isExternalAddress(aWindowId)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6274 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6275 |
HWND hWnd = _HWNDVal(aWindowId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6276 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6277 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6278 |
%} |
2232 | 6279 |
! |
6280 |
||
1127 | 6281 |
dispatchEventFor:aViewIdOrNil withMask:eventMask |
6282 |
"central event handling method: |
|
6283 |
get next event and send appropriate message to the sensor or view. |
|
6284 |
If the argument aViewIdOrNil is nil, events for any view are processed, |
|
6285 |
otherwise only events for the view with given id are processed. |
|
6286 |
If the argument aMask is nonNil, only events for this eventMask are |
|
2232 | 6287 |
handled. |
6288 |
WARNING: this may block to wait for an event - you better check for a |
|
6289 |
pending event before calling this." |
|
6290 |
||
6291 |
(self getEventFor:aViewIdOrNil withMask:eventMask) ifTrue:[ |
|
6292 |
AbortSignal handle:[:ex | |
|
6293 |
ex return |
|
6294 |
] do:[ |
|
6295 |
self dispatchLastEvent. |
|
6296 |
] |
|
6297 |
]. |
|
6298 |
||
6299 |
"Modified: 19.8.1997 / 17:10:42 / cg" |
|
6300 |
! |
|
6301 |
||
1127 | 6302 |
dispatchExposeEventFor:aViewIdOrNil |
6303 |
"get next expose event and send appropriate message to the sensor or view. |
|
6304 |
If the argument aViewIdOrNil is nil, events for any view are processed, |
|
6305 |
otherwise only events for the view with given id are processed." |
|
6306 |
||
6307 |
self dispatchEventFor:aViewIdOrNil withMask:(self eventMaskFor:#expose) |
|
2232 | 6308 |
! |
6309 |
||
6310 |
dispatchLastEvent |
|
1127 | 6311 |
|theView symS arg butt sibling windowID siblingID propertyID selectionID targetID requestorID |
6312 |
eventType| |
|
6313 |
||
2232 | 6314 |
%{ /* xxSTACK: 8000 */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6315 |
struct queuedEvent *ev = 0; |
2232 | 6316 |
struct queuedEvent _ev_buf; |
1127 | 6317 |
struct inlineCache *ipS; |
6318 |
||
6319 |
static struct inlineCache vid = _ILC1; |
|
1723 | 6320 |
static struct inlineCache conf = _ILC5; |
6321 |
static struct inlineCache skp = _ILC4; |
|
6322 |
static struct inlineCache skr = _ILC4; |
|
6323 |
static struct inlineCache exp = _ILC5; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6324 |
static struct inlineCache gexpS = _ILC6; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6325 |
static struct inlineCache nexpS = _ILC1; |
1723 | 6326 |
static struct inlineCache clr = _ILC5; |
6327 |
static struct inlineCache bp = _ILC4; |
|
6328 |
static struct inlineCache br = _ILC4; |
|
6329 |
static struct inlineCache bmp = _ILC4; |
|
6330 |
static struct inlineCache bsp = _ILC4; |
|
6331 |
static struct inlineCache mot = _ILC4; |
|
6332 |
static struct inlineCache unmap = _ILC1; |
|
6333 |
static struct inlineCache map = _ILC1; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6334 |
static struct inlineCache termS = _ILC1; |
1723 | 6335 |
static struct inlineCache destr = _ILC1; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6336 |
static struct inlineCache setCurs = _ILC1; |
1723 | 6337 |
static struct inlineCache focOut = _ILC1; |
6338 |
static struct inlineCache focIn = _ILC1; |
|
6339 |
static struct inlineCache act = _ILC2; |
|
6340 |
static struct inlineCache pe = _ILC4; |
|
6341 |
static struct inlineCache pl = _ILC2; |
|
2232 | 6342 |
static struct inlineCache vis = _ILC1; |
1127 | 6343 |
|
6344 |
int x, y, w, h; |
|
6345 |
int keyCode, modifiers, isDoubleClick = 0; |
|
6346 |
int isDown = 1; |
|
6347 |
int state; |
|
6348 |
OBJ upDown; |
|
2232 | 6349 |
OBJ eB; |
1127 | 6350 |
char nameBuffer[100]; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6351 |
HWND hWnd = 0; |
1127 | 6352 |
DDPRINTF(("dispatchLast\n")); |
6353 |
||
2232 | 6354 |
eB = __INST(eventBuffer); |
6355 |
||
6356 |
if (__isByteArray(eB)) { |
|
6357 |
ev = (struct queuedEvent *)(__ByteArrayInstPtr(eB)->ba_element); |
|
6358 |
} else { |
|
6359 |
printf("DISPLAY: no eventBuffer\n"); |
|
6360 |
RETURN (false); |
|
6361 |
} |
|
6362 |
if (ev) |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6363 |
{ |
2232 | 6364 |
_ev_buf = *ev; |
6365 |
ev = &_ev_buf; |
|
1127 | 6366 |
} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6367 |
hWnd = ev->ev_hWnd; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6368 |
if (!(hWnd /*&& IsWindow(hWnd)*/)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6369 |
DPRINTF(("wrong hWnd in event in dispatchLastEvent\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6370 |
RETURN (false); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6371 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6372 |
{ |
1723 | 6373 |
OBJ t; |
6374 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6375 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6376 |
* 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
|
6377 |
* avoid creation & lookup then. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6378 |
*/ |
2232 | 6379 |
#if 1 |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6380 |
if ((t = __INST(lastId)) != nil) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6381 |
if (__isExternalAddress(t)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6382 |
if (_HWNDVal(t) == hWnd) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6383 |
theView = __INST(lastView); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6384 |
if (__isNonNilObject(theView)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6385 |
if (__qClass(theView) == nil) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6386 |
theView = nil; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6387 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6388 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6389 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6390 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6391 |
} |
2151 | 6392 |
#endif |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6393 |
if (theView == nil) { |
1723 | 6394 |
windowID = __MKOBJ(ev->ev_hWnd); |
6395 |
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
|
6396 |
} |
1127 | 6397 |
} |
6398 |
||
6399 |
if (theView == nil) { |
|
6400 |
DPRINTF(("nil view [hWnd=%x] in dispatchEvent\n", ev->ev_hWnd)); |
|
6401 |
||
6402 |
RETURN (false); |
|
6403 |
} |
|
6404 |
||
1723 | 6405 |
switch (ev->ev_message) { |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6406 |
#if 1 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6407 |
case WM_WINDOWPOSCHANGED: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6408 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6409 |
RECT rct; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6410 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6411 |
DPRINTF((">>> WM_WINDOWPOSCHANGED -> configureX:y:width:height:view:\n")); |
1723 | 6412 |
|
6413 |
x = ev->ev_x; |
|
6414 |
y = ev->ev_y; |
|
6415 |
w = ev->ev_w; |
|
6416 |
h = ev->ev_h; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6417 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6418 |
/*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
|
6419 |
|
1723 | 6420 |
(*conf.ilc_func)(self, |
6421 |
@symbol(configureX:y:width:height:view:), |
|
6422 |
nil, &conf, |
|
6423 |
__MKSMALLINT(x), |
|
6424 |
__MKSMALLINT(y), |
|
6425 |
__MKSMALLINT(w), |
|
6426 |
__MKSMALLINT(h), |
|
6427 |
theView); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6428 |
} |
1723 | 6429 |
break; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6430 |
#endif |
1127 | 6431 |
case WM_SHOWWINDOW: |
6432 |
if (ev->ev_wParam == TRUE) { |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6433 |
DPRINTF((">>> WM_SHOWWINDOW -> mappedView:\n")); |
2232 | 6434 |
arg = @symbol(unobscured); |
6435 |
(*vis.ilc_func)(theView, @symbol(visibilityChange:), nil, &vis, arg); |
|
1723 | 6436 |
(*map.ilc_func)(self, |
1127 | 6437 |
@symbol(mappedView:), |
1723 | 6438 |
nil, &map, theView); |
1127 | 6439 |
} else { |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6440 |
DPRINTF((">>> WM_SHOWWINDOW -> unMappedView:\n")); |
2232 | 6441 |
arg = @symbol(fullyObscured); |
6442 |
(*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
|
6443 |
(*unmap.ilc_func)(self, |
1127 | 6444 |
@symbol(unmappedView:), |
1723 | 6445 |
nil, &unmap, theView); |
1127 | 6446 |
} |
6447 |
break; |
|
6448 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6449 |
case WM_CLOSE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6450 |
(*termS.ilc_func)(self, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6451 |
@symbol(terminateView:), nil, &termS, theView); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6452 |
break; |
1127 | 6453 |
case WM_DESTROY: |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6454 |
DPRINTF((">>> WM_DESTROY -> destroyedView\n")); |
1723 | 6455 |
(*destr.ilc_func)(self, |
1127 | 6456 |
@symbol(destroyedView:), |
1723 | 6457 |
nil, &destr, theView); |
1127 | 6458 |
break; |
6459 |
||
6460 |
case WM_ACTIVATE: |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6461 |
DPRINTF((">>> WM_ACTIVATE h=%x\n", ev->ev_hWnd)); |
1723 | 6462 |
|
1127 | 6463 |
switch (LOWORD(ev->ev_wParam)) { |
6464 |
case WA_INACTIVE: |
|
1723 | 6465 |
(*act.ilc_func)(self, |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6466 |
@symbol(activate:view:), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6467 |
nil, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6468 |
&act, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6469 |
false, |
1723 | 6470 |
theView); |
1127 | 6471 |
break; |
1723 | 6472 |
|
1127 | 6473 |
case WA_ACTIVE: |
6474 |
case WA_CLICKACTIVE: |
|
1723 | 6475 |
(*act.ilc_func)(self, |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6476 |
@symbol(activate:view:), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6477 |
nil, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6478 |
&act, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6479 |
true, |
1723 | 6480 |
theView); |
1127 | 6481 |
break; |
6482 |
default: |
|
6483 |
break; |
|
6484 |
} |
|
6485 |
break; |
|
6486 |
||
6487 |
case WM_MOUSEACTIVATE: |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6488 |
DPRINTF((">>> WM_MOUSEACTIVATE h=%x\n", ev->ev_hWnd)); |
1723 | 6489 |
|
6490 |
(*focIn.ilc_func)(self, |
|
1127 | 6491 |
@symbol(focusInView:), |
6492 |
nil, |
|
1723 | 6493 |
&focIn, |
1127 | 6494 |
theView); |
6495 |
break; |
|
6496 |
||
6497 |
case WM_SETFOCUS: |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6498 |
DPRINTF((">>> WM_SETFOCUS h=%x\n", ev->ev_hWnd)); |
1723 | 6499 |
(*focIn.ilc_func)(self, |
1127 | 6500 |
@symbol(focusInView:), |
6501 |
nil, |
|
1723 | 6502 |
&focIn, |
1127 | 6503 |
theView); |
6504 |
break; |
|
6505 |
||
6506 |
case WM_KILLFOCUS: |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6507 |
DPRINTF((">>> WM_KILLFOCUS h=%x\n", ev->ev_hWnd)); |
1723 | 6508 |
(*focOut.ilc_func)(self, |
1127 | 6509 |
@symbol(focusOutView:), |
6510 |
nil, |
|
1723 | 6511 |
&focOut, |
1127 | 6512 |
theView); |
6513 |
break; |
|
6514 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6515 |
case __WM_GEXPOSE: |
1127 | 6516 |
x = ev->ev_x; |
6517 |
y = ev->ev_y; |
|
6518 |
w = ev->ev_w; |
|
6519 |
h = ev->ev_h; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6520 |
(*gexpS.ilc_func)(self, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6521 |
@symbol(graphicsExposeX:y:width:height:final:view:), nil, &gexpS, |
1127 | 6522 |
__MKSMALLINT(x), |
6523 |
__MKSMALLINT(y), |
|
6524 |
__MKSMALLINT(w), |
|
6525 |
__MKSMALLINT(h), |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6526 |
true, |
1127 | 6527 |
theView); |
2232 | 6528 |
break; |
6529 |
case __WM_NOGEXPOSE: |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6530 |
(*nexpS.ilc_func)(self, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6531 |
@symbol(noExposeView:), nil, &nexpS, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6532 |
theView); |
2232 | 6533 |
break; |
1127 | 6534 |
case WM_PAINT: |
2244 | 6535 |
{ |
6536 |
RECT rec; |
|
6537 |
HDC dc = (HDC)GetDC(ev->ev_hWnd); |
|
6538 |
HBRUSH br = CreateSolidBrush(st2RGB(GetWindow_bgBrush(ev->ev_hWnd),0)); |
|
6539 |
if (br) |
|
6540 |
{ |
|
6541 |
rec.left = ev->ev_x; |
|
6542 |
rec.top = ev->ev_y; |
|
6543 |
rec.right = ev->ev_w; |
|
6544 |
rec.bottom = ev->ev_h; |
|
2253 | 6545 |
//printf("erase %d %d %d %d\n",rec.left,rec.top,rec.right,rec.bottom); |
2244 | 6546 |
SelectClipRgn(dc,0); |
6547 |
FillRect(dc, &rec, br); |
|
6548 |
DelObject(br); |
|
6549 |
} |
|
6550 |
ReleaseDC(ev->ev_hWnd,dc); |
|
6551 |
} |
|
1127 | 6552 |
x = ev->ev_x; |
6553 |
y = ev->ev_y; |
|
6554 |
w = ev->ev_w; |
|
6555 |
h = ev->ev_h; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6556 |
/*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
|
6557 |
/*expose:*/ |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6558 |
DPRINTF((">>> WM_PAINT -> expose %d/%d -> %d/%d\n", x, y, w, h)); |
1723 | 6559 |
(*exp.ilc_func)(self, |
1127 | 6560 |
@symbol(exposeX:y:width:height:view:), |
1723 | 6561 |
nil, &exp, |
1127 | 6562 |
__MKSMALLINT(x), |
6563 |
__MKSMALLINT(y), |
|
6564 |
__MKSMALLINT(w), |
|
6565 |
__MKSMALLINT(h), |
|
6566 |
theView); |
|
6567 |
break; |
|
6568 |
||
6569 |
case WM_LBUTTONDBLCLK: |
|
6570 |
isDoubleClick = 1; |
|
2151 | 6571 |
butt = __MKSMALLINT(Button1); |
1127 | 6572 |
goto commonButtonDown; |
6573 |
||
6574 |
case WM_LBUTTONUP: |
|
6575 |
isDown = 0; |
|
2151 | 6576 |
butt = __MKSMALLINT(Button1); |
1127 | 6577 |
goto commonButtonDown; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6578 |
|
1127 | 6579 |
case WM_LBUTTONDOWN: |
2151 | 6580 |
butt = __MKSMALLINT(Button1); |
1127 | 6581 |
goto commonButtonDown; |
6582 |
||
6583 |
case WM_MBUTTONDBLCLK: |
|
6584 |
isDoubleClick = 1; |
|
2151 | 6585 |
butt = __MKSMALLINT(Button2); |
1127 | 6586 |
goto commonButtonDown; |
6587 |
||
6588 |
case WM_MBUTTONUP: |
|
6589 |
isDown = 0; |
|
2151 | 6590 |
butt = __MKSMALLINT(Button2); |
1127 | 6591 |
goto commonButtonDown; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6592 |
|
1127 | 6593 |
case WM_MBUTTONDOWN: |
2151 | 6594 |
butt = __MKSMALLINT(Button2); |
1127 | 6595 |
goto commonButtonDown; |
6596 |
||
6597 |
case WM_RBUTTONDBLCLK: |
|
6598 |
isDoubleClick = 1; |
|
2151 | 6599 |
butt = __MKSMALLINT(Button3); |
1127 | 6600 |
goto commonButtonDown; |
6601 |
||
6602 |
case WM_RBUTTONUP: |
|
6603 |
isDown = 0; |
|
2151 | 6604 |
butt = __MKSMALLINT(Button3); |
1127 | 6605 |
goto commonButtonDown; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6606 |
|
1127 | 6607 |
case WM_RBUTTONDOWN: |
2151 | 6608 |
butt = __MKSMALLINT(Button3); |
1127 | 6609 |
goto commonButtonDown; |
6610 |
||
6611 |
commonButtonDown: |
|
6612 |
x = ev->ev_x; |
|
6613 |
y = ev->ev_y; |
|
6614 |
modifiers = ev->ev_modifiers; |
|
6615 |
||
6616 |
if (__INST(buttonTranslation) != nil) { |
|
6617 |
butt = __AT_(__INST(buttonTranslation), butt); |
|
6618 |
} |
|
6619 |
arg = butt; |
|
6620 |
||
6621 |
__INST(altDown) = (modifiers & AltMask) ? true : false; |
|
6622 |
__INST(metaDown) = (modifiers & MetaMask) ? true : false; |
|
6623 |
__INST(shiftDown) = (modifiers & ShiftMask) ? true : false; |
|
6624 |
__INST(ctrlDown) = (modifiers & ControlMask) ? true : false; |
|
6625 |
||
2151 | 6626 |
if (isDoubleClick) |
6627 |
{ |
|
6628 |
multiClickState = 1; |
|
6629 |
nextMultiClickTime = lastMSGTime + multiClickTime; |
|
1723 | 6630 |
ipS = &bmp; |
1127 | 6631 |
symS = @symbol(buttonMultiPress:x:y:view:); |
2151 | 6632 |
} |
6633 |
else |
|
6634 |
{ |
|
6635 |
if (isDown) |
|
6636 |
{ |
|
6637 |
if (multiClickState && (lastMSGTime < nextMultiClickTime)) |
|
1705 | 6638 |
{ |
2151 | 6639 |
nextMultiClickTime = lastMSGTime + multiClickTime; |
6640 |
ipS = &bmp; |
|
6641 |
symS = @symbol(buttonMultiPress:x:y:view:); |
|
1127 | 6642 |
} |
2151 | 6643 |
else |
6644 |
{ |
|
6645 |
multiClickState = 0; |
|
6646 |
ipS = &bp; |
|
6647 |
symS = @symbol(buttonPress:x:y:view:); |
|
6648 |
} |
|
6649 |
} |
|
6650 |
else |
|
6651 |
{ |
|
1723 | 6652 |
ipS = &br; |
1127 | 6653 |
symS = @symbol(buttonRelease:x:y:view:); |
6654 |
} |
|
6655 |
} |
|
6656 |
||
6657 |
if (__isSymbol(arg)) { |
|
2151 | 6658 |
DPRINTF(("buttonPress/buttonRelease: %s %d/%d\n", |
1127 | 6659 |
__stringVal(arg), x, y)); |
6660 |
} else { |
|
2151 | 6661 |
DPRINTF(("buttonPress/buttonRelease: %d %d/%d\n", |
1127 | 6662 |
__intVal(arg), x, y)); |
6663 |
} |
|
6664 |
||
6665 |
(*(*ipS).ilc_func)(self, symS, nil, ipS, |
|
6666 |
arg, |
|
6667 |
__MKSMALLINT(x), |
|
6668 |
__MKSMALLINT(y), |
|
6669 |
theView); |
|
6670 |
break; |
|
6671 |
||
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6672 |
case __WM_MOUSEENTER: |
1127 | 6673 |
x = ev->ev_x; |
6674 |
y = ev->ev_y; |
|
1723 | 6675 |
state = ev->ev_modifiers; |
6676 |
DPRINTF((">>> WM_MOUSEENTER: %d/%d %x\n", x, y, state)); |
|
6677 |
(*pe.ilc_func)(self, @symbol(pointerEnter:x:y:view:), |
|
6678 |
nil, &pe, |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6679 |
__MKSMALLINT(state), |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6680 |
__MKSMALLINT(x), |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6681 |
__MKSMALLINT(y), |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6682 |
theView); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6683 |
break; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6684 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6685 |
case __WM_MOUSELEAVE: |
1723 | 6686 |
state = ev->ev_modifiers; |
6687 |
DPRINTF((">>> WM_MOUSELEAVE: %d/%d %x\n", x, y, state)); |
|
6688 |
(*pl.ilc_func)(self, @symbol(pointerLeave:view:), |
|
6689 |
nil, &pl, |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6690 |
__MKSMALLINT(state), |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6691 |
theView); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6692 |
break; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6693 |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6694 |
case WM_MOUSEMOVE: |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6695 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6696 |
x = ev->ev_x; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6697 |
y = ev->ev_y; |
1723 | 6698 |
state = ev->ev_modifiers; |
6699 |
DPRINTF((">>> WM_MOUSEMOVE: %d/%d %x\n", x, y, state)); |
|
1127 | 6700 |
|
1723 | 6701 |
(*mot.ilc_func)(self, @symbol(buttonMotion:x:y:view:), |
6702 |
nil, &mot, |
|
1127 | 6703 |
__MKSMALLINT(state), |
6704 |
__MKSMALLINT(x), |
|
6705 |
__MKSMALLINT(y), |
|
6706 |
theView); |
|
6707 |
break; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6708 |
|
1127 | 6709 |
case WM_CHAR: |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6710 |
DPRINTF((">>> WM_CHAR: %d/%d\n", x, y)); |
1127 | 6711 |
symS = @symbol(keyPress:x:y:view:); |
1723 | 6712 |
ipS = &skp; |
1127 | 6713 |
upDown = true; |
6714 |
goto keyPressAndRelease; |
|
6715 |
case WM_SYSKEYUP: |
|
6716 |
case WM_KEYUP: |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6717 |
DPRINTF((">>> WM_KEYUP / SYSKEYUP: %d/%d\n", x, y)); |
1127 | 6718 |
symS = @symbol(keyRelease:x:y:view:); |
1723 | 6719 |
ipS = &skr; |
1127 | 6720 |
upDown = false; |
6721 |
goto keyPressAndRelease; |
|
6722 |
||
6723 |
case WM_SYSKEYDOWN: |
|
6724 |
case WM_KEYDOWN: |
|
2232 | 6725 |
#ifdef DEBUG |
6726 |
if (ev->ev_keyCode == 0x11) |
|
6727 |
c_count = 0; |
|
6728 |
#endif |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6729 |
DPRINTF((">>> WM_KEYDOWN / SYSKEYDOWN: %d/%d\n", x, y)); |
1127 | 6730 |
symS = @symbol(keyPress:x:y:view:); |
1723 | 6731 |
ipS = &skp; |
1127 | 6732 |
upDown = true; |
6733 |
/* FALL INTO */ |
|
6734 |
||
6735 |
keyPressAndRelease: ; |
|
6736 |
||
6737 |
x = ev->ev_x; |
|
6738 |
y = ev->ev_y; |
|
6739 |
||
6740 |
#ifdef NOTDEF |
|
6741 |
{ |
|
6742 |
BYTE vKeyState[256]; |
|
6743 |
char buff[5]; |
|
6744 |
||
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
6745 |
GetKeyboardState(vKeyState); |
1127 | 6746 |
ToAscii(ev->ev_keyCode, ev->ev_scanCode, vKeyState, &buff; 0); |
6747 |
} |
|
6748 |
#endif |
|
6749 |
||
6750 |
keyCode = ev->ev_keyCode; |
|
6751 |
modifiers = ev->ev_modifiers; |
|
6752 |
||
6753 |
if (modifiers & TRANSLATED_KEY) { |
|
6754 |
if (modifiers & ControlMask) { |
|
6755 |
if (keyCode < 0x20) { |
|
6756 |
keyCode = keyCode + 'a' - 1; |
|
6757 |
if (modifiers & ShiftMask) { |
|
6758 |
keyCode = keyCode - 'a' + 'A'; |
|
6759 |
} |
|
6760 |
} |
|
6761 |
} else if (modifiers & (MetaMask | AltMask)) { |
|
6762 |
if (! (modifiers & ShiftMask)) { |
|
6763 |
if ((keyCode >= 'A') && (keyCode <= 'Z')) { |
|
6764 |
keyCode = keyCode - 'A' + 'a'; |
|
6765 |
} |
|
6766 |
} |
|
6767 |
} |
|
6768 |
arg = __MKCHARACTER(keyCode & 0xFF); |
|
6769 |
} else { |
|
6770 |
switch (keyCode) { |
|
2151 | 6771 |
case VK_F1: |
6772 |
arg = @symbol(F1); |
|
6773 |
break; |
|
6774 |
case VK_F2: |
|
6775 |
arg = @symbol(F2); |
|
6776 |
break; |
|
6777 |
case VK_F3: |
|
6778 |
arg = @symbol(F3); |
|
6779 |
break; |
|
6780 |
case VK_F4: |
|
6781 |
arg = @symbol(F4); |
|
6782 |
break; |
|
6783 |
case VK_F5: |
|
6784 |
arg = @symbol(F5); |
|
6785 |
break; |
|
6786 |
case VK_F6: |
|
6787 |
arg = @symbol(F6); |
|
6788 |
break; |
|
6789 |
case VK_F7: |
|
6790 |
arg = @symbol(F7); |
|
6791 |
break; |
|
6792 |
case VK_F8: |
|
6793 |
arg = @symbol(F8); |
|
6794 |
break; |
|
6795 |
case VK_F9: |
|
6796 |
arg = @symbol(F9); |
|
6797 |
break; |
|
6798 |
case VK_F10: |
|
6799 |
arg = @symbol(F10); |
|
6800 |
break; |
|
6801 |
case VK_F11: |
|
6802 |
arg = @symbol(F11); |
|
6803 |
break; |
|
6804 |
case VK_F12: |
|
6805 |
arg = @symbol(F12); |
|
6806 |
break; |
|
6807 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6808 |
case VK_PRIOR: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6809 |
arg = @symbol(Prior); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6810 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6811 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6812 |
case VK_NEXT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6813 |
arg = @symbol(Next); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6814 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6815 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6816 |
case VK_END: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6817 |
arg = @symbol(End); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6818 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6819 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6820 |
case VK_HOME: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6821 |
arg = @symbol(Home); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6822 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6823 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6824 |
case VK_LEFT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6825 |
arg = @symbol(CursorLeft); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6826 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6827 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6828 |
case VK_RIGHT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6829 |
arg = @symbol(CursorRight); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6830 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6831 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6832 |
case VK_UP: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6833 |
arg = @symbol(CursorUp); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6834 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6835 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6836 |
case VK_DOWN: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6837 |
arg = @symbol(CursorDown); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6838 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6839 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6840 |
case VK_MENU: /*alt taste bei w95 ???*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6841 |
arg = @symbol(Menu); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6842 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6843 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6844 |
case VK_LMENU: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6845 |
arg = @symbol(Menu_L); |
1127 | 6846 |
break; |
6847 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6848 |
case VK_RMENU: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6849 |
arg = @symbol(Menu_R); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6850 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6851 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6852 |
case VK_PAUSE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6853 |
arg = @symbol(Pause); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6854 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6855 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6856 |
case VK_HELP: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6857 |
arg = @symbol(Help); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6858 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6859 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6860 |
case VK_EXECUTE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6861 |
arg = @symbol(Execute); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6862 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6863 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6864 |
case VK_CANCEL: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6865 |
arg = @symbol(Cancel); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6866 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6867 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6868 |
case VK_SELECT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6869 |
arg = @symbol(Select); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6870 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6871 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6872 |
case VK_PRINT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6873 |
arg = @symbol(Print); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6874 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6875 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6876 |
case VK_SNAPSHOT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6877 |
arg = @symbol(Snapshot); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6878 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6879 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6880 |
case VK_INSERT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6881 |
arg = @symbol(Insert); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6882 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6883 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6884 |
case VK_DELETE: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6885 |
arg = @symbol(Delete); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6886 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6887 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6888 |
case VK_BACK: |
1127 | 6889 |
arg = @symbol(BackSpace); |
6890 |
break; |
|
6891 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6892 |
case VK_LWIN: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6893 |
arg = @symbol(Win_L); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6894 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6895 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6896 |
case VK_RWIN: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6897 |
arg = @symbol(Win_R); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6898 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6899 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6900 |
case VK_APPS: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6901 |
arg = @symbol(Appl); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6902 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6903 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6904 |
case VK_NUMPAD0: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6905 |
arg = @symbol(KeyPad0); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6906 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6907 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6908 |
case VK_NUMPAD1: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6909 |
arg = @symbol(KeyPad1); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6910 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6911 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6912 |
case VK_NUMPAD2: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6913 |
arg = @symbol(KeyPad2); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6914 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6915 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6916 |
case VK_NUMPAD3: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6917 |
arg = @symbol(KeyPad3); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6918 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6919 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6920 |
case VK_NUMPAD4: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6921 |
arg = @symbol(KeyPad4); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6922 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6923 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6924 |
case VK_NUMPAD5: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6925 |
arg = @symbol(KeyPad5); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6926 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6927 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6928 |
case VK_NUMPAD6: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6929 |
arg = @symbol(KeyPad6); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6930 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6931 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6932 |
case VK_NUMPAD7: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6933 |
arg = @symbol(KeyPad7); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6934 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6935 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6936 |
case VK_NUMPAD8: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6937 |
arg = @symbol(KeyPad8); |
1127 | 6938 |
break; |
6939 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6940 |
case VK_NUMPAD9: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6941 |
arg = @symbol(KeyPad9); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6942 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6943 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6944 |
case VK_LSHIFT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6945 |
arg = @symbol(Shift_L); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6946 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6947 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6948 |
case VK_RSHIFT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6949 |
arg = @symbol(Shift_R); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6950 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6951 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6952 |
case VK_LCONTROL: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6953 |
arg = @symbol(Ctrl_L); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6954 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6955 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6956 |
case VK_RCONTROL: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6957 |
arg = @symbol(Ctrl_R); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6958 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6959 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6960 |
case VK_CONTROL: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6961 |
arg = @symbol(Ctrl); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6962 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6963 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6964 |
case VK_SHIFT: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6965 |
arg = @symbol(Shift); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6966 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6967 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6968 |
case VK_TAB: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6969 |
arg = @symbol(Tab); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6970 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6971 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6972 |
case VK_ESCAPE: |
1127 | 6973 |
arg = @symbol(Escape); |
6974 |
break; |
|
6975 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6976 |
case VK_NUMLOCK: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6977 |
arg = @symbol(NumLock); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6978 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6979 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6980 |
case VK_SCROLL: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6981 |
arg = @symbol(ScrollLock); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6982 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6983 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6984 |
case VK_RETURN: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6985 |
arg = @symbol(Return); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6986 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6987 |
|
1127 | 6988 |
default: |
6989 |
nameBuffer[0] = 0; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6990 |
/*GetKeyNameText(ev->ev_scanCode, nameBuffer, sizeof(nameBuffer));*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6991 |
DPRINTF(("char is <%d>\n", keyCode)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6992 |
arg = __MKCHARACTER(keyCode & 0xFF); |
1127 | 6993 |
break; |
6994 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
6995 |
} |
1127 | 6996 |
|
6997 |
DPRINTF(("%s: code=%x mod=%x\n", __stringVal(symS), |
|
6998 |
keyCode, modifiers)); |
|
6999 |
||
7000 |
__INST(altDown) = (modifiers & AltMask) ? true : false; |
|
7001 |
__INST(metaDown) = (modifiers & MetaMask) ? true : false; |
|
7002 |
__INST(shiftDown) = (modifiers & ShiftMask) ? true : false; |
|
7003 |
__INST(ctrlDown) = (modifiers & ControlMask) ? true : false; |
|
7004 |
||
7005 |
(*(*ipS).ilc_func)(self, symS, nil, ipS, |
|
7006 |
arg, |
|
7007 |
__MKSMALLINT(x), |
|
7008 |
__MKSMALLINT(y), |
|
7009 |
theView); |
|
7010 |
||
7011 |
break; |
|
7012 |
||
7013 |
default: |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
7014 |
DPRINTF((">>> unhandled event: %x\n", ev->ev_message)); |
1127 | 7015 |
break; |
7016 |
} |
|
7017 |
%}. |
|
7018 |
^ true |
|
2232 | 7019 |
! |
7020 |
||
7021 |
dispatchPendingEvents |
|
7022 |
"central event handling method for modal operation. |
|
7023 |
(i.e. this is now only used in the modal debugger) |
|
7024 |
Dispatch any pending events; return when no more are pending. |
|
7025 |
This code is somewhat special, since X has a concept of graphic |
|
7026 |
expose events (which are sent after a bitblt). After such a bitblt, |
|
7027 |
we only handle exposes until the graphicsExpose arrives. |
|
7028 |
Other systems may not need such a kludge" |
|
7029 |
||
7030 |
"interested in exposes only ?" |
|
7031 |
dispatchingExpose notNil ifTrue:[ |
|
7032 |
[self exposeEventPendingFor:dispatchingExpose withSync:false] whileTrue:[ |
|
7033 |
self dispatchExposeEventFor:dispatchingExpose |
|
7034 |
]. |
|
7035 |
^ self |
|
7036 |
]. |
|
7037 |
||
7038 |
[self eventPendingWithSync:false] whileTrue:[ |
|
7039 |
(self getEventFor:nil withMask:nil) ifTrue:[ |
|
7040 |
AbortSignal handle:[:ex | |
|
7041 |
ex return |
|
7042 |
] do:[ |
|
7043 |
self dispatchLastEvent |
|
7044 |
] |
|
7045 |
]. |
|
7046 |
] |
|
7047 |
||
7048 |
"Modified: 19.8.1997 / 17:11:18 / cg" |
|
7049 |
! |
|
7050 |
||
1127 | 7051 |
disposeEventsWithMask:aMask for:aWindowIdOrNil |
7052 |
"dispose (throw away) specific events. If aWindowId is nil, |
|
7053 |
events matching the mask are thrown away regardless of which |
|
2232 | 7054 |
view they are for. Otherwise, only matching events for that |
1127 | 7055 |
view are flushed." |
7056 |
||
7057 |
%{ /* NOCONTEXT */ |
|
2232 | 7058 |
PRINTF(("disposeEventsWithMask:for: not yet implemented.\n")); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7059 |
RETURN ( self ); |
1127 | 7060 |
%}. |
7061 |
self primitiveFailed |
|
2232 | 7062 |
! |
7063 |
||
1127 | 7064 |
eventMaskFor:anEventSymbol |
7065 |
"return the eventMask bit-constant corresponding to an event symbol" |
|
7066 |
||
7067 |
%{ /* NOCONTEXT */ |
|
7068 |
||
7069 |
int m = 0; |
|
7070 |
||
7071 |
if (anEventSymbol == @symbol(keyPress)) m = KeyPressMask; |
|
7072 |
else if (anEventSymbol == @symbol(keyRelease)) m = KeyReleaseMask; |
|
7073 |
else if (anEventSymbol == @symbol(buttonPress)) m = ButtonPressMask; |
|
7074 |
else if (anEventSymbol == @symbol(buttonRelease)) m = ButtonReleaseMask; |
|
7075 |
else if (anEventSymbol == @symbol(buttonMotion)) m = ButtonMotionMask; |
|
7076 |
else if (anEventSymbol == @symbol(pointerMotion)) m = PointerMotionMask; |
|
7077 |
else if (anEventSymbol == @symbol(expose)) m = ExposureMask; |
|
7078 |
else if (anEventSymbol == @symbol(focusChange)) m = FocusChangeMask; |
|
7079 |
else if (anEventSymbol == @symbol(enter)) m = EnterWindowMask; |
|
7080 |
else if (anEventSymbol == @symbol(leave)) m = LeaveWindowMask; |
|
7081 |
else if (anEventSymbol == @symbol(keymapState)) m = KeymapStateMask; |
|
7082 |
else if (anEventSymbol == @symbol(visibilityChange)) m = VisibilityChangeMask; |
|
7083 |
else if (anEventSymbol == @symbol(structureNotify)) m = StructureNotifyMask; |
|
7084 |
else if (anEventSymbol == @symbol(resizeRedirect)) m = ResizeRedirectMask; |
|
7085 |
else if (anEventSymbol == @symbol(propertyChange)) m = PropertyChangeMask; |
|
7086 |
else if (anEventSymbol == @symbol(colormapChange)) m = ColormapChangeMask; |
|
7087 |
RETURN (__MKSMALLINT(m)); |
|
7088 |
%} |
|
2232 | 7089 |
! |
7090 |
||
1127 | 7091 |
eventPending |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7092 |
"return true, if any event is pending. |
1127 | 7093 |
This looks for both the internal queue and the display connection." |
7094 |
||
2232 | 7095 |
ConservativeSyncing == true ifTrue:[self sync]. |
7096 |
||
7097 |
dispatchingExpose notNil ifTrue:[ |
|
7098 |
^ self exposeEventPendingFor:dispatchingExpose withSync:false |
|
7099 |
]. |
|
7100 |
^ self eventPendingWithSync:false |
|
7101 |
! |
|
7102 |
||
7103 |
eventPending:anEventSymbol for:aWindowIdOrNil |
|
7104 |
"return true, if a specific event is pending" |
|
7105 |
||
7106 |
^ self eventsPending:(self eventMaskFor:anEventSymbol) for:aWindowIdOrNil withSync:false |
|
7107 |
! |
|
7108 |
||
7109 |
eventPendingWithSync:doSync |
|
7110 |
"return true, if any event is pending. |
|
7111 |
The doSync argument is ignored here - in windows, all drawing is synchronous." |
|
7112 |
doSync notNil ifTrue:[self flush]. |
|
7113 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
|
1723 | 7114 |
MSG msg; |
7115 |
||
7116 |
if (__INST(inRecursiveDispatch) == true) { |
|
7117 |
RETURN (false); |
|
7118 |
} |
|
7119 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7120 |
if (isInputEvent()) { |
1723 | 7121 |
RETURN (true); |
7122 |
} |
|
7123 |
%}. |
|
2232 | 7124 |
! |
7125 |
||
1127 | 7126 |
eventQueued |
7127 |
"return true, if any event is queued" |
|
7128 |
||
7129 |
^ self eventQueuedAlready |
|
7130 |
||
7131 |
"Created: 12.12.1995 / 21:43:00 / stefan" |
|
2232 | 7132 |
! |
7133 |
||
1127 | 7134 |
eventQueuedAlready |
7135 |
"return true, if any event is queued internally. |
|
7136 |
(i.e. in X's internal event queue, which is both filled by explicit |
|
7137 |
nextEvent calls AND whenever drawing is done and events are pending on |
|
7138 |
the display connection)." |
|
7139 |
||
2232 | 7140 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 7141 |
|
7142 |
DDPRINTF(("peek q - ")); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7143 |
if (isInputEvent()) { |
1127 | 7144 |
DDPRINTF(("true\n")); |
7145 |
RETURN (true); |
|
7146 |
} |
|
7147 |
DDPRINTF(("false\n")); |
|
7148 |
RETURN ( false ); |
|
7149 |
%} |
|
2232 | 7150 |
! |
7151 |
||
1127 | 7152 |
eventsPending:anEventMask for:aWindowIdOrNil withSync:doSync |
1705 | 7153 |
"return true, if any of the masked events is pending. |
7154 |
The doSync argument is ignored here - in windows, all drawing is synchronous." |
|
1127 | 7155 |
|
7156 |
%{ /* NOCONTEXT */ |
|
7157 |
||
2232 | 7158 |
DPRINTF(("eventsPending mask %x - not implemented\n", __intVal(anEventMask))); |
1127 | 7159 |
%}. |
7160 |
^ false |
|
2232 | 7161 |
! |
7162 |
||
1127 | 7163 |
exposeEventPendingFor:aWindowIdOrNil withSync:doSync |
7164 |
"return true, if any expose event is pending for a specific view, |
|
7165 |
or any view (if the arg is nil). |
|
1705 | 7166 |
This is an X specific interface - not used on windows (scrolling is synchronous)" |
2232 | 7167 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7168 |
%}. |
1127 | 7169 |
^ false |
2232 | 7170 |
! |
7171 |
||
1127 | 7172 |
getEventFor:aViewIdOrNil withMask:eventMask |
2232 | 7173 |
"read next event - put into local eventBuffer. |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7174 |
If aViewIdOrNil is nil, events for any view are fetched; |
1127 | 7175 |
otherwise only events for that specific view will be fetched. |
7176 |
Returns true, if there was an event, false otherwise." |
|
7177 |
||
2232 | 7178 |
%{ /* xxLIMITEDSTACK */ |
7179 |
HWND win, wWanted; |
|
7180 |
int evMask; |
|
7181 |
OBJ eB; |
|
7182 |
struct queuedEvent *ev; |
|
7183 |
struct queuedEvent *qev; |
|
7184 |
eB = __INST(eventBuffer); |
|
7185 |
if (__isByteArray(eB)) { |
|
7186 |
ev = (struct queuedEvent *)(__ByteArrayInstPtr(eB)->ba_element); |
|
7187 |
} else { |
|
7188 |
printf("DISPLAY: no eventBuffer\n"); |
|
7189 |
RETURN (false); |
|
7190 |
} |
|
7191 |
ev->ev_message = 0; |
|
7192 |
||
7193 |
if (__isSmallInteger(eventMask)) { |
|
7194 |
evMask = __intVal(eventMask); |
|
7195 |
} else { |
|
7196 |
evMask = ~0; |
|
7197 |
} |
|
7198 |
||
7199 |
if (__isExternalAddress(aViewIdOrNil)) |
|
7200 |
{ |
|
7201 |
if (deqEvent(ev,_HWNDVal(aViewIdOrNil),evMask)) |
|
7202 |
{ |
|
7203 |
RETURN ( true ); |
|
7204 |
} |
|
7205 |
} |
|
7206 |
else |
|
7207 |
{ |
|
7208 |
if (deqEvent(ev,0,evMask)) |
|
7209 |
{ |
|
7210 |
RETURN ( true ); |
|
7211 |
} |
|
7212 |
} |
|
1127 | 7213 |
%}. |
7214 |
^ false |
|
2232 | 7215 |
! |
7216 |
||
1127 | 7217 |
handleAllEvents |
2232 | 7218 |
"from now on, handle any kind of event" |
7219 |
||
7220 |
dispatchingExpose := nil |
|
7221 |
! |
|
7222 |
||
1127 | 7223 |
handleExposeOnlyFor:aView |
2232 | 7224 |
"from now on, handle expose events only" |
7225 |
||
2253 | 7226 |
"/ dispatchingExpose := aView id |
7227 |
'handleExposeOnlyFor: not yet implemented' printCR. |
|
2232 | 7228 |
! |
7229 |
||
1127 | 7230 |
mappingChanged:what event:eB |
7231 |
"One of Keyboard-, Modifier- or PointerMap has change, probably by xmodmap. |
|
7232 |
Tell xlib about the fact." |
|
7233 |
||
7234 |
(what == #mappingKeyboard or:[what == #mappingModifier]) ifTrue:[ |
|
7235 |
self refreshKeyboardMapping:eB. |
|
7236 |
"Maybe some of our modifiers have been changed" |
|
7237 |
self initializeModifierMappings. |
|
7238 |
]. |
|
7239 |
||
7240 |
"Created: 1.12.1995 / 16:28:23 / stefan" |
|
2232 | 7241 |
! |
7242 |
||
1127 | 7243 |
setEventMask:aMask in:aWindowId |
7244 |
"tell X that we are only interested in events from aMask, which |
|
7245 |
is the bitwise or of the eventMask bits (see 'eventMaskFor:')" |
|
7246 |
||
2151 | 7247 |
%{ /* NOCONTEXT */ |
7248 |
||
7249 |
if (__isExternalAddress(aWindowId) |
|
7250 |
&& __isSmallInteger(aMask)) |
|
7251 |
{ |
|
7252 |
HWND hWnd = _HWNDVal(aWindowId); |
|
7253 |
int mask = __intVal(aMask); |
|
7254 |
if (GETLOCALWINDOWINFOPTR(hWnd)) |
|
7255 |
{ |
|
7256 |
DPRINTF(("new eventMask %x\n",mask)); |
|
7257 |
#ifdef DEBUGMASK |
|
2232 | 7258 |
PRINTF(("new eventMask %x\n",mask)); |
2151 | 7259 |
printMask(mask); |
7260 |
#endif |
|
7261 |
GETLOCALWINDOWINFOPTR(hWnd)->eventMask = mask; |
|
7262 |
RETURN ( self ); |
|
7263 |
} |
|
7264 |
} |
|
7265 |
%}. |
|
7266 |
self primitiveFailed |
|
2232 | 7267 |
! ! |
7268 |
||
7269 |
!WinWorkstation methodsFor:'event sending'! |
|
7270 |
||
1127 | 7271 |
sendKeyOrButtonEvent:typeSymbol x:xPos y:yPos keyOrButton:keySymCodeOrButtonNr state:stateMask toViewId:targetId |
7272 |
"send a keyPress/Release or buttonPress/Release event to some (possibly alien) view. |
|
7273 |
TypeSymbol must be one of: #keyPress, #keyRelease, #buttonPress , #buttonRelease. |
|
7274 |
For buttonEvents, the keySymCodeOrButtonNr must be the buttons number (1, 2 ...); |
|
7275 |
for key events, it can be either a symbol (as listen in X's keySyms) |
|
7276 |
or a numeric keysym code. If state is nil, the modifier bits (shift & control) |
|
7277 |
are computed from the keyboardMap - if non-nil, these are passed as modifierbits. |
|
7278 |
The non-nil case is the lowlevel entry, where state must include any shift/ctrl information |
|
7279 |
(not very user friendly)" |
|
7280 |
||
7281 |
^ false |
|
2232 | 7282 |
! |
7283 |
||
1127 | 7284 |
simulateKeyboardInput:aCharacterOrString inViewId:viewId |
7285 |
"send input to some other view, by simulating keyPress/keyRelease |
|
2151 | 7286 |
events. |
1127 | 7287 |
Only a few control characters are supported. |
7288 |
Notice: not all alien views allow this kind of synthetic input; |
|
7289 |
some simply ignore it." |
|
7290 |
||
7291 |
|control code state| |
|
7292 |
||
7293 |
aCharacterOrString isString ifTrue:[ |
|
7294 |
aCharacterOrString do:[:char | |
|
7295 |
self simulateKeyboardInput:char inViewId:viewId |
|
7296 |
]. |
|
7297 |
^ self |
|
7298 |
]. |
|
7299 |
||
7300 |
control := false. |
|
7301 |
code := aCharacterOrString asciiValue. |
|
7302 |
||
7303 |
(aCharacterOrString == Character cr) ifTrue:[ |
|
7304 |
code := #Return |
|
7305 |
] ifFalse:[ |
|
7306 |
(aCharacterOrString == Character tab) ifTrue:[ |
|
2151 | 7307 |
code := #Tab |
1127 | 7308 |
] ifFalse:[ |
7309 |
(aCharacterOrString == Character esc) ifTrue:[ |
|
2151 | 7310 |
code := #Escape |
1127 | 7311 |
] |
7312 |
] |
|
7313 |
]. |
|
7314 |
||
7315 |
control ifTrue:[ |
|
7316 |
state := self controlMask |
|
7317 |
]. |
|
7318 |
||
7319 |
||
7320 |
"/ the stuff below should not be needed |
|
7321 |
"/ (sendKeyOrButtonevent should be able to figure out things itself) |
|
7322 |
"/ however, on some linux systems it seems to not work correctly. |
|
7323 |
"/ Hopefully, this is correct ... |
|
7324 |
||
7325 |
code isNumber ifTrue:[ |
|
7326 |
code >= $A asciiValue ifTrue:[ |
|
7327 |
code <= $Z asciiValue ifTrue:[ |
|
7328 |
state := self shiftMask |
|
7329 |
] |
|
7330 |
] |
|
7331 |
]. |
|
7332 |
||
7333 |
self sendKeyOrButtonEvent:#keyPress x:0 y:0 keyOrButton:code state:state toViewId:viewId. |
|
7334 |
self sendKeyOrButtonEvent:#keyRelease x:0 y:0 keyOrButton:code state:state toViewId:viewId |
|
7335 |
||
7336 |
" |
|
7337 |
sending input to some (possibly alien) view: |
|
7338 |
||
7339 |
|point id| |
|
7340 |
||
7341 |
point := Display pointFromUser. |
|
7342 |
id := Display viewIdFromPoint:point. |
|
7343 |
Display simulateKeyboardInput:'Hello_world' inViewId:id |
|
7344 |
" |
|
7345 |
||
7346 |
"Modified: 11.6.1996 / 10:59:42 / cg" |
|
2232 | 7347 |
! ! |
7348 |
||
7349 |
!WinWorkstation methodsFor:'font stuff'! |
|
7350 |
||
1127 | 7351 |
createFontFor:aFontName |
7352 |
"a basic method for font allocation; this method allows |
|
7353 |
any font to be aquired (even those not conforming to |
|
7354 |
standard naming conventions, such as cursor, fixed or k14)" |
|
7355 |
||
2232 | 7356 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 7357 |
HGDIOBJ hFont; |
7358 |
char *fn; |
|
7359 |
||
7360 |
if (__isString(aFontName)) { |
|
7361 |
fn = __stringVal(aFontName); |
|
7362 |
if (strcmp(fn, "fixed") == 0) { |
|
7363 |
hFont = GetStockObject(ANSI_FIXED_FONT); |
|
7364 |
} else if (strcmp(fn, "variable") == 0) { |
|
7365 |
hFont = GetStockObject(ANSI_VAR_FONT); |
|
7366 |
} else { |
|
7367 |
hFont = GetStockObject(ANSI_FIXED_FONT); |
|
7368 |
} |
|
7369 |
if (hFont) { |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7370 |
DPRINTF(("createFontFor:aFontName: %s -> %x\n", fn, hFont)); |
1127 | 7371 |
RETURN ( __MKOBJ(hFont) ); |
7372 |
} |
|
7373 |
} |
|
7374 |
%}. |
|
7375 |
^ nil |
|
2232 | 7376 |
! |
7377 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7378 |
fontMetricsOf:fontId into:aBlock |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7379 |
"evaluate aBlock, passing a fonts metrics as arguments" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7380 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7381 |
|data| |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7382 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7383 |
data := Array new:10. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7384 |
(self primFontMetricsOf:fontId intoArray:data) isNil ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7385 |
self primitiveFailed. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7386 |
^ self |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7387 |
]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7388 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7389 |
aBlock value:#iso8859 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7390 |
value:(data at:1) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7391 |
value:(data at:2) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7392 |
value:(data at:3) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7393 |
value:(data at:4) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7394 |
value:(data at:5) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7395 |
value:(data at:6) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7396 |
value:(data at:7) |
2232 | 7397 |
! |
7398 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7399 |
fontsInFamily:aFamilyName face:aFaceName filtering:filter |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7400 |
"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
|
7401 |
On WinWorkStations there is curently Face |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7402 |
But only thise matching filter (if nonNil)." |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7403 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7404 |
|allFonts fonts| |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7405 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7406 |
allFonts := self listOfAvailableFonts. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7407 |
allFonts isNil ifTrue:[^ nil]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7408 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7409 |
fonts := Set new. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7410 |
allFonts do:[:fntDescr | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7411 |
(aFamilyName sameAs:(fntDescr family)) ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7412 |
(filter isNil or:[filter value:fntDescr]) ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7413 |
fonts add:fntDescr |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7414 |
] |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7415 |
] |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7416 |
]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7417 |
^ fonts |
2232 | 7418 |
! |
7419 |
||
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7420 |
fontsInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7421 |
"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
|
7422 |
on this display. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7423 |
On WinWorkStations there is curently no style or Face |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7424 |
But only those matching filter (if nonNIl)." |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7425 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7426 |
|allFonts fonts| |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7427 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7428 |
allFonts := self listOfAvailableFonts. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7429 |
allFonts isNil ifTrue:[^ nil]. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7430 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7431 |
fonts := Set new. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7432 |
allFonts do:[:fntDescr | |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7433 |
(aFamilyName sameAs:(fntDescr family)) ifTrue:[ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7434 |
(filter isNil or:[filter value:fntDescr]) ifTrue:[ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7435 |
fonts add:fntDescr |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7436 |
] |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7437 |
] |
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 |
^ fonts |
2232 | 7440 |
! |
7441 |
||
1127 | 7442 |
fullNameOf:aFontId |
7443 |
"the fonts fullName - this is very device specific and should only be |
|
7444 |
used for user feed-back (for example: in the fontPanel). |
|
7445 |
If the display/font do not provide that info, return nil." |
|
7446 |
^ nil |
|
2232 | 7447 |
! |
7448 |
||
1127 | 7449 |
getAvailableFontsMatching:pattern |
7450 |
"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
|
7451 |
self halt. |
1127 | 7452 |
^ nil |
2232 | 7453 |
! |
7454 |
||
1127 | 7455 |
getDefaultFont |
7456 |
"return a default font id - used when class Font cannot |
|
7457 |
find anything usable" |
|
7458 |
||
7459 |
^ self createFontFor:'fixed' |
|
2232 | 7460 |
! |
7461 |
||
1127 | 7462 |
getFontWithFamily:familyString face:faceString |
7463 |
style:styleArgString size:sizeArg encoding:encodingSym |
|
7464 |
||
7465 |
"try to get the specified font, if not available, try next smaller |
|
7466 |
font. Access to X-fonts by name is possible, by passing the X font name |
|
7467 |
as family and the other parameters as nil. For example, the cursor font |
|
7468 |
can be aquired that way." |
|
7469 |
||
7470 |
|styleString theName theId xlatedStyle id spacing| |
|
7471 |
||
7472 |
styleString := styleArgString. |
|
7473 |
||
7474 |
"special: if face is nil, allow access to X-fonts" |
|
7475 |
faceString isNil ifTrue:[ |
|
7476 |
sizeArg notNil ifTrue:[ |
|
7477 |
theName := familyString , '-' , sizeArg printString |
|
7478 |
] ifFalse:[ |
|
7479 |
theName := familyString |
|
7480 |
]. |
|
7481 |
theName isNil ifTrue:[ |
|
7482 |
" |
|
7483 |
mhmh - fall back to the default font |
|
7484 |
" |
|
7485 |
theName := 'fixed' |
|
7486 |
]. |
|
7487 |
theId := self createFontFor:theName. |
|
7488 |
theId isNil ifTrue:[ |
|
7489 |
theId := self getDefaultFont |
|
7490 |
]. |
|
7491 |
^ theId |
|
7492 |
]. |
|
7493 |
||
7494 |
"/ spacing other than 'normal' is contained as last component |
|
7495 |
"/ in style |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7496 |
styleString notNil ifTrue:[ |
2232 | 7497 |
((styleString endsWith:'-narrow') |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7498 |
or:[styleString endsWith:'-semicondensed']) ifTrue:[ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7499 |
|i| |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7500 |
i := styleString lastIndexOf:$-. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7501 |
spacing := styleString copyFrom:(i+1). |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7502 |
styleString := styleString copyTo:(i-1). |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7503 |
] ifFalse:[ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7504 |
spacing := 'normal'. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7505 |
]. |
1127 | 7506 |
]. |
7507 |
||
7508 |
xlatedStyle := styleString. |
|
7509 |
xlatedStyle notNil ifTrue:[ |
|
7510 |
xlatedStyle := xlatedStyle first asString |
|
7511 |
]. |
|
7512 |
||
2232 | 7513 |
id := self |
1127 | 7514 |
getFontWithFoundry:'*' |
7515 |
family:familyString asLowercase |
|
7516 |
weight:faceString |
|
7517 |
slant:xlatedStyle |
|
7518 |
spacing:spacing |
|
7519 |
pixelSize:nil |
|
2232 | 7520 |
size:sizeArg |
1127 | 7521 |
registry:encodingSym |
7522 |
encoding:'*'. |
|
7523 |
||
7524 |
id isNil ifTrue:[ |
|
7525 |
(encodingSym notNil and:[encodingSym ~= '*']) ifTrue:[ |
|
7526 |
"/ too stupid: encodings come in both cases |
|
7527 |
"/ and X does not ignore case |
|
7528 |
"/ |
|
2232 | 7529 |
id := self |
1127 | 7530 |
getFontWithFoundry:'*' |
7531 |
family:familyString asLowercase |
|
7532 |
weight:faceString |
|
7533 |
slant:xlatedStyle |
|
7534 |
spacing:spacing |
|
7535 |
pixelSize:nil |
|
2232 | 7536 |
size:sizeArg |
1127 | 7537 |
registry:encodingSym asUppercase |
7538 |
encoding:'*'. |
|
7539 |
id isNil ifTrue:[ |
|
2232 | 7540 |
id := self |
1127 | 7541 |
getFontWithFoundry:'*' |
7542 |
family:familyString asLowercase |
|
7543 |
weight:faceString |
|
7544 |
slant:xlatedStyle |
|
7545 |
spacing:spacing |
|
7546 |
pixelSize:nil |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7547 |
size:sizeArg |
1127 | 7548 |
registry:encodingSym asLowercase |
7549 |
encoding:'*'. |
|
7550 |
] |
|
7551 |
] |
|
7552 |
]. |
|
7553 |
^ id |
|
7554 |
||
7555 |
"Modified: 24.2.1996 / 22:37:24 / cg" |
|
7556 |
"Modified: 4.7.1996 / 11:38:47 / stefan" |
|
2232 | 7557 |
! |
7558 |
||
1127 | 7559 |
getFontWithFoundry:foundry family:family weight:weight |
2232 | 7560 |
slant:slant spacing:spc pixelSize:pSize size:size |
1127 | 7561 |
registry:registry encoding:encoding |
7562 |
||
7563 |
"get the specified font, if not available, return nil. |
|
7564 |
This is the new font creation method - all others will be changed to |
|
7565 |
use this entry. |
|
7566 |
Individual attributes can be left empty (i.e. '') or nil to match any. |
|
7567 |
||
7568 |
foundry: 'adobe', 'misc', 'dec', 'schumacher' ... usually '*' |
|
7569 |
family: 'helvetica' 'courier' 'times' ... |
|
7570 |
weight: 'bold' 'medium' 'demi' ... |
|
7571 |
slant: 'r(oman)' 'i(talic)' 'o(blique)' |
|
7572 |
spacing: 'narrow' 'normal' semicondensed' ... usually '*' |
|
7573 |
pixelSize: 16,18 ... usually left empty |
|
7574 |
size: size in point (1/72th of an inch) |
|
7575 |
registry: iso8859, sgi ... '*' |
|
7576 |
encoding: vendor specific encoding (usually '*') |
|
7577 |
" |
|
2151 | 7578 |
" |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7579 |
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
|
7580 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7581 |
nHeight |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7582 |
nWidth |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7583 |
nEscapement |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7584 |
nOrientation |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7585 |
fnWeight FW_DONTCARE, FW_NORMAL, FW_MEDIUM, FW_BOLD, ... |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7586 |
fdwItalic TRUE or FALSE |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7587 |
fdwUnderline TRUE or FALSE |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7588 |
fdwStrikeOut TRUE or FALSE |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7589 |
fdwCharSet ANSI_CHARSET, UNICODE_, SYMBOL_, SHIFTJIS_,... |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7590 |
fdwOutputPrecision DEFAULT, STRING, CHAR, ... |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7591 |
fdwClipPrecision DEFAULT, CHAR, STROKE, MASK, ... |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7592 |
fdwQuality DEFAULT, DRAFT, or PROOF. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7593 |
fdwPitchAndFamily |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7594 |
DEFAULT, FIXED or VARIABLE pitch |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7595 |
DECORATIVE, DONTCASE, MODERN, ROMAN, SCRIPT, or SWISS. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7596 |
lpszFace |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7597 |
Typeface Name |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7598 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7599 |
These two above descriptions will be matched as follows: |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7600 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7601 |
foundry - ignored |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7602 |
family - mapped to type face name. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7603 |
weight - mapped to fnWeight |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7604 |
slant - NOT USED INITIALLY user for style |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7605 |
spacing - NOT USED INITIALLY |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7606 |
pixelSize - NOT USED INITIALLY |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7607 |
size - mapped to nHeight |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7608 |
registry - NOT USED INITIALLY |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7609 |
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
|
7610 |
" |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7611 |
|
2232 | 7612 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7613 |
HGDIOBJ hFont; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7614 |
int nHeight, nWidth, nEscapement, nOrientation; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7615 |
char* work; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7616 |
char* work2; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7617 |
DWORD fnWeight; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7618 |
DWORD fdwItalic; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7619 |
DWORD fdwUnderline; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7620 |
DWORD fdwStrikeOut; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7621 |
DWORD fdwCharSet; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7622 |
DWORD fdwOutputPrecision; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7623 |
DWORD fdwClipPrecision; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7624 |
DWORD fdwQuality; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7625 |
DWORD fdwPitchAndFamily; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7626 |
LPCTSTR lpszFace; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7627 |
static char temp[33]; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7628 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7629 |
/* INITIALIZE */ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7630 |
strcpy( temp, " " ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7631 |
lpszFace = &temp[0]; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7632 |
strcpy( (char *)lpszFace, "NULL" ); |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7633 |
nHeight = 0; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7634 |
nWidth = 0; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7635 |
nEscapement = 0; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7636 |
nOrientation = 0; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7637 |
fnWeight = FW_NORMAL; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7638 |
fdwItalic = FALSE; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7639 |
fdwUnderline = FALSE; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7640 |
fdwStrikeOut = FALSE; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7641 |
fdwCharSet = ANSI_CHARSET; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7642 |
fdwOutputPrecision = OUT_DEFAULT_PRECIS; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7643 |
fdwClipPrecision = CLIP_DEFAULT_PRECIS; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7644 |
fdwQuality = DEFAULT_QUALITY; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7645 |
fdwPitchAndFamily = FF_DONTCARE; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7646 |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7647 |
/* SET VALUES */ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7648 |
if ( __isString( family ) ) { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7649 |
work = __stringVal( family ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7650 |
if ( strcmp( work, "nil" ) != 0 ) { |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7651 |
strncpy( (char *)lpszFace, work, 32 ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7652 |
} |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7653 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7654 |
if( __isString( weight ) ) { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7655 |
work = __stringVal( weight ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7656 |
if( strcmp( work, "bold" ) == 0 ) { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7657 |
fnWeight = FW_BOLD; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7658 |
} else { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7659 |
if( strcmp( work, "medium" ) == 0 ) { |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7660 |
fnWeight = FW_MEDIUM; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7661 |
} else { |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7662 |
if( strcmp( work, "demi" ) == 0 ) |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7663 |
fnWeight = FW_LIGHT; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7664 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7665 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7666 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7667 |
if(__isSmallInteger( size ) ) |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7668 |
{ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7669 |
nHeight = __intVal( size ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7670 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7671 |
work2 = __stringVal( slant ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7672 |
work = __stringVal( slant ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7673 |
if( strncmp( work2, "italic", 6 ) == 0 ) |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7674 |
{ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7675 |
fdwItalic = TRUE; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7676 |
if( work2[6] = '-' ) |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7677 |
strncpy( work, &work2[7], ( strlen( work2 ) - 7 ) ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7678 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7679 |
if( strncmp( work, "underline", 9 ) == 0 ) |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7680 |
{ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7681 |
fdwUnderline = TRUE; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7682 |
if( work[10] == '-' ) |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7683 |
strncpy( work2, &work[11], ( strlen( work ) - 10 ) ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7684 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7685 |
if( strncmp( work2, "strikeOut", 9 ) == 0 ) |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7686 |
fdwStrikeOut = TRUE; |
2232 | 7687 |
nHeight = -MulDiv(nHeight, __logPixelSY, 72); |
7688 |
||
7689 |
DPRINTF(("CreateFont %s h=%d\n",lpszFace,nHeight)); |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7690 |
hFont = CreateFont( nHeight, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7691 |
nWidth, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7692 |
nEscapement, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7693 |
nOrientation, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7694 |
fnWeight, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7695 |
fdwItalic, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7696 |
fdwUnderline, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7697 |
fdwStrikeOut, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7698 |
fdwCharSet, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7699 |
fdwOutputPrecision, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7700 |
fdwClipPrecision, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7701 |
fdwQuality, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7702 |
fdwPitchAndFamily, |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7703 |
lpszFace ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7704 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7705 |
if( hFont != NULL ) |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7706 |
{ |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7707 |
DPRINTF(("createFontWithFoundry: %x\n", hFont)); |
2232 | 7708 |
#ifdef COUNT_RESOURCES |
7709 |
__cnt_font++; |
|
7710 |
RES1PRINTF(("CreateFont %d\n",__cnt_font)); |
|
7711 |
#endif |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7712 |
RETURN ( __MKOBJ(hFont) ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7713 |
} |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7714 |
DPRINTF(("***** ERROR createFontWithFoundry failed ERROR *****\n" )); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7715 |
%}. |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7716 |
^ nil |
1127 | 7717 |
|
7718 |
" |
|
7719 |
Display getFontWithFoundry:'*' |
|
7720 |
family:'courier' |
|
7721 |
weight:'medium' |
|
7722 |
slant:'r' |
|
7723 |
spacing:nil |
|
7724 |
pixelSize:nil |
|
7725 |
size:13 |
|
7726 |
registry:'iso8859' |
|
7727 |
encoding:'*' |
|
7728 |
" |
|
7729 |
||
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7730 |
"new NT Version: 20.2.1997 / 22:33:29 / dq" |
2232 | 7731 |
! |
7732 |
||
1127 | 7733 |
listOfAvailableFonts |
7734 |
"return a list with all available fonts on this display. |
|
7735 |
Since this takes a long time, keep the result of the query for the |
|
7736 |
next time. The elements of the returned collection are instances of |
|
7737 |
FontDescription." |
|
7738 |
||
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7739 |
|list typeFaceList| |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7740 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7741 |
listOfFonts notNil ifTrue:[^ listOfFonts]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7742 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7743 |
list := OrderedCollection new. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7744 |
typeFaceList := OrderedCollection new. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7745 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7746 |
[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7747 |
self primEnumFontTypesInto:typeFaceList. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7748 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7749 |
"/Transcript showCR:typeFaceList. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7750 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7751 |
typeFaceList do:[:typeFace | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7752 |
self primEnumFontsIn:typeFace into:list. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7753 |
0 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7754 |
]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7755 |
] valueUninterruptably. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7756 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7757 |
"/Transcript showCR:list. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7758 |
listOfFonts := list |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7759 |
collect:[:anArray | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7760 |
| fntDescr family face style size encoding | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7761 |
family := anArray at:14. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7762 |
face := anArray at:5. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7763 |
style := anArray at:16. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7764 |
size := anArray at:1. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7765 |
encoding := anArray at:15. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7766 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7767 |
fntDescr := FontDescription |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7768 |
family:family |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7769 |
face:face |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7770 |
style:style |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7771 |
size:size |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7772 |
encoding:encoding. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7773 |
fntDescr |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7774 |
]. |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7775 |
|
1127 | 7776 |
^ listOfFonts |
7777 |
||
7778 |
" |
|
7779 |
Display listOfAvailableFonts. |
|
7780 |
||
7781 |
Display getAvailableFontsMatching:'*'. |
|
7782 |
" |
|
7783 |
||
7784 |
"Modified: 27.9.1995 / 10:54:47 / stefan" |
|
7785 |
"Modified: 17.4.1996 / 15:27:57 / cg" |
|
2232 | 7786 |
! |
7787 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7788 |
primEnumFontTypesInto:typeFaceList |
2232 | 7789 |
%{ /* xxLIMITEDSTACK (WIN95) */ |
2151 | 7790 |
if (tmpDC) |
7791 |
{ |
|
7792 |
if ( EnumFontFamilies( tmpDC, NULL, EnumFPTypeFaceProc, (DWORD)&(typeFaceList))) { |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7793 |
DPRINTF(("EnumFonts successful\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7794 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7795 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7796 |
%} |
2232 | 7797 |
! |
7798 |
||
2151 | 7799 |
primEnumFontsIn:typeFace into:fontList |
2232 | 7800 |
%{ /* xxLIMITEDSTACK (WIN95) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7801 |
char *cp; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7802 |
|
2151 | 7803 |
if (__isString(typeFace)) |
7804 |
{ |
|
7805 |
if (tmpDC) { |
|
7806 |
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
|
7807 |
DPRINTF(("EnumFonts Successful\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7808 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7809 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7810 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7811 |
%}. |
2232 | 7812 |
! |
7813 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7814 |
primFontMetricsOf:fontId intoArray:data |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7815 |
"evaluate aBlock, passing a fonts metrics as arguments" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7816 |
|
2232 | 7817 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
7818 |
||
7819 |
if (__isExternalAddress(fontId)) |
|
7820 |
{ |
|
7821 |
SIZE size; |
|
7822 |
int avgWidth; |
|
7823 |
HGDIOBJ hFont; |
|
7824 |
HGDIOBJ prevFont; |
|
7825 |
TEXTMETRIC tmet; |
|
7826 |
int len; |
|
7827 |
hFont = _HGDIOBJVal(fontId); |
|
7828 |
/* |
|
7829 |
* temporarily set this font in the root context |
|
7830 |
*/ |
|
7831 |
prevFont = SelectObject(tmpDC, hFont); |
|
7832 |
GetTextMetrics(tmpDC, &tmet); |
|
7833 |
GetTextExtentPoint32(tmpDC,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrst" |
|
7834 |
"uvwxyz",52,&size); |
|
7835 |
SelectObject(tmpDC, prevFont); |
|
7836 |
avgWidth = (size.cx/26+1)/2; |
|
7837 |
||
7838 |
__ArrayInstPtr(data)->a_element[0] = __MKSMALLINT(tmet.tmAscent); |
|
7839 |
__ArrayInstPtr(data)->a_element[1] = __MKSMALLINT(tmet.tmDescent); |
|
7840 |
__ArrayInstPtr(data)->a_element[2] = __MKSMALLINT(tmet.tmAscent); |
|
7841 |
__ArrayInstPtr(data)->a_element[3] = __MKSMALLINT(tmet.tmDescent); |
|
7842 |
__ArrayInstPtr(data)->a_element[4] = __MKSMALLINT(avgWidth); |
|
7843 |
__ArrayInstPtr(data)->a_element[5] = __MKSMALLINT(tmet.tmMaxCharWidth); |
|
7844 |
__ArrayInstPtr(data)->a_element[6] = __MKSMALLINT(avgWidth); |
|
7845 |
DPRINTF(("textMetrics h=%x avgAsc=%d avgDesc=%d minW=%d maxW=%d avgW=%d\n", |
|
7846 |
hFont, tmet.tmAscent, tmet.tmDescent, avgWidth, tmet.tmMaxCharWidth, |
|
7847 |
tmet.tmAveCharWidth)); |
|
7848 |
RETURN (self); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7849 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7850 |
RETURN (nil); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7851 |
%} |
2232 | 7852 |
! |
7853 |
||
1127 | 7854 |
releaseFont:aFontId |
7855 |
||
2232 | 7856 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7857 |
if (__isExternalAddress(aFontId)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7858 |
HGDIOBJ hFont = _HGDIOBJVal(aFontId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7859 |
if (hFont) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7860 |
{ |
2232 | 7861 |
#ifdef COUNT_RESOURCES |
7862 |
__cnt_font--; |
|
7863 |
RES1PRINTF(("DestroyFont %d\n",__cnt_font)); |
|
7864 |
#endif |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7865 |
DelObject(hFont); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7866 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7867 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7868 |
%} |
2232 | 7869 |
! |
7870 |
||
1127 | 7871 |
sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter |
7872 |
"return a set of all available font sizes in aFamily/aFace/aStyle |
|
7873 |
on this display. |
|
7874 |
Redefined to handle X's special case of 0-size (which stands for any)" |
|
7875 |
||
7876 |
|sizes| |
|
7877 |
||
7878 |
sizes := super sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter. |
|
7879 |
(sizes notNil and:[sizes includes:0]) ifTrue:[ |
|
7880 |
"special: in X11R5 and above, size 0 means: |
|
7881 |
there are scaled versions in all sizes available" |
|
7882 |
||
7883 |
^ #(4 5 6 7 8 9 10 11 12 14 16 18 20 22 24 28 32 48 64) |
|
7884 |
]. |
|
7885 |
^ sizes |
|
7886 |
||
7887 |
" |
|
7888 |
Display sizesInFamily:'courier' face:'bold' style:'roman' |
|
7889 |
" |
|
7890 |
||
7891 |
"Created: 27.2.1996 / 01:38:15 / cg" |
|
2232 | 7892 |
! |
7893 |
||
1127 | 7894 |
widthOf:aString from:index1 to:index2 inFont:aFontId |
7895 |
||
2232 | 7896 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 7897 |
char *cp; |
7898 |
int len, n, i1, i2, l; |
|
7899 |
OBJ cls; |
|
7900 |
int nInstBytes; |
|
7901 |
||
7902 |
if (__bothSmallInteger(index1, index2) |
|
7903 |
&& __isExternalAddress(aFontId) |
|
7904 |
&& __isNonNilObject(aString)) { |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7905 |
HGDIOBJ hFont,prevFont; |
1127 | 7906 |
SIZE tsize; |
7907 |
||
7908 |
hFont = _HGDIOBJVal(aFontId); |
|
7909 |
||
7910 |
i1 = __intVal(index1) - 1; |
|
7911 |
cls = __qClass(aString); |
|
7912 |
||
7913 |
if (i1 >= 0) { |
|
7914 |
i2 = __intVal(index2) - 1; |
|
7915 |
if (i2 < i1) { |
|
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
7916 |
RETURN ( __MKSMALLINT( 0 ) ); |
1127 | 7917 |
} |
7918 |
||
7919 |
cp = (char *) _stringVal(aString); |
|
7920 |
l = i2 - i1 + 1; |
|
7921 |
||
7922 |
if ((cls == @global(String)) || (cls == @global(Symbol))) { |
|
7923 |
n = _stringSize(aString); |
|
2151 | 7924 |
if (i2 < n) |
7925 |
{ |
|
1127 | 7926 |
cp += i1; |
7927 |
||
2151 | 7928 |
prevFont = SelectObject(tmpDC, hFont); |
7929 |
GetTextExtentPoint32(tmpDC, cp, l, &tsize); |
|
2253 | 7930 |
#ifdef xxDEBUG |
2151 | 7931 |
if (__debug__) |
7932 |
{ |
|
7933 |
char buf[80]; |
|
7934 |
GetTextFace(tmpDC,80,buf); |
|
7935 |
printf("font1 %x %s >%s< l=%d dx=%d\n",hFont,buf,cp,l,tsize.cx); |
|
7936 |
} |
|
7937 |
#endif |
|
7938 |
SelectObject(tmpDC, prevFont); |
|
1127 | 7939 |
RETURN ( __MKSMALLINT(tsize.cx) ); |
7940 |
} |
|
7941 |
} |
|
7942 |
||
7943 |
nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars)); |
|
7944 |
cp += nInstBytes; |
|
7945 |
||
7946 |
if (__isBytes(aString)) { |
|
7947 |
n = __byteArraySize(aString) - nInstBytes; |
|
2151 | 7948 |
if (i2 < n) |
7949 |
{ |
|
1127 | 7950 |
cp += i1; |
7951 |
||
2151 | 7952 |
prevFont = SelectObject(tmpDC, hFont); |
7953 |
GetTextExtentPoint32(tmpDC, cp, l, &tsize); |
|
2253 | 7954 |
#ifdef xxDEBUG |
2151 | 7955 |
if (__debug__) |
7956 |
{ |
|
7957 |
char buf[80]; |
|
7958 |
GetTextFace(tmpDC,80,buf); |
|
7959 |
printf("font1 %x %s >%s< l=%d dx=%d\n",hFont,buf,cp,l,tsize.cx); |
|
7960 |
} |
|
7961 |
#endif |
|
7962 |
SelectObject(tmpDC, prevFont); |
|
1127 | 7963 |
RETURN ( __MKSMALLINT(tsize.cx) ); |
7964 |
} |
|
7965 |
} |
|
7966 |
} |
|
7967 |
} |
|
7968 |
#undef NLOCALBUFFER |
|
7969 |
%}. |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7970 |
"/ 'no stringlen' printCR. |
1127 | 7971 |
^ nil |
2232 | 7972 |
! ! |
7973 |
||
7974 |
!WinWorkstation methodsFor:'grabbing '! |
|
7975 |
||
1127 | 7976 |
allowEvents:mode |
2232 | 7977 |
! |
7978 |
||
1127 | 7979 |
grabKeyboardIn:aWindowId |
7980 |
"grab the keyboard" |
|
2232 | 7981 |
%{ |
7982 |
if (__isExternalAddress(aWindowId)) |
|
7983 |
{ |
|
7984 |
HWND hWnd = _HWNDVal(aWindowId); |
|
7985 |
CPRINTF(("grabKeyboard in %x\n",hWnd)); |
|
7986 |
} |
|
7987 |
%} |
|
7988 |
||
7989 |
! |
|
7990 |
||
1127 | 7991 |
grabPointerIn:aWindowId withCursor:aCursorId pointerMode:pMode keyboardMode:kMode confineTo:confineId |
7992 |
"grap the pointer - return true if ok" |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7993 |
|
2232 | 7994 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 7995 |
if (__isExternalAddress(aWindowId)) { |
7996 |
HWND hWnd = _HWNDVal(aWindowId); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7997 |
{ |
2244 | 7998 |
HCURSOR hCursor = 0; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
7999 |
if (currentCapture != CAPTURE_NONE) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8000 |
{ |
2244 | 8001 |
PostMessage(currentPointerView,WM_THREADSETCAPTURE,0,0); |
2232 | 8002 |
//ReleaseCapture(); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8003 |
} |
2232 | 8004 |
#if 1 |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8005 |
if (hWnd == __rootWin) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8006 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8007 |
hWnd = __rootWinSpezial; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8008 |
ShowWindow(hWnd,SW_SHOWNOACTIVATE); |
2253 | 8009 |
//EnableWindow(hWnd,TRUE); |
8010 |
SetWindowPos(hWnd, HWND_TOP, |
|
8011 |
0, 0, 0, 0,SWP_NOREDRAW|SWP_NOSENDCHANGING|SWP_NOCOPYBITS |
|
8012 |
|SWP_NOACTIVATE |SWP_NOMOVE|SWP_NOSIZE); |
|
2232 | 8013 |
CPRINTF(("setRootCapture %x\n",hWnd)); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8014 |
} |
2232 | 8015 |
#endif |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8016 |
if (__isExternalAddress(aCursorId)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8017 |
{ |
2232 | 8018 |
hCursor = _HCURSORVal(aCursorId); |
8019 |
} |
|
2244 | 8020 |
CPRINTF(("grabPointerIn SetCapture %x\n",hWnd)); |
8021 |
PostMessage(hWnd,WM_THREADSETCAPTURE,(INT)hWnd,(INT)hCursor); |
|
2232 | 8022 |
if (__isExternalAddress(aCursorId)) |
8023 |
{ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8024 |
RETURN ( self ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8025 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8026 |
} |
1127 | 8027 |
} |
8028 |
%}. |
|
8029 |
^ true |
|
2232 | 8030 |
! |
8031 |
||
1127 | 8032 |
ungrabKeyboard |
8033 |
"release the keyboard" |
|
8034 |
||
2232 | 8035 |
activeKeyboardGrab := nil. |
8036 |
%{ |
|
8037 |
CPRINTF(("ungrabKeyboard\n")); |
|
8038 |
%} |
|
8039 |
! |
|
8040 |
||
1127 | 8041 |
ungrabPointer |
8042 |
"release the pointer" |
|
8043 |
||
2232 | 8044 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
8045 |
CPRINTF(("ungrabPointer 1\n")); |
|
8046 |
PostThreadMessage(_dispatchThreadId,WM_THREADSETCAPTURE,0,0); |
|
1127 | 8047 |
%}. |
8048 |
activePointerGrab := nil |
|
2232 | 8049 |
! ! |
8050 |
||
8051 |
!WinWorkstation methodsFor:'graphic context stuff'! |
|
8052 |
||
1723 | 8053 |
noClipIn:aWindowId gc:aGCId |
1127 | 8054 |
"disable clipping rectangle" |
8055 |
||
2232 | 8056 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8057 |
|
1723 | 8058 |
if (__isExternalAddress(aWindowId) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8059 |
&& __isExternalAddress(aGCId)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8060 |
{ |
1723 | 8061 |
struct gcData *gcData = _GCDATA(aGCId); |
2232 | 8062 |
gcData->clipping = FALSE; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8063 |
RETURN (self); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8064 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8065 |
%} |
2232 | 8066 |
! |
8067 |
||
1127 | 8068 |
setBackground:bgColorIndex in:aGCId |
8069 |
"set background color to be drawn with" |
|
8070 |
||
2232 | 8071 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 8072 |
|
8073 |
HDC hDC; |
|
8074 |
||
8075 |
if (__isExternalAddress(aGCId)) { |
|
8076 |
struct gcData *gcData = _GCDATA(aGCId); |
|
8077 |
COLORREF bgColor; |
|
8078 |
||
2232 | 8079 |
//hDC = _getDC(gcData); |
2151 | 8080 |
bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData); |
1127 | 8081 |
if (bgColor != gcData->bgColor) { |
8082 |
gcData->bgColor = bgColor; |
|
2251
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
8083 |
// SetBkColor(hDC, bgColor); |
1127 | 8084 |
} |
8085 |
||
8086 |
DPRINTF(("setBackground: %x\n", bgColor)); |
|
2232 | 8087 |
//_releaseDC(gcData); |
1127 | 8088 |
RETURN (self); |
8089 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8090 |
%} |
2232 | 8091 |
! |
8092 |
||
1127 | 8093 |
setBitmapMask:aBitmapId in:aGCId |
8094 |
"set or clear the drawing mask - a bitmap mask using current fg/bg" |
|
8095 |
||
2232 | 8096 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 8097 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8098 |
if (__isExternalAddress(aGCId)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8099 |
{ |
2151 | 8100 |
struct gcData *gcData = _GCDATA(aGCId); |
2232 | 8101 |
//HDC hDC = _getDC(gcData); |
2151 | 8102 |
if (__isExternalAddress(aBitmapId)) |
8103 |
gcData->hMask = _HBITMAPVAL(aBitmapId); |
|
8104 |
else |
|
8105 |
gcData->hMask = 0; |
|
8106 |
||
8107 |
DPRINTF(("masks set to %x\n",gcData->hMask)); |
|
2232 | 8108 |
//_releaseDC(gcData); |
1127 | 8109 |
RETURN (self); |
8110 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8111 |
%} |
2232 | 8112 |
! |
8113 |
||
1685 | 8114 |
setClipByChildren:aBool in:aWindowId gc:aGCId |
1127 | 8115 |
"enable/disable drawing into child views" |
8116 |
||
2232 | 8117 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8118 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8119 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8120 |
if (ISCONNECTED && __isExternalAddress(aGCId)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8121 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8122 |
struct gcData *gcData = _GCDATA(aGCId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8123 |
if (gcData && gcData->hWnd) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8124 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8125 |
if( aBool == true ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8126 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8127 |
/* set clip by child */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8128 |
if (gcData->hWnd) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8129 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8130 |
gcData->clipByChild = TRUE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8131 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8132 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8133 |
} else { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8134 |
if (gcData->hWnd) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8135 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8136 |
gcData->clipByChild = FALSE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8137 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8138 |
} |
1685 | 8139 |
} else { |
8140 |
DPRINTF(("clipping by child failed - invalid win\n" )); |
|
8141 |
} |
|
8142 |
} |
|
1127 | 8143 |
%}. |
1723 | 8144 |
^ self |
2232 | 8145 |
! |
8146 |
||
1723 | 8147 |
setClipX:clipX y:clipY width:clipWidth height:clipHeight in:aDrawableId gc:aGCId |
1127 | 8148 |
"clip to a rectangle" |
8149 |
||
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
8150 |
" |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
8151 |
p--w--- |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
8152 |
| | |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
8153 |
h | the clipping rectangle |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
8154 |
| | |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
8155 |
------- |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
8156 |
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
|
8157 |
" |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
8158 |
|
2232 | 8159 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8160 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8161 |
/*RETURN (self);*/ |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
8162 |
if ( __isExternalAddress(aGCId) |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
8163 |
&& __bothSmallInteger(clipX, clipY) |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
8164 |
&& __bothSmallInteger(clipWidth, clipHeight) ) { |
1723 | 8165 |
struct gcData *gcData = _GCDATA(aGCId); |
2232 | 8166 |
gcData->clipping = TRUE; |
8167 |
gcData->clipX = __intVal(clipX); |
|
8168 |
gcData->clipY = __intVal(clipY); |
|
8169 |
gcData->clipW = __intVal(clipWidth); |
|
8170 |
gcData->clipH = __intVal(clipHeight); |
|
1127 | 8171 |
RETURN (self); |
8172 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8173 |
%} |
2232 | 8174 |
! |
8175 |
||
1127 | 8176 |
setDashes:dashList dashOffset:offset in:aGCId |
8177 |
"set line attributes" |
|
8178 |
||
2232 | 8179 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 8180 |
|
8181 |
if (__isExternalAddress(aGCId)) { |
|
2232 | 8182 |
PRINTF(("dashes not yet implemented\n")); |
1127 | 8183 |
RETURN (self); |
8184 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8185 |
%} |
2232 | 8186 |
! |
8187 |
||
1127 | 8188 |
setFont:aFontId in:aGCId |
8189 |
"set font to be drawn in" |
|
8190 |
||
2232 | 8191 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 8192 |
|
8193 |
if (__isExternalAddress(aGCId) |
|
2151 | 8194 |
&& __isExternalAddress(aFontId)) |
8195 |
{ |
|
1127 | 8196 |
struct gcData *gcData = _GCDATA(aGCId); |
8197 |
HDC hDC; |
|
8198 |
HGDIOBJ hFont; |
|
8199 |
TEXTMETRIC tmet; |
|
8200 |
||
2232 | 8201 |
hDC = _getDC(gcData); |
1127 | 8202 |
hFont = _HGDIOBJVal(aFontId); |
2232 | 8203 |
gcData->hFont = hFont; |
8204 |
hFont = SelectObject(hDC, hFont); |
|
1127 | 8205 |
GetTextMetrics(hDC, &tmet); |
8206 |
gcData->fontAscent = tmet.tmAscent; |
|
2151 | 8207 |
#ifdef DEBUG |
8208 |
if (__debug__) |
|
8209 |
{ |
|
8210 |
char buf[80]; |
|
8211 |
GetTextFace(hDC,80,buf); |
|
8212 |
PRINTF(("setFont: %x %s\n", hFont,buf)); |
|
8213 |
} |
|
8214 |
#endif |
|
2232 | 8215 |
SelectObject(hDC, hFont); |
8216 |
_releaseDC(gcData); |
|
1127 | 8217 |
RETURN ( self ); |
8218 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8219 |
%} |
2232 | 8220 |
! |
8221 |
||
1127 | 8222 |
setForeground:fgColorIndex background:bgColorIndex in:aGCId |
8223 |
"set foreground and background colors to be drawn with" |
|
8224 |
||
2232 | 8225 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 8226 |
|
2251
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
8227 |
if (__isExternalAddress(aGCId)) |
2232 | 8228 |
{ |
1127 | 8229 |
struct gcData *gcData = _GCDATA(aGCId); |
2232 | 8230 |
gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData); |
8231 |
gcData->bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData); |
|
8232 |
DPRINTF(("setForeground: %x background: %x\n", gcData->fgColor, gcData->bgColor)); |
|
1127 | 8233 |
RETURN (self); |
8234 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8235 |
%} |
2232 | 8236 |
! |
8237 |
||
1127 | 8238 |
setForeground:fgColorIndex background:bgColorIndex mask:aBitmapId in:aGCId |
8239 |
"set foreground and background colors to be drawn with using mask or |
|
8240 |
solid (if aBitmapId is nil)" |
|
8241 |
||
2232 | 8242 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8243 |
|
2251
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
8244 |
if (__isExternalAddress(aGCId)) |
2232 | 8245 |
{ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8246 |
struct gcData *gcData = _GCDATA(aGCId); |
2232 | 8247 |
gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData); |
8248 |
gcData->bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData); |
|
2151 | 8249 |
if (__isExternalAddress(aBitmapId)) |
8250 |
gcData->hMask = _HBITMAPVAL(aBitmapId); |
|
8251 |
else |
|
8252 |
gcData->hMask = 0; |
|
2232 | 8253 |
DDPRINTF(("setForeground: %x background: %x\n", gcData->fgColor, gcData->bgColor)); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8254 |
RETURN (self); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8255 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8256 |
%} |
2232 | 8257 |
! |
8258 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8259 |
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
|
8260 |
"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
|
8261 |
solid (if aBitmapId is nil); also set lineWidth" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8262 |
|
2232 | 8263 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 8264 |
|
2251
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
8265 |
if (__isExternalAddress(aGCId)) |
2232 | 8266 |
{ |
1127 | 8267 |
struct gcData *gcData = _GCDATA(aGCId); |
2232 | 8268 |
gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData); |
8269 |
gcData->bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData); |
|
8270 |
gcData->lineWidth = __intVal(lw); |
|
2151 | 8271 |
if (__isExternalAddress(aBitmapId)) |
8272 |
gcData->hMask = _HBITMAPVAL(aBitmapId); |
|
8273 |
else |
|
8274 |
gcData->hMask = 0; |
|
2232 | 8275 |
DDPRINTF(("setForeground: %x background: %x\n", gcData->fgColor, gcData->bgColor)); |
1127 | 8276 |
RETURN (self); |
8277 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8278 |
%} |
2232 | 8279 |
! |
8280 |
||
1127 | 8281 |
setForeground:fgColorIndex in:aGCId |
8282 |
"set foreground color to be drawn with" |
|
8283 |
||
2232 | 8284 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 8285 |
|
8286 |
HDC hDC; |
|
8287 |
||
2232 | 8288 |
if (__isExternalAddress(aGCId)) |
8289 |
{ |
|
1127 | 8290 |
struct gcData *gcData = _GCDATA(aGCId); |
2232 | 8291 |
gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData); |
1127 | 8292 |
DDPRINTF(("setForeground: %x\n", fgColor)); |
8293 |
RETURN (self); |
|
8294 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8295 |
%} |
2232 | 8296 |
! |
8297 |
||
1127 | 8298 |
setFunction:aFunctionSymbol in:aGCId |
8299 |
"set alu function to be drawn with" |
|
8300 |
||
2232 | 8301 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
8302 |
||
8303 |
||
8304 |
if (__isExternalAddress(aGCId)) |
|
8305 |
{ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8306 |
struct gcData *gcData = _GCDATA(aGCId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8307 |
int fun = -1; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8308 |
int bfun = -1; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8309 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8310 |
if (aFunctionSymbol == @symbol(copy)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8311 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8312 |
fun = R2_COPYPEN; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8313 |
bfun = BITBLT_COPY; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8314 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8315 |
else if (aFunctionSymbol == @symbol(copyInverted)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8316 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8317 |
fun = R2_NOTCOPYPEN; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8318 |
bfun = BITBLT_COPYINVERTED; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8319 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8320 |
else if (aFunctionSymbol == @symbol(xor)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8321 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8322 |
fun = R2_XORPEN; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8323 |
bfun = BITBLT_XOR; |
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 |
else if (aFunctionSymbol == @symbol(and)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8326 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8327 |
fun = R2_MASKPEN; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8328 |
bfun = BITBLT_AND; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8329 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8330 |
else if (aFunctionSymbol == @symbol(or)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8331 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8332 |
fun = R2_MERGEPEN; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8333 |
bfun = BITBLT_OR; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8334 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8335 |
if (fun != -1) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8336 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8337 |
#if 0 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8338 |
printf("set func to"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8339 |
switch (bfun) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8340 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8341 |
case BITBLT_COPY: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8342 |
printf("BITBLT_COPY\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8343 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8344 |
case BITBLT_COPYINVERTED: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8345 |
printf("BITBLT_COPYINVERTED\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8346 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8347 |
case BITBLT_XOR: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8348 |
printf("BITBLT_XOR\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8349 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8350 |
case BITBLT_AND: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8351 |
printf("BITBLT_AND\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8352 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8353 |
case BITBLT_OR: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8354 |
printf("BITBLT_OR\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8355 |
break; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8356 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8357 |
#endif |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8358 |
gcData->rop2 = fun; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8359 |
gcData->bitbltrop2 = bfun; |
1127 | 8360 |
} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8361 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8362 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8363 |
printf("unsuported Rasterfunction\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8364 |
gcData->rop2 = R2_COPYPEN; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8365 |
gcData->bitbltrop2 = BITBLT_COPY; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8366 |
} |
1127 | 8367 |
RETURN (self); |
8368 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8369 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8370 |
printf("Rasterfunction no GC\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8371 |
%} |
2232 | 8372 |
! |
8373 |
||
1127 | 8374 |
setGraphicsExposures:aBoolean in:aGCId |
8375 |
"set or clear the graphics exposures flag" |
|
8376 |
||
2232 | 8377 |
! |
8378 |
||
1127 | 8379 |
setLineWidth:aNumber style:lineStyle cap:capStyle join:joinStyle in:aGCId |
8380 |
"set line attributes" |
|
8381 |
||
2232 | 8382 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 8383 |
|
8384 |
HDC hDC; |
|
8385 |
||
8386 |
if (__isExternalAddress(aGCId) |
|
8387 |
&& __isSmallInteger(aNumber)) { |
|
8388 |
struct gcData *gcData = _GCDATA(aGCId); |
|
8389 |
||
8390 |
gcData->lineWidth = __intVal(aNumber); |
|
8391 |
if (lineStyle == @symbol(solid)) { |
|
8392 |
gcData->lineStyle = PS_SOLID; |
|
8393 |
} else if (lineStyle == @symbol(dashed)) { |
|
2232 | 8394 |
gcData->lineStyle = PS_DASH; |
1127 | 8395 |
} else |
2151 | 8396 |
gcData->lineStyle = PS_SOLID; |
1127 | 8397 |
|
8398 |
if (capStyle == @symbol(round)) { |
|
8399 |
gcData->capStyle = PS_ENDCAP_ROUND; |
|
8400 |
} else if (capStyle == @symbol(square)) { |
|
8401 |
gcData->capStyle = PS_ENDCAP_SQUARE; |
|
8402 |
} else if (capStyle == @symbol(flat)) { |
|
8403 |
gcData->capStyle = PS_ENDCAP_FLAT; |
|
8404 |
} else |
|
8405 |
gcData->capStyle = PS_ENDCAP_FLAT; |
|
8406 |
||
8407 |
if (joinStyle == @symbol(bevel)) { |
|
8408 |
gcData->joinStyle = PS_JOIN_BEVEL; |
|
8409 |
} else if (joinStyle == @symbol(miter)) { |
|
8410 |
gcData->joinStyle = PS_JOIN_MITER; |
|
8411 |
} else if (joinStyle == @symbol(round)) { |
|
8412 |
gcData->joinStyle = PS_JOIN_ROUND; |
|
8413 |
} else |
|
8414 |
gcData->joinStyle = PS_JOIN_MITER; |
|
8415 |
||
8416 |
RETURN (self); |
|
8417 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8418 |
%} |
2232 | 8419 |
! |
8420 |
||
1127 | 8421 |
setMaskOriginX:orgX y:orgY in:aGCId |
8422 |
"set the mask origin" |
|
8423 |
||
2232 | 8424 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
8425 |
||
8426 |
if (__isExternalAddress(aGCId)) |
|
8427 |
{ |
|
8428 |
if (__bothSmallInteger(orgX,orgY)) |
|
8429 |
{ |
|
8430 |
struct gcData *gcData = _GCDATA(aGCId); |
|
8431 |
int nXOrg = __intVal(orgX); |
|
8432 |
int nYOrg = __intVal(orgY); |
|
8433 |
HDC hDC = _getDC(gcData); |
|
8434 |
SetBrushOrgEx(hDC,nXOrg,nYOrg,0); |
|
8435 |
DPRINTF(("mask origin at x=%d y=%d\n",nXOrg,nYOrg)); |
|
8436 |
_releaseDC(gcData); |
|
8437 |
RETURN (self); |
|
8438 |
} |
|
8439 |
} |
|
8440 |
%} |
|
8441 |
! |
|
8442 |
||
8443 |
setPixmapMask:aPixmapId in:aGCId |
|
8444 |
"set or clear the drawing mask - a pixmap mask providing full color" |
|
8445 |
||
8446 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
|
8447 |
if (__isExternalAddress(aGCId)) |
|
8448 |
{ |
|
8449 |
struct gcData *gcData = _GCDATA(aGCId); |
|
8450 |
//HDC hDC = _getDC(gcData); |
|
8451 |
if (__isExternalAddress(aPixmapId)) |
|
8452 |
gcData->hMask = _HBITMAPVAL(aPixmapId); |
|
8453 |
else |
|
8454 |
gcData->hMask = 0; |
|
8455 |
||
8456 |
DPRINTF(("PixmapMasks set to %x\n",gcData->hMask)); |
|
8457 |
//_releaseDC(gcData); |
|
1127 | 8458 |
RETURN (self); |
8459 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8460 |
%} |
2232 | 8461 |
! ! |
8462 |
||
8463 |
!WinWorkstation methodsFor:'initialize / release'! |
|
8464 |
||
1127 | 8465 |
close |
8466 |
"close down the connection to the X-server" |
|
8467 |
||
2232 | 8468 |
! |
8469 |
||
1127 | 8470 |
initializeDefaultValues |
1723 | 8471 |
focusMode := #activeWindow. |
8472 |
||
1127 | 8473 |
buttonTranslation := ButtonTranslation. |
8474 |
multiClickTimeDelta := MultiClickTimeDelta. |
|
8475 |
||
8476 |
self initializeModifierMappings |
|
2232 | 8477 |
! |
8478 |
||
1127 | 8479 |
initializeEventBuffer |
2232 | 8480 |
|sz| |
8481 |
||
8482 |
%{ |
|
8483 |
sz = __MKSMALLINT(sizeof(struct queuedEvent) + 100); |
|
8484 |
%}. |
|
8485 |
eventBuffer isNil ifTrue:[ |
|
8486 |
eventBuffer := ByteArray new:sz. |
|
8487 |
]. |
|
8488 |
! |
|
8489 |
||
1127 | 8490 |
initializeFor:aDisplayName |
8491 |
"initialize the receiver for a connection to an X-Server; |
|
8492 |
the argument, aDisplayName may be nil (for the default server from |
|
2232 | 8493 |
DISPLAY-variable or command line argument) or the name of the server |
1127 | 8494 |
as hostname:number" |
8495 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8496 |
displayId notNil ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8497 |
"/ already connected - trying to trick me ? |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8498 |
^ self |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8499 |
]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8500 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8501 |
displayId := self primInitializeFor:aDisplayName. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8502 |
displayId isNil ifTrue:[^ self]. |
1127 | 8503 |
|
8504 |
dispatching := false. |
|
8505 |
isSlow := false. |
|
8506 |
shiftDown := false. |
|
8507 |
ctrlDown := false. |
|
8508 |
metaDown := false. |
|
8509 |
altDown := false. |
|
8510 |
motionEventCompression := true. |
|
8511 |
buttonsPressed := 0. |
|
8512 |
||
8513 |
self initializeScreenProperties. |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
8514 |
self initializeDeviceResourceTables. |
1127 | 8515 |
|
8516 |
self initializeDefaultValues. |
|
8517 |
self initializeEventBuffer. |
|
8518 |
self initializeSpecialFlags. |
|
8519 |
self initializeKeyboardMap. |
|
2232 | 8520 |
! |
8521 |
||
1127 | 8522 |
initializeModifierMappings |
8523 |
shiftModifiers := #(#'Shift_L' #'Shift_R' #'Shift'). |
|
8524 |
ctrlModifiers := #(#'Ctrl_L' #'Ctrl_R' #'Ctrl'). |
|
8525 |
metaModifiers := #(#'Alt_L' #'Alt'). |
|
8526 |
altModifiers := #(#'Alt_R'). |
|
2232 | 8527 |
! |
8528 |
||
1127 | 8529 |
initializeScreenProperties |
8530 |
super initializeScreenProperties. |
|
8531 |
||
2232 | 8532 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 8533 |
|
8534 |
int scr; |
|
8535 |
int maxRGBDepth; |
|
8536 |
int rgbRedMask, rgbGreenMask, rgbBlueMask; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8537 |
int nvi, i, val, capabilities,__planes,__numcolors,__numpens,__ras; |
1127 | 8538 |
char *type, *nm; |
8539 |
int dummy; |
|
8540 |
int mask, shift, nBits; |
|
8541 |
RECT rect; |
|
8542 |
HDC _rootDC; |
|
8543 |
OBJ id; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8544 |
if (firstInstance) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8545 |
{ |
2232 | 8546 |
OSVERSIONINFO osvi; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8547 |
WNDCLASS wc; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8548 |
firstInstance = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8549 |
DPRINTF(("first create - registerClass\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8550 |
|
2232 | 8551 |
memset(&osvi, 0, sizeof(OSVERSIONINFO)); |
8552 |
osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); |
|
8553 |
GetVersionEx (&osvi); |
|
8554 |
||
8555 |
if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) |
|
8556 |
{ |
|
8557 |
__isWinNT = 1; |
|
8558 |
} |
|
8559 |
else |
|
8560 |
{ |
|
8561 |
__isWinNT = 0; |
|
8562 |
} |
|
8563 |
||
8564 |
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
|
8565 |
wc.lpfnWndProc = (WNDPROC) MainWndProc; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8566 |
wc.cbClsExtra = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8567 |
wc.cbWndExtra = N_WINDOW_PRIVATE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8568 |
wc.hInstance = (HANDLE) __getHInstance(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8569 |
wc.hIcon = NULL; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8570 |
wc.hCursor = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8571 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8572 |
wc.hbrBackground = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8573 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8574 |
wc.lpszMenuName = NULL; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8575 |
wc.lpszClassName = app_name; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8576 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8577 |
if (!RegisterClass(&wc)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8578 |
DPRINTF(("RegisterClass failed\n")); |
2151 | 8579 |
/* return NULL; */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8580 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8581 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8582 |
wc.style = 0; |
2253 | 8583 |
wc.lpfnWndProc = (WNDPROC) MainWndProc;// Root; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8584 |
wc.cbClsExtra = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8585 |
wc.cbWndExtra = N_WINDOW_PRIVATE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8586 |
wc.hInstance = (HANDLE) __getHInstance(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8587 |
wc.hIcon = NULL; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8588 |
wc.hCursor = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8589 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8590 |
wc.hbrBackground = GetStockObject(HOLLOW_BRUSH); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8591 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8592 |
wc.lpszMenuName = NULL; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8593 |
wc.lpszClassName = app_nameroot; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8594 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8595 |
if (!RegisterClass(&wc)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8596 |
DPRINTF(("RegisterClass failed\n")); |
2151 | 8597 |
/* return NULL; */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8598 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8599 |
hCreateEvent = CreateEvent( |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8600 |
NULL, /* no security attributes */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8601 |
FALSE, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8602 |
FALSE, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8603 |
THREADEVENTNAME); /* name of mutex */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8604 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8605 |
if (hCreateEvent == NULL) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8606 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8607 |
DPRINTF(("CreateEvent failed\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8608 |
/* return NULL; */ |
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 |
hInputEvent = CreateEvent( |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8611 |
NULL, /* no security attributes */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8612 |
FALSE, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8613 |
FALSE, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8614 |
THREADINPUTEVENTNAME); /* name of mutex */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8615 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8616 |
if (hInputEvent == NULL) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8617 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8618 |
DPRINTF(("InputEvent failed\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8619 |
/* return NULL; */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8620 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8621 |
hdispatchMutex = CreateMutex( |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8622 |
NULL, /* no security attributes */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8623 |
FALSE, /* initially not owned */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8624 |
THREADMUTEXNAME); /* name of mutex */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8625 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8626 |
if (hdispatchMutex == NULL) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8627 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8628 |
DPRINTF(("CreateMutex failed\n")); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8629 |
/* return NULL; */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8630 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8631 |
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
|
8632 |
|
2232 | 8633 |
/*__setWaitInputEvent(waitInputEvent);*/ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8634 |
bdispatchThreadState = TRUE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8635 |
_masterThreadId = GetCurrentThreadId(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8636 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8637 |
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
|
8638 |
|
2244 | 8639 |
initqueue(); |
2232 | 8640 |
_beginthread(dispatchThread, 4096, 0); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8641 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8642 |
DWORD dwWaitResult; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8643 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8644 |
/* Request ownership of mutex. */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8645 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8646 |
dwWaitResult = WaitForSingleObject( |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8647 |
hCreateEvent, /* handle of mutex */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8648 |
5000L); /* time-out interval */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8649 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8650 |
} |
2151 | 8651 |
multiClickTime = GetDoubleClickTime(); |
8652 |
DPRINTF(("multiClickTime = %d\n",multiClickTime)); |
|
2232 | 8653 |
|
8654 |
#if 0 |
|
8655 |
__rootDesk = OpenDesktop ("Desktop0", 0, FALSE, GENERIC_ALL); |
|
8656 |
if (!__rootDesk) |
|
8657 |
{ |
|
8658 |
PRINTF(("OpenDesktop fail\n")); |
|
8659 |
__rootDesk = CreateDesktop ("Desktop0", NULL,NULL,0,DESKTOP_WRITEOBJECTS,NULL); |
|
8660 |
if (!__rootDesk) |
|
8661 |
{ |
|
8662 |
PRINTF(("CreateDesktop fail\n")); |
|
8663 |
} |
|
8664 |
} |
|
8665 |
#endif |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8666 |
__rootWin = GetDesktopWindow(); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8667 |
__PROTECT__(self); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8668 |
id = __MKOBJ(__rootWin); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8669 |
__UNPROTECT__(self); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8670 |
__INST(rootWin) = id; __STORE(self, id); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8671 |
|
2232 | 8672 |
_rootDC = CreateDC("DISPLAY", NULL, NULL, NULL); |
2151 | 8673 |
|
8674 |
tmpDC = CreateCompatibleDC(_rootDC); |
|
8675 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8676 |
__PROTECT__(self); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8677 |
id = __MKOBJ(_rootDC); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8678 |
__UNPROTECT__(self); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8679 |
__INST(rootDC) = id; __STORE(self, id); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8680 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8681 |
GetWindowRect(__rootWin, &rect); |
1127 | 8682 |
__INST(width) = __MKSMALLINT(rect.right-rect.left); |
8683 |
__INST(height) = __MKSMALLINT(rect.bottom-rect.top); |
|
2151 | 8684 |
DPRINTF(("screen is %d/%d\n", __intVal(__INST(width)), __intVal(__INST(height)))); |
1127 | 8685 |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8686 |
__planes = GetDeviceCaps(_rootDC, PLANES); |
2232 | 8687 |
|
8688 |
#ifndef ALWAYSTRUECOLOR |
|
1127 | 8689 |
__depth = GetDeviceCaps(_rootDC, BITSPIXEL); |
2232 | 8690 |
#else |
8691 |
__depth = 24; /* its a hack */ |
|
8692 |
#endif |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8693 |
if (__depth == 15) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8694 |
__depth = 16; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8695 |
|
2232 | 8696 |
#if 0 |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8697 |
__numcolors = GetDeviceCaps(_rootDC, NUMCOLORS); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8698 |
__numpens = GetDeviceCaps(_rootDC, NUMPENS); |
2151 | 8699 |
DPRINTF(("screen has %d planes\n",__planes)); |
8700 |
DPRINTF(("numcolors is %d\n",__numcolors)); |
|
8701 |
DPRINTF(("numpens is %d\n",__numpens)); |
|
2232 | 8702 |
#endif |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8703 |
__ras = GetDeviceCaps(_rootDC, RASTERCAPS); |
2151 | 8704 |
#if 0 |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8705 |
printf("device support:\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8706 |
if (__ras & RC_BANDING) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8707 |
printf(" RC_BANDING"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8708 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8709 |
if (__ras & RC_BITBLT) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8710 |
printf(" RC_BITBLT"); |
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 |
if (__ras & RC_BITMAP64) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8713 |
printf(" RC_BITMAP64"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8714 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8715 |
if (__ras & RC_DI_BITMAP) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8716 |
printf(" RC_DI_BITMAP"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8717 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8718 |
if (__ras & RC_DIBTODEV) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8719 |
printf(" RC_DIBTODEV"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8720 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8721 |
if (__ras & RC_FLOODFILL) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8722 |
printf(" RC_FLOODFILL"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8723 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8724 |
if (__ras & RC_PALETTE) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8725 |
printf(" RC_PALETTE"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8726 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8727 |
if (__ras & RC_SCALING) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8728 |
printf(" RC_SCALING"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8729 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8730 |
if (__ras & RC_STRETCHBLT) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8731 |
printf(" RC_STRETCHBLT"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8732 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8733 |
if (__ras & RC_STRETCHDIB) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8734 |
printf(" RC_STRETCHDIB"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8735 |
printf("\n"); |
2151 | 8736 |
printf("cursor size %d %d\n",GetSystemMetrics(SM_CXCURSOR),GetSystemMetrics(SM_CYCURSOR)); |
8737 |
||
8738 |
#endif |
|
8739 |
||
1127 | 8740 |
__INST(depth) = __MKSMALLINT(__depth); |
8741 |
__INST(ncells) = __MKSMALLINT(1<<__depth); |
|
8742 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8743 |
|
1127 | 8744 |
val = GetDeviceCaps(_rootDC, HORZSIZE); |
2151 | 8745 |
DPRINTF(("HORSIZE=%d\n",val)); |
1127 | 8746 |
__INST(widthMM) = __MKSMALLINT(val); |
8747 |
val = GetDeviceCaps(_rootDC, VERTSIZE); |
|
2151 | 8748 |
DPRINTF(("VERTSIZE=%d\n",val)); |
1127 | 8749 |
__INST(heightMM) = __MKSMALLINT(val); |
8750 |
||
8751 |
||
2232 | 8752 |
__logPixelSY = GetDeviceCaps(_rootDC, LOGPIXELSY); |
1127 | 8753 |
capabilities = GetDeviceCaps(_rootDC, RASTERCAPS); |
8754 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8755 |
__INST(whitepixel) = __MKSMALLINT(WhitePixel); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8756 |
__INST(blackpixel) = __MKSMALLINT(BlackPixel); |
1127 | 8757 |
|
2232 | 8758 |
#ifndef ALWAYSTRUECOLOR |
8759 |
if (! (capabilities & RC_PALETTE)) |
|
8760 |
#endif |
|
8761 |
{ |
|
1127 | 8762 |
DPRINTF(("no palette\n")); |
8763 |
if (__depth == 1) { |
|
8764 |
__INST(visualType) = @symbol(GrayScale); |
|
8765 |
__INST(hasColors) = false; |
|
8766 |
__INST(hasGreyscales) = false; |
|
8767 |
__INST(monitorType) = @symbol(monochrome); |
|
8768 |
} else { |
|
8769 |
__INST(hasColors) = true; |
|
8770 |
__INST(hasGreyscales) = true; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8771 |
if ((__depth == 16) || (__depth == 15)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8772 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8773 |
__INST(visualType) = @symbol(TrueColor); |
2232 | 8774 |
__INST(blueShift) = __MKSMALLINT(0); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8775 |
__INST(greenShift) = __MKSMALLINT(5); |
2232 | 8776 |
__INST(redShift) = __MKSMALLINT(11); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8777 |
__INST(bitsPerRGB) = __MKSMALLINT(5); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8778 |
__INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(5); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8779 |
__INST(blueMask) = __MKSMALLINT(0x1f); |
2232 | 8780 |
__INST(greenMask) = __MKSMALLINT(0x7e0); |
8781 |
__INST(redMask) = __MKSMALLINT(0xf800); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8782 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8783 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8784 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8785 |
__INST(visualType) = @symbol(TrueColor); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8786 |
__INST(redShift) = __MKSMALLINT(0); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8787 |
__INST(greenShift) = __MKSMALLINT(8); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8788 |
__INST(blueShift) = __MKSMALLINT(16); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8789 |
__INST(bitsPerRGB) = __MKSMALLINT(8); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8790 |
__INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(8); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8791 |
__INST(redMask) = __MKSMALLINT(0xFF); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8792 |
__INST(greenMask) = __MKSMALLINT(0xFF00); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8793 |
__INST(blueMask) = __MKSMALLINT(0xFF0000); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8794 |
} |
1127 | 8795 |
} |
2232 | 8796 |
} |
8797 |
#ifndef ALWAYSTRUECOLOR |
|
8798 |
else |
|
8799 |
{ |
|
1127 | 8800 |
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
|
8801 |
printf("SizeofPalette %d\n",val); |
1127 | 8802 |
__INST(ncells) = __MKSMALLINT(val); |
8803 |
__INST(blackpixel) = __MKSMALLINT(0); |
|
8804 |
__INST(whitepixel) = __MKSMALLINT(1); |
|
8805 |
__INST(hasColors) = true; |
|
8806 |
__INST(hasGreyscales) = true; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8807 |
__INST(usingSystemPalette) = true; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8808 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8809 |
__INST(redShift) = __MKSMALLINT(0); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8810 |
__INST(greenShift) = __MKSMALLINT(2); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8811 |
__INST(blueShift) = __MKSMALLINT(4); |
2232 | 8812 |
__INST(bitsPerRGB) = __MKSMALLINT(2); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8813 |
__INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(2); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8814 |
__INST(redMask) = __MKSMALLINT(0x3); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8815 |
__INST(greenMask) = __MKSMALLINT(0xc); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8816 |
__INST(blueMask) = __MKSMALLINT(0x30); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8817 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8818 |
} |
2232 | 8819 |
#endif |
1127 | 8820 |
__INST(monitorType) = @symbol(unknown); |
8821 |
||
8822 |
%}. |
|
2232 | 8823 |
! |
8824 |
||
1127 | 8825 |
initializeSpecialFlags |
8826 |
"perform additional special server implementation flags" |
|
2232 | 8827 |
! |
8828 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8829 |
primInitializeFor:aDisplayName |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8830 |
"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
|
8831 |
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
|
8832 |
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
|
8833 |
as hostname:number" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8834 |
|
2232 | 8835 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8836 |
RETURN ( __MKSMALLINT(1) ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8837 |
%}. |
2232 | 8838 |
! |
8839 |
||
1127 | 8840 |
reinitialize |
8841 |
rootWin := rootDC := nil. |
|
8842 |
super reinitialize. |
|
2232 | 8843 |
! ! |
8844 |
||
8845 |
!WinWorkstation methodsFor:'keyboard mapping'! |
|
8846 |
||
1127 | 8847 |
altModifierMask |
8848 |
"return the mask (in motionEvents) for the alt-key modifier. |
|
8849 |
Notice: ST/X may use the left ALT key as CMD/Meta key, |
|
8850 |
therefore return a variable here, which can be changed during startup." |
|
8851 |
||
8852 |
%{ /* NOCONTEXT */ |
|
8853 |
RETURN (__MKSMALLINT(AltMask)); |
|
8854 |
%} |
|
8855 |
||
8856 |
"Created: 23.3.1996 / 12:43:22 / cg" |
|
8857 |
"Modified: 23.3.1996 / 12:44:56 / cg" |
|
2232 | 8858 |
! |
8859 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8860 |
leftAltMask |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8861 |
"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
|
8862 |
See comment in altModifierMask: / metaModifierMask: for what |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8863 |
this could be used." |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8864 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8865 |
%{ /* NOCONTEXT */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8866 |
RETURN (__MKSMALLINT(LeftAltMask)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8867 |
%} |
2232 | 8868 |
! |
8869 |
||
1127 | 8870 |
metaModifierMask |
8871 |
"return the mask (in motionEvents) for the meta-key modifier. |
|
8872 |
Notice: ST/X may use the left ALT key as CMD/Meta key, |
|
8873 |
therefore return a variable here, which can be changed during startup." |
|
8874 |
||
8875 |
%{ /* NOCONTEXT */ |
|
8876 |
RETURN (__MKSMALLINT(MetaMask)); |
|
8877 |
%} |
|
8878 |
||
8879 |
"Created: 23.3.1996 / 12:43:39 / cg" |
|
8880 |
"Modified: 23.3.1996 / 12:45:09 / cg" |
|
2232 | 8881 |
! |
8882 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8883 |
modifierMapping |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8884 |
"Get the Modifier Mapping. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8885 |
We return an array of arrays of keycodes" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8886 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8887 |
^ nil |
2232 | 8888 |
! |
8889 |
||
1127 | 8890 |
rightAltMask |
8891 |
"return the mask bit for the right Alt modifier key. |
|
8892 |
See comment in altModifierMask: / metaModifierMask: for what |
|
8893 |
this could be used." |
|
8894 |
||
8895 |
%{ /* NOCONTEXT */ |
|
8896 |
RETURN (__MKSMALLINT(RightAltMask)); |
|
8897 |
%} |
|
2232 | 8898 |
! |
8899 |
||
1127 | 8900 |
stringFromKeycode:code |
8901 |
"Get a KeySymbol (a smalltalk symbol) from the keycode." |
|
8902 |
||
8903 |
^ '' |
|
8904 |
||
8905 |
" |
|
8906 |
Display stringFromKeycode:28 |
|
8907 |
" |
|
2232 | 8908 |
! ! |
8909 |
||
8910 |
!WinWorkstation methodsFor:'misc'! |
|
8911 |
||
1127 | 8912 |
beep |
8913 |
"output an audible beep" |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8914 |
|
2232 | 8915 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8916 |
Beep(__intVal(@global(BeepFrequency)), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8917 |
__intVal(@global(BeepDuration))); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8918 |
%} |
2232 | 8919 |
! |
8920 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8921 |
flush |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8922 |
"send all buffered drawing to the display. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8923 |
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
|
8924 |
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
|
8925 |
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
|
8926 |
(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
|
8927 |
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
|
8928 |
|
2232 | 8929 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8930 |
GdiFlush(); |
1127 | 8931 |
%} |
2232 | 8932 |
! |
8933 |
||
1127 | 8934 |
refreshKeyboardMapping:eB |
2232 | 8935 |
! |
8936 |
||
1127 | 8937 |
setInputFocusTo:aWindowId |
8938 |
self setInputFocusTo:aWindowId revertTo:nil |
|
2232 | 8939 |
! |
8940 |
||
1127 | 8941 |
setInputFocusTo:aWindowId revertTo:revertSymbol |
8942 |
"set the focus to the view as defined by aWindowId. |
|
8943 |
Passing nil set the focus to no window and lets the display discard all |
|
8944 |
input until a new focus is set. |
|
8945 |
RevertSymbol specifies what should happen if the view becomes invisible; |
|
8946 |
passing one of #parent, #root or nil specifies that the focus should be |
|
8947 |
given to the parent view, the root view or no view." |
|
8948 |
||
2232 | 8949 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
8950 |
if (__isExternalAddress(aWindowId)) |
|
8951 |
{ |
|
1127 | 8952 |
HWND hWnd = _HWNDVal(aWindowId); |
2244 | 8953 |
int r = 0; |
8954 |
if (revertSymbol == @symbol(parent)) |
|
8955 |
{ |
|
8956 |
r = 1; |
|
8957 |
} |
|
8958 |
else if (revertSymbol == @symbol(root)) |
|
8959 |
{ |
|
8960 |
r = 2; |
|
8961 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8962 |
if (hWnd) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8963 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8964 |
if (GetFocus() != hWnd) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8965 |
{ |
2232 | 8966 |
CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r)); |
8967 |
PostMessage(hWnd,WM_THREADSETFOCUS,(INT)hWnd,GetCurrentThreadId()); |
|
8968 |
#if 0 |
|
8969 |
if (SetFocus(hWnd) == 0) |
|
8970 |
PRINTF(("SetFocus to %x failed.\n",hWnd)); |
|
8971 |
#endif |
|
8972 |
} |
|
2244 | 8973 |
else |
8974 |
{ |
|
2232 | 8975 |
CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r)); |
2244 | 8976 |
} |
1127 | 8977 |
} |
8978 |
RETURN ( self ); |
|
8979 |
} |
|
8980 |
%} |
|
2232 | 8981 |
! ! |
8982 |
||
8983 |
!WinWorkstation methodsFor:'pointer queries '! |
|
8984 |
||
1127 | 8985 |
anyButtonStateMask |
8986 |
"return an integer for masking out any button from a |
|
8987 |
buttonStates value." |
|
8988 |
||
8989 |
"/ should use ``Display buttonXMotionMask bitOr:....'' |
|
8990 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8991 |
|s | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8992 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8993 |
%{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8994 |
s = __MKSMALLINT(Button1Mask|Button2Mask|Button3Mask); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8995 |
%}. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
8996 |
^ s |
1127 | 8997 |
|
8998 |
"Modified: 23.3.1996 / 12:41:33 / cg" |
|
8999 |
"Created: 23.3.1996 / 12:46:35 / cg" |
|
2232 | 9000 |
! |
9001 |
||
1127 | 9002 |
buttonStates |
9003 |
"return an integer representing the state of the pointer buttons; |
|
9004 |
a one-bit in positions 0.. represent a pressed button. |
|
9005 |
See the button1Mask/button2Mask/button3Mask, |
|
9006 |
shiftMask/controlMask and modifierMask methods for the meaning of the bits." |
|
9007 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9008 |
|s | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9009 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9010 |
%{ |
2253 | 9011 |
int modifiers = 0; |
9012 |
int b1m = Button1Mask; |
|
9013 |
int b3m = Button3Mask; |
|
9014 |
if (GetSystemMetrics(SM_SWAPBUTTON)) |
|
9015 |
{ |
|
9016 |
b3m = Button1Mask; |
|
9017 |
b1m = Button3Mask; |
|
9018 |
} |
|
9019 |
||
9020 |
if (GetAsyncKeyState(VK_LBUTTON) & 0x8000) |
|
9021 |
modifiers |= b1m; |
|
9022 |
if (GetAsyncKeyState(VK_MBUTTON) & 0x8000) |
|
9023 |
modifiers |= Button2Mask; |
|
9024 |
if (GetAsyncKeyState(VK_RBUTTON) & 0x8000) |
|
9025 |
modifiers |= b3m; |
|
9026 |
||
9027 |
s = __MKSMALLINT(modifiers); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9028 |
%}. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9029 |
^ s |
1127 | 9030 |
|
9031 |
" |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9032 |
Display buttonStates |
1127 | 9033 |
" |
9034 |
||
9035 |
"is the control-key pressed ? |
|
9036 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9037 |
Display buttonStates bitTest:(Display controlMask) |
1127 | 9038 |
" |
9039 |
||
9040 |
"is the alt/meta-key pressed ? |
|
9041 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9042 |
Display buttonStates bitTest:(Display altModifierMask) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9043 |
Display buttonStates bitTest:(Display metaModifierMask) |
1127 | 9044 |
" |
2232 | 9045 |
! |
9046 |
||
1127 | 9047 |
leftButtonStateMask |
9048 |
"return an integer for masking out the left button from a |
|
9049 |
buttonStates value" |
|
9050 |
||
9051 |
"/ should use ``Display button1MotionMask'' |
|
9052 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9053 |
|s | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9054 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9055 |
%{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9056 |
s = __MKSMALLINT(Button1Mask); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9057 |
%}. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9058 |
^ s |
1127 | 9059 |
|
9060 |
"Modified: 23.3.1996 / 12:41:33 / cg" |
|
2232 | 9061 |
! |
9062 |
||
1127 | 9063 |
middleButtonStateMask |
9064 |
"return an integer for masking out the middle button from a |
|
9065 |
buttonStates value" |
|
9066 |
||
9067 |
"/ should use ``Display button2MotionMask'' |
|
9068 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9069 |
|s | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9070 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9071 |
%{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9072 |
s = __MKSMALLINT(Button2Mask); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9073 |
%}. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9074 |
^ s |
1127 | 9075 |
|
9076 |
"Modified: 23.3.1996 / 12:41:43 / cg" |
|
2232 | 9077 |
! |
9078 |
||
1127 | 9079 |
pointerPosition |
9080 |
"return the current pointer position in root-window coordinates" |
|
9081 |
||
2232 | 9082 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 9083 |
POINT p; |
9084 |
||
9085 |
if (GetCursorPos(&p)) { |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9086 |
RETURN (__MKPOINT_INT(p.x, p.y)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9087 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9088 |
RETURN (__MKPOINT_INT(0, 0)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9089 |
%} |
2232 | 9090 |
! |
9091 |
||
1127 | 9092 |
rightButtonStateMask |
9093 |
"return an integer for masking out the right button from a |
|
9094 |
buttonStates value" |
|
9095 |
||
9096 |
"/ should use ``Display button3MotionMask'' |
|
9097 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9098 |
|s | |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9099 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9100 |
%{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9101 |
s = __MKSMALLINT(Button3Mask); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9102 |
%}. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9103 |
^ s |
1127 | 9104 |
|
9105 |
"Modified: 23.3.1996 / 12:41:52 / cg" |
|
2232 | 9106 |
! |
9107 |
||
1127 | 9108 |
rootPositionOfLastEvent |
9109 |
"return the position in root-window coordinates |
|
9110 |
of the last button, key or pointer event" |
|
9111 |
||
9112 |
|x y| |
|
9113 |
||
9114 |
%{ |
|
9115 |
x = __MKSMALLINT(evRootX); |
|
9116 |
y = __MKSMALLINT(evRootY); |
|
9117 |
%}. |
|
9118 |
^ x @ y |
|
2232 | 9119 |
! |
9120 |
||
1723 | 9121 |
setPointerPosition:newPosition |
9122 |
"change the pointer position in root-window coordinates." |
|
9123 |
||
2232 | 9124 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9125 |
if (__isPoint(newPosition)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9126 |
OBJ xpos, ypos; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9127 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9128 |
xpos = __point_X(newPosition); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9129 |
ypos = __point_Y(newPosition); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9130 |
SetCursorPos(__intVal(xpos), __intVal(ypos)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9131 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9132 |
%} |
2232 | 9133 |
! |
9134 |
||
1723 | 9135 |
setPointerPosition:newPosition in:aWindowId |
9136 |
"change the pointer position to a new position relative to the |
|
9137 |
given windows origin (which may be the rootWindow). |
|
9138 |
Be careful with this - its usually not very ergonimically |
|
9139 |
to change the mousePointer position. |
|
9140 |
This interface is provided for special applications (presentation |
|
9141 |
playback) and should not be used in normal applications." |
|
9142 |
||
9143 |
self setCursorPosition:(self translatePoint:newPosition from:aWindowId to:rootView id). |
|
2232 | 9144 |
! ! |
9145 |
||
9146 |
!WinWorkstation methodsFor:'retrieving pixels'! |
|
9147 |
||
1461
6d8b022bfcd8
renamed getBitsFrom to getBitsFromId
Claus Gittinger <cg@exept.de>
parents:
1426
diff
changeset
|
9148 |
getBitsFromId:aDrawableId x:srcx y:srcy width:w height:h into:imageBits |
1127 | 9149 |
"get bits from a drawable into the imageBits. The storage for the bits |
9150 |
must be big enough for the data to fit. If ok, returns an array with some |
|
9151 |
info and the bits in imageBits. The info contains the depth, bitOrder and |
|
9152 |
number of bytes per scanline. The number of bytes per scanline is not known |
|
9153 |
in advance, since the X-server is free to return whatever it thinks is a good padding." |
|
9154 |
||
9155 |
|rawInfo info| |
|
9156 |
||
9157 |
((w <= 0) or:[h <= 0]) ifTrue:[ |
|
9158 |
self primitiveFailed. |
|
9159 |
^ nil |
|
9160 |
]. |
|
9161 |
||
9162 |
rawInfo := Array new:8. |
|
9163 |
"1 -> bit order" |
|
9164 |
"2 -> depth" |
|
9165 |
"3 -> bytes_per_line" |
|
9166 |
"4 -> byte_order" |
|
9167 |
"5 -> format" |
|
9168 |
"6 -> bitmap_unit" |
|
9169 |
"7 -> bitmap_pad" |
|
9170 |
"8 -> bits_per_pixel" |
|
9171 |
||
9172 |
"/ had to extract the getPixel call into a separate method, to specify |
|
9173 |
"/ unlimitedStack (some implementations use alloca and require huge amounts |
|
9174 |
"/ of temporary stack space |
|
9175 |
||
9176 |
(self primGetBitsFrom:aDrawableId x:srcx y:srcy width:w height:h into:imageBits infoInto:rawInfo) ifTrue:[ |
|
9177 |
info := IdentityDictionary new. |
|
9178 |
info at:#bitOrder put:(rawInfo at:1). |
|
9179 |
info at:#depth put:(rawInfo at:2). |
|
9180 |
info at:#bytesPerLine put:(rawInfo at:3). |
|
9181 |
info at:#byteOrder put:(rawInfo at:4). |
|
9182 |
info at:#format put:(rawInfo at:5). |
|
9183 |
info at:#bitmapUnit put:(rawInfo at:6). |
|
9184 |
info at:#bitmapPad put:(rawInfo at:7). |
|
9185 |
info at:#bitsPerPixel put:(rawInfo at:8). |
|
9186 |
^ info |
|
9187 |
]. |
|
9188 |
" |
|
9189 |
some error occured - either args are not smallintegers, imageBits is not a ByteArray |
|
9190 |
or is too small to hold the bits |
|
9191 |
" |
|
9192 |
^ self primitiveFailed |
|
2232 | 9193 |
! |
9194 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9195 |
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
|
9196 |
"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
|
9197 |
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
|
9198 |
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
|
9199 |
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
|
9200 |
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
|
9201 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9202 |
|rawInfo info| |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9203 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9204 |
((w <= 0) or:[h <= 0]) ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9205 |
self primitiveFailed. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9206 |
^ nil |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9207 |
]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9208 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9209 |
rawInfo := Array new:8. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9210 |
"1 -> bit order" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9211 |
"2 -> depth" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9212 |
"3 -> bytes_per_line" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9213 |
"4 -> byte_order" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9214 |
"5 -> format" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9215 |
"6 -> bitmap_unit" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9216 |
"7 -> bitmap_pad" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9217 |
"8 -> bits_per_pixel" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9218 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9219 |
"/ 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
|
9220 |
"/ 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
|
9221 |
"/ of temporary stack space |
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 |
(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
|
9224 |
info := IdentityDictionary new. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9225 |
info at:#bitOrder put:(rawInfo at:1). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9226 |
info at:#depth put:(rawInfo at:2). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9227 |
info at:#bytesPerLine put:(rawInfo at:3). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9228 |
info at:#byteOrder put:(rawInfo at:4). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9229 |
info at:#format put:(rawInfo at:5). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9230 |
info at:#bitmapUnit put:(rawInfo at:6). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9231 |
info at:#bitmapPad put:(rawInfo at:7). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9232 |
info at:#bitsPerPixel put:(rawInfo at:8). |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9233 |
^ info |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9234 |
]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9235 |
" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9236 |
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
|
9237 |
or is too small to hold the bits |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9238 |
" |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9239 |
^ self primitiveFailed |
2232 | 9240 |
! |
9241 |
||
1127 | 9242 |
getPixelX:x y:y from:aDrawableId |
9243 |
"return the pixel value at x/y; coordinates start at 0/0 for the upper left. |
|
9244 |
Nil is returned for invalid coordinates or if any other problem arises." |
|
9245 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9246 |
'getPixelX:y:from: not yet implemented' printCR. |
1127 | 9247 |
^ nil |
2232 | 9248 |
! |
9249 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9250 |
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
|
9251 |
"since XGetImage may allocate huge amount of stack space |
1127 | 9252 |
(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
|
9253 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9254 |
"'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
|
9255 |
^ false" |
2232 | 9256 |
%{ /* xxLIMITEDSTACK */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9257 |
int height, width; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9258 |
int numBytes; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9259 |
HWND hWnd; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9260 |
HBITMAP hBitmap = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9261 |
HDC bDC = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9262 |
struct |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9263 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9264 |
BITMAPINFOHEADER bmiHeader; |
2232 | 9265 |
DWORD r; |
9266 |
DWORD g; |
|
9267 |
DWORD b; |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9268 |
} bitmap; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9269 |
|
2232 | 9270 |
if (__isExternalAddress(aDrawableId) |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9271 |
&& __bothSmallInteger(srcX, srcY) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9272 |
&& __bothSmallInteger(w, h) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9273 |
&& __isArray(info) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9274 |
&& __isByteArray(imageBits)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9275 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9276 |
hWnd = _HWNDVal( aDrawableId ); |
2151 | 9277 |
DPRINTF(("primGetBits %x\n",hWnd)); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9278 |
if( hWnd != 0 ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9279 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9280 |
HDC wDC = GetDC(hWnd); |
2232 | 9281 |
bDC = CreateCompatibleDC(__rootDC); |
2151 | 9282 |
DPRINTF(("srcX %d srcY %d w %d h %d\n",__intVal(srcX),__intVal(srcY),__intVal(w),__intVal(h))); |
2232 | 9283 |
height = __intVal(h); |
9284 |
width = __intVal(w); |
|
2151 | 9285 |
DPRINTF(("width %d height %d\n",width,height)); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9286 |
hBitmap = CreateCompatibleBitmap(__rootDC,width,height); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9287 |
if (!hBitmap) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9288 |
goto fail; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9289 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9290 |
bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9291 |
bitmap.bmiHeader.biPlanes = 1; |
2232 | 9292 |
if (__depth == 24) |
9293 |
{ |
|
9294 |
bitmap.bmiHeader.biCompression = BI_RGB; |
|
9295 |
} |
|
9296 |
else if (__depth == 16) |
|
9297 |
{ |
|
9298 |
/*bitmap.bmiHeader.biCompression = BI_RGB; |
|
9299 |
bitmap.bmiHeader.biCompression = BI_BITFIELDS; |
|
9300 |
bitmap.b = 0x001f; |
|
9301 |
bitmap.g = 0x07e0; |
|
9302 |
bitmap.r = 0xf800;*/ |
|
9303 |
bitmap.b = 0; |
|
9304 |
bitmap.g = 0; |
|
9305 |
bitmap.r = 0; |
|
9306 |
bitmap.bmiHeader.biCompression = BI_RGB; |
|
9307 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9308 |
bitmap.bmiHeader.biSizeImage = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9309 |
bitmap.bmiHeader.biXPelsPerMeter = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9310 |
bitmap.bmiHeader.biYPelsPerMeter = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9311 |
bitmap.bmiHeader.biClrUsed = 0; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9312 |
bitmap.bmiHeader.biClrImportant = 0; |
2232 | 9313 |
bitmap.bmiHeader.biBitCount = __depth; |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9314 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9315 |
bitmap.bmiHeader.biWidth = width; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9316 |
bitmap.bmiHeader.biHeight = -height; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9317 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9318 |
SelectObject(bDC,hBitmap); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9319 |
if (BitBlt(bDC, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9320 |
0,0, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9321 |
width,height, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9322 |
wDC, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9323 |
__intVal(srcX), __intVal(srcY), |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9324 |
SRCCOPY) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9325 |
== 0 |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9326 |
) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9327 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9328 |
printf("ERROR in GetBitsFrom: BitBlt\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9329 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9330 |
ReleaseDC(hWnd,wDC); |
2151 | 9331 |
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
|
9332 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9333 |
printf("noinfo returned\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9334 |
goto fail; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9335 |
} |
2151 | 9336 |
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
|
9337 |
numBytes = bitmap.bmiHeader.biSizeImage; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9338 |
if( numBytes != 0 ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9339 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9340 |
if (numBytes > __byteArraySize(imageBits)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9341 |
/* imageBits too small */ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9342 |
printf("provided byteArray too small\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9343 |
goto fail; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9344 |
} |
2151 | 9345 |
DPRINTF(("numBytes %d\n",numBytes)); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9346 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9347 |
bitmap.bmiHeader.biHeight = -height; |
2151 | 9348 |
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
|
9349 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9350 |
printf("zero bits returned\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9351 |
goto fail; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9352 |
} |
2232 | 9353 |
else |
9354 |
{ |
|
9355 |
char *c = __ByteArrayInstPtr(imageBits)->ba_element; |
|
9356 |
int n = numBytes; |
|
9357 |
for (;n > 0;n -= 3,c += 3) |
|
9358 |
{ |
|
9359 |
char b = c[0]; |
|
9360 |
c[0] = c[2]; |
|
9361 |
c[2] = b; |
|
9362 |
} |
|
9363 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9364 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9365 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9366 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9367 |
printf("unacceptable bitmap\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9368 |
goto fail; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9369 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9370 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9371 |
else |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9372 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9373 |
printf("unacceptable bitmap\n"); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9374 |
goto fail; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9375 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9376 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9377 |
__ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9378 |
__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(1); |
2232 | 9379 |
__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
|
9380 |
__ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9381 |
__ArrayInstPtr(info)->a_element[4] = @symbol(XYPixmap); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9382 |
__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(0); |
2232 | 9383 |
__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(WIN32PADDING); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9384 |
__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(bitmap.bmiHeader.biBitCount); |
2232 | 9385 |
if (bDC) |
9386 |
DeleteDC(bDC); |
|
9387 |
if (hBitmap) |
|
9388 |
DelObject(hBitmap); |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9389 |
RETURN ( true ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9390 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9391 |
fail: |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9392 |
if (bDC) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9393 |
DeleteDC(bDC); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9394 |
if (hBitmap) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9395 |
DelObject(hBitmap); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9396 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9397 |
%}. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9398 |
^ false |
2232 | 9399 |
! |
9400 |
||
9401 |
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
|
9402 |
"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
|
9403 |
(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
|
9404 |
|
2232 | 9405 |
%{ /* xxLIMITEDSTACK */ |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9406 |
int height, width; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9407 |
int numBytes; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9408 |
unsigned char* ep = 0; |
2232 | 9409 |
HBITMAP xBitmap; |
9410 |
HBITMAP hBitmap = 0; |
|
9411 |
HDC bDC = 0; |
|
9412 |
HDC xDC = 0; |
|
9413 |
struct |
|
9414 |
{ |
|
9415 |
BITMAPINFOHEADER bmiHeader; |
|
9416 |
DWORD rgb[2]; |
|
9417 |
} bitmap; |
|
9418 |
BITMAP bitmapInfo; |
|
9419 |
||
9420 |
if (__isExternalAddress(aDrawableId) |
|
9421 |
&& __bothSmallInteger(srcX, srcY) |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9422 |
&& __bothSmallInteger(w, h) |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9423 |
&& __isArray(info) |
2232 | 9424 |
&& __isByteArray(imageBits)) |
9425 |
{ |
|
9426 |
xBitmap = _HBITMAPVAL( aDrawableId ); |
|
9427 |
DPRINTF(("primGetBitsFromPixmap %x\n",xBitmap)); |
|
9428 |
if( xBitmap != 0 ) |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9429 |
{ |
2232 | 9430 |
xDC = GetDC(0); |
9431 |
SelectObject(xDC,xBitmap); |
|
9432 |
GetObject(xBitmap,sizeof(bitmapInfo),&bitmapInfo); |
|
9433 |
||
9434 |
bDC = CreateCompatibleDC(__rootDC); |
|
9435 |
DPRINTF(("srcX %d srcY %d w %d h %d\n",__intVal(srcX),__intVal(srcY),__intVal(w),__intVal(h))); |
|
9436 |
height = __intVal(h); |
|
9437 |
width = __intVal(w); |
|
9438 |
DPRINTF(("width %d height %d\n",width,height)); |
|
9439 |
||
9440 |
hBitmap = CreateCompatibleBitmap(xDC,width,height); |
|
9441 |
if (!hBitmap) |
|
9442 |
goto fail; |
|
9443 |
||
9444 |
SelectObject(bDC,hBitmap); |
|
9445 |
if (BitBlt(bDC, |
|
9446 |
0,0, |
|
9447 |
width,height, |
|
9448 |
xDC, |
|
9449 |
__intVal(srcX), __intVal(srcY), |
|
9450 |
SRCCOPY) |
|
9451 |
== 0 |
|
9452 |
) |
|
9453 |
{ |
|
9454 |
DPRINTF(("ERROR in primGetBitsFromPixmap: BitBlt\n")); |
|
9455 |
goto fail; |
|
9456 |
} |
|
9457 |
bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); |
|
9458 |
bitmap.bmiHeader.biPlanes = 1; |
|
9459 |
if (__depth == 24) |
|
9460 |
{ |
|
9461 |
/*bitmap.bmiHeader.biCompression = BI_BITFIELDS; |
|
9462 |
bitmap.r = 0xff0000; |
|
9463 |
bitmap.g = 0x00ff00; |
|
9464 |
bitmap.b = 0x0000ff;*/ |
|
9465 |
bitmap.bmiHeader.biCompression = BI_RGB; |
|
9466 |
} |
|
9467 |
else if (__depth == 16) |
|
9468 |
{ |
|
9469 |
/*bitmap.bmiHeader.biCompression = BI_RGB; |
|
9470 |
bitmap.bmiHeader.biCompression = BI_BITFIELDS; |
|
9471 |
bitmap.b = 0x001f; |
|
9472 |
bitmap.g = 0x07e0; |
|
9473 |
bitmap.r = 0xf800;*/ |
|
9474 |
bitmap.bmiHeader.biCompression = BI_RGB; |
|
9475 |
} |
|
9476 |
bitmap.bmiHeader.biSizeImage = 0; |
|
9477 |
bitmap.bmiHeader.biXPelsPerMeter = 0; |
|
9478 |
bitmap.bmiHeader.biYPelsPerMeter = 0; |
|
9479 |
bitmap.bmiHeader.biClrUsed = 0; |
|
9480 |
bitmap.bmiHeader.biClrImportant = 0; |
|
9481 |
||
9482 |
bitmap.bmiHeader.biWidth = width; |
|
9483 |
bitmap.bmiHeader.biHeight = -height; |
|
9484 |
bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel; |
|
9485 |
if (GetDIBits(bDC,hBitmap,0,height,0,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0) |
|
9486 |
{ |
|
9487 |
DPRINTF(("noinfo returned\n")); |
|
9488 |
goto fail; |
|
9489 |
} |
|
9490 |
DPRINTF(("bitmap info:%d %d %d %d\n",bitmap.bmiHeader.biWidth,bitmap.bmiHeader.biHeight,bitmap.bmiHeader.biBitCount,bitmap.bmiHeader.biSizeImage)); |
|
9491 |
numBytes = bitmap.bmiHeader.biSizeImage; |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9492 |
if( numBytes != 0 ) |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9493 |
{ |
2232 | 9494 |
if (numBytes > __byteArraySize(imageBits)) { |
9495 |
/* imageBits too small */ |
|
9496 |
DPRINTF(("provided byteArray too small\n")); |
|
9497 |
goto fail; |
|
9498 |
} |
|
9499 |
DPRINTF(("numBytes %d\n",numBytes)); |
|
9500 |
||
9501 |
bitmap.bmiHeader.biHeight = -height; |
|
9502 |
bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel; /*__depth;*/ |
|
9503 |
bitmap.rgb[0] = 0; |
|
9504 |
bitmap.rgb[1] = 0xffffff; |
|
9505 |
if (GetDIBits(xDC,xBitmap,0,height,__ByteArrayInstPtr(imageBits)->ba_element,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0) |
|
9506 |
{ |
|
9507 |
DPRINTF(("zero bits returned\n")); |
|
9508 |
goto fail; |
|
9509 |
} |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9510 |
} |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9511 |
else |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9512 |
{ |
2232 | 9513 |
DPRINTF(("unacceptable bitmap\n")); |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9514 |
goto fail; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9515 |
} |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9516 |
} |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9517 |
else |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9518 |
{ |
2232 | 9519 |
DPRINTF(("unacceptable bitmap\n")); |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9520 |
goto fail; |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9521 |
} |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9522 |
__ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9523 |
__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(1); |
2232 | 9524 |
__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
|
9525 |
__ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst); |
2232 | 9526 |
__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
|
9527 |
__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(0); |
2232 | 9528 |
__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(WIN32PADDING); |
9529 |
__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(bitmap.bmiHeader.biBitCount); |
|
9530 |
if (bDC) |
|
9531 |
DeleteDC(bDC); |
|
9532 |
if (xDC) |
|
9533 |
ReleaseDC(0,xDC);//DeleteDC(xDC); |
|
9534 |
if (hBitmap) |
|
9535 |
DelObject(hBitmap); |
|
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9536 |
RETURN ( true ); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9537 |
} |
2232 | 9538 |
fail: |
9539 |
if (bDC) |
|
9540 |
DeleteDC(bDC); |
|
9541 |
if (xDC) |
|
9542 |
ReleaseDC(0,xDC);//DeleteDC(xDC); |
|
9543 |
if (hBitmap) |
|
9544 |
DelObject(hBitmap); |
|
9545 |
||
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9546 |
%}. |
1127 | 9547 |
^ false |
2232 | 9548 |
! ! |
9549 |
||
9550 |
!WinWorkstation methodsFor:'selections'! |
|
9551 |
||
2151 | 9552 |
getSelectionFor:drawableId |
9553 |
'getSelectionFor: not yet implemented' errorPrintCR. |
|
9554 |
^ nil |
|
9555 |
||
9556 |
||
2232 | 9557 |
! ! |
9558 |
||
9559 |
!WinWorkstation methodsFor:'style defaults'! |
|
9560 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9561 |
defaultStyleValueFor:aKey |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9562 |
"return a default style value, given a key. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9563 |
These defaults are used if nothing is specified |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9564 |
in the style sheet |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9565 |
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
|
9566 |
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
|
9567 |
where the systemDefaults are used ..." |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9568 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9569 |
<resource: #style (#viewSpacing |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9570 |
#borderColor #borderWidth |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9571 |
#viewBackground #shadowColor #lightColor |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9572 |
)> |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9573 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9574 |
|clr| |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9575 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9576 |
"/ aKey == #shadowColor ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9577 |
"/ ^ Color black |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9578 |
"/ ]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9579 |
"/ aKey == #lightColor ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9580 |
"/ ^ Color white |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9581 |
"/ ]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9582 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9583 |
aKey == #viewBackgroundColor ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9584 |
clr := self getSystemColor:#COLOR_WINDOW. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9585 |
]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9586 |
aKey == #textForegroundColor ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9587 |
clr := self getSystemColor:#COLOR_WINDOWTEXT |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9588 |
]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9589 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9590 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9591 |
"/ aKey == #scrollerViewBackgroundColor ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9592 |
"/ ^ Color white |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9593 |
"/ ]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9594 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9595 |
"/ aKey == #textForegroundColor ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9596 |
"/ ^ Color black. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9597 |
"/ ]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9598 |
"/ aKey == #textBackgroundColor ifTrue:[ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9599 |
"/ ^ Color white. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9600 |
"/ ]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9601 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9602 |
clr notNil ifTrue:[^ clr]. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9603 |
^ super defaultStyleValueFor:aKey |
2232 | 9604 |
! ! |
9605 |
||
9606 |
!WinWorkstation methodsFor:'window stuff'! |
|
9607 |
||
1127 | 9608 |
clearRectangleX:x y:y width:width height:height in:aWindowId |
9609 |
"clear a rectangular area to viewbackground" |
|
9610 |
%{ |
|
9611 |
DPRINTF(("clearRect\n")); |
|
9612 |
%}. |
|
9613 |
super clearRectangleX:x y:y width:width height:height in:aWindowId |
|
2232 | 9614 |
! |
9615 |
||
1127 | 9616 |
clearWindow:aWindowId |
9617 |
"clear a window to viewbackground" |
|
9618 |
||
9619 |
%{ |
|
9620 |
DPRINTF(("clearWin\n")); |
|
9621 |
%}. |
|
9622 |
super clearWindow:aWindowId |
|
2232 | 9623 |
! |
9624 |
||
1127 | 9625 |
configureWindow:aWindowId sibling:siblingId stackMode:modeSymbol |
9626 |
"configure stacking operation of aWindowId w.r.t siblingId" |
|
9627 |
||
2232 | 9628 |
! |
9629 |
||
1127 | 9630 |
lowerWindow:aWindowId |
9631 |
"bring a window to back" |
|
9632 |
||
2232 | 9633 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 9634 |
|
9635 |
if (__isExternalAddress(aWindowId)) { |
|
9636 |
HWND win = _HWNDVal(aWindowId); |
|
9637 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9638 |
if (win) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9639 |
{ |
2244 | 9640 |
CPRINTF(("lowerWindow %x\n",win)); |
2232 | 9641 |
SetWindowPos(win, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE|SWP_NOSIZE); |
1127 | 9642 |
} |
9643 |
RETURN ( self ); |
|
9644 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9645 |
%} |
2232 | 9646 |
! |
9647 |
||
2151 | 9648 |
mapView:aView id:aWindowId iconified:aBoolean atX:x y:y width:w height:h minExtent:minExt maxExtent:maxExt |
9649 |
||
1127 | 9650 |
"make a window visible - either as icon or as a real view - needed for restart" |
9651 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9652 |
"/ 'mapView:id:iconified:...height: not yet implemented' errorPrintCR. |
2232 | 9653 |
%{ /* xxLIMITEDSTACK */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9654 |
RECT rec; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9655 |
if (__isExternalAddress(aWindowId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9656 |
&& __bothSmallInteger(x, y) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9657 |
&& __bothSmallInteger(w, h)) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9658 |
HWND win = _HWNDVal(aWindowId); |
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 |
if (win) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9661 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9662 |
rec.left = __intVal(x); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9663 |
rec.top = __intVal(y); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9664 |
rec.right = rec.left + __intVal(w); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9665 |
rec.bottom = rec.top + __intVal(h); |
2232 | 9666 |
#ifdef ADJUSTWINDOW |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9667 |
AdjustWindowRectEx(&rec,GetWindowLong(win,GWL_STYLE),0,GetWindowLong(win,GWL_EXSTYLE)); |
2232 | 9668 |
#endif |
9669 |
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
|
9670 |
rec.right - rec.left, rec.bottom - rec.top)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9671 |
SetWindowPos(win, (HWND)0, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9672 |
rec.left, rec.top, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9673 |
rec.right - rec.left, rec.bottom - rec.top, |
2253 | 9674 |
SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOZORDER|SWP_NOOWNERZORDER); |
2232 | 9675 |
if (aBoolean == true) |
9676 |
{ |
|
9677 |
ShowWindow(win, SW_SHOWMINIMIZED); |
|
9678 |
enqEvent(0,win, WM_SHOWWINDOW, FALSE, 0, 0, 0, 0); |
|
9679 |
} |
|
9680 |
else |
|
9681 |
{ |
|
9682 |
enqEvent(0,win, WM_SHOWWINDOW, TRUE, 0, 0, 0, 0); |
|
2253 | 9683 |
//ShowWindow(win, SW_RESTORE); |
9684 |
ShowWindow(win, SW_SHOWNOACTIVATE); |
|
2232 | 9685 |
} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9686 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9687 |
RETURN ( self ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9688 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9689 |
%} |
2232 | 9690 |
! |
9691 |
||
1127 | 9692 |
mapWindow:aWindowId |
9693 |
"make a window visible" |
|
9694 |
||
2232 | 9695 |
%{ /* xxLIMITEDSTACK */ |
1127 | 9696 |
|
9697 |
if (__isExternalAddress(aWindowId)) { |
|
9698 |
HWND win = _HWNDVal(aWindowId); |
|
9699 |
||
9700 |
if (win) { |
|
2244 | 9701 |
CPRINTF(("mapWindow %x\n",win)); |
2232 | 9702 |
ShowWindow(win, SW_SHOWNOACTIVATE); |
9703 |
//ShowWindow(win, SW_SHOW); |
|
2253 | 9704 |
SetWindowPos(win, HWND_TOP, 0, 0, 0, 0, SWP_NOSENDCHANGING|/*SWP_SHOWWINDOW|*/SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE/*|SWP_NOZORDER|SWP_NOOWNERZORDER */ ); |
2232 | 9705 |
//enqEvent(0,win, WM_SHOWWINDOW, TRUE, 0, 0, 0, 0); |
1127 | 9706 |
} |
9707 |
RETURN ( self ); |
|
9708 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9709 |
%} |
2232 | 9710 |
! |
9711 |
||
2251
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9712 |
activateWindow:aWindowId |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9713 |
"make a window active" |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9714 |
|
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9715 |
%{ /* xxLIMITEDSTACK */ |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9716 |
|
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9717 |
if (__isExternalAddress(aWindowId)) { |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9718 |
HWND win = _HWNDVal(aWindowId); |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9719 |
|
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9720 |
if (win) { |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9721 |
CPRINTF(("activateWindow %x\n",win)); |
2253 | 9722 |
ShowWindowAsync(win, SW_SHOW | SW_SHOWNORMAL); |
2251
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9723 |
//ShowWindow(win, SW_SHOW); |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9724 |
//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
|
9725 |
//enqEvent(0,win, WM_SHOWWINDOW, TRUE, 0, 0, 0, 0); |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9726 |
} |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9727 |
RETURN ( self ); |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9728 |
} |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9729 |
%} |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9730 |
! |
43d624ce346f
crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
9731 |
|
1127 | 9732 |
moveResizeWindow:aWindowId x:x y:y width:w height:h |
9733 |
"move and resize a window" |
|
9734 |
||
2232 | 9735 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9736 |
RECT rec; |
1127 | 9737 |
if (__isExternalAddress(aWindowId) |
9738 |
&& __bothSmallInteger(x, y) |
|
9739 |
&& __bothSmallInteger(w, h)) { |
|
9740 |
HWND win = _HWNDVal(aWindowId); |
|
9741 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9742 |
if (win) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9743 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9744 |
rec.left = __intVal(x); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9745 |
rec.top = __intVal(y); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9746 |
rec.right = rec.left + __intVal(w); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9747 |
rec.bottom = rec.top + __intVal(h); |
2232 | 9748 |
#ifdef ADJUSTWINDOW |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9749 |
AdjustWindowRectEx(&rec,GetWindowLong(win,GWL_STYLE),0,GetWindowLong(win,GWL_EXSTYLE)); |
2232 | 9750 |
#endif |
9751 |
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
|
9752 |
rec.right - rec.left, rec.bottom - rec.top)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9753 |
SetWindowPos(win, (HWND)0, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9754 |
rec.left, rec.top, |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9755 |
rec.right - rec.left, rec.bottom - rec.top, |
2253 | 9756 |
SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOZORDER|SWP_NOOWNERZORDER); |
1127 | 9757 |
} |
9758 |
RETURN ( self ); |
|
9759 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9760 |
%} |
2232 | 9761 |
! |
9762 |
||
1127 | 9763 |
moveWindow:aWindowId x:x y:y |
9764 |
"move a window" |
|
9765 |
||
2232 | 9766 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9767 |
RECT rec; |
1127 | 9768 |
|
9769 |
if (__isExternalAddress(aWindowId) |
|
9770 |
&& __bothSmallInteger(x, y)) { |
|
9771 |
HWND win = _HWNDVal(aWindowId); |
|
9772 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9773 |
if (win) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9774 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9775 |
rec.left = __intVal(x); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9776 |
rec.top = __intVal(y); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9777 |
rec.right = rec.left + 10; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9778 |
rec.bottom = rec.top + 10; |
2232 | 9779 |
#ifdef ADJUSTWINDOW |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9780 |
AdjustWindowRectEx(&rec,GetWindowLong(win,GWL_STYLE),0,GetWindowLong(win,GWL_EXSTYLE)); |
2232 | 9781 |
#endif |
9782 |
CPRINTF(("move %x x:%d y:%d -> x:%d y:%d\n",win,__intVal(x),__intVal(y),rec.left,rec.top)); |
|
1127 | 9783 |
SetWindowPos(win, (HWND)0, |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9784 |
rec.left, rec.top, |
1127 | 9785 |
0, 0, |
2253 | 9786 |
SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER|SWP_NOOWNERZORDER); |
1127 | 9787 |
} |
9788 |
RETURN ( self ); |
|
9789 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9790 |
%} |
2232 | 9791 |
! |
9792 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9793 |
primSetWindowIconId:wiconId width:wiconWidth height:wiconHeight in:aWindowId |
2232 | 9794 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9795 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9796 |
unsigned char* cp; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9797 |
unsigned char* ep; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9798 |
HBITMAP xBitMap, maskBitmap; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9799 |
ICONINFO iconInfo; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9800 |
int height, width; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9801 |
int nBytes, nBits; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9802 |
int index; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9803 |
HICON xIcon = (HICON)0, yIcon = (HICON)0; |
2232 | 9804 |
unsigned char *allocatedBits = 0; |
9805 |
unsigned char fastBits[10000]; |
|
2151 | 9806 |
DPRINTF(("primSetWindowIconId\n")); |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9807 |
if (__isExternalAddress(aWindowId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9808 |
&& __isExternalAddress(wiconId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9809 |
&& __bothSmallInteger(wiconWidth, wiconHeight)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9810 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9811 |
HWND win = _HWNDVal(aWindowId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9812 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9813 |
xBitMap = _HBITMAPVAL( wiconId ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9814 |
if( xBitMap != 0 ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9815 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9816 |
BITMAP bm; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9817 |
if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9818 |
{ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9819 |
int d = bm.bmPlanes * bm.bmBitsPixel; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9820 |
BYTE *ep,*bp; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9821 |
|
2151 | 9822 |
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
|
9823 |
height = __intVal( wiconHeight ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9824 |
width = __intVal( wiconWidth ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9825 |
nBytes = ( width + 31 ) / 8; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9826 |
nBytes = height * nBytes; |
2232 | 9827 |
if (nBytes < sizeof(fastBits)) |
9828 |
{ |
|
9829 |
ep = fastBits; |
|
9830 |
} |
|
9831 |
else |
|
9832 |
{ |
|
9833 |
ep = allocatedBits = (unsigned char *) malloc(nBytes); |
|
9834 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9835 |
if( ep != 0 ) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9836 |
memset(ep,0,nBytes); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9837 |
maskBitmap = CreateBitmap(width, height, 1, 1, ep ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9838 |
if( maskBitmap != NULL ) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9839 |
DPRINTF(( "BITMAP mask CREATED!!!\n" )); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9840 |
iconInfo.fIcon = TRUE; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9841 |
iconInfo.hbmMask =maskBitmap; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9842 |
iconInfo.hbmColor = xBitMap; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9843 |
xIcon = CreateIconIndirect( &iconInfo ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9844 |
DPRINTF(( "ICON CREATED!!!\n" )); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9845 |
DelObject( maskBitmap ); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9846 |
} else { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9847 |
DPRINTF(( "BITMAP mask CREATION failed!!!\n" )); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9848 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9849 |
} else { |
2232 | 9850 |
PRINTF(( " malloc failed\n" )); |
9851 |
} |
|
2244 | 9852 |
if (allocatedBits) |
2232 | 9853 |
free(allocatedBits); |
2000
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 |
} else { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9856 |
DPRINTF((" xBitMap is zero \n" )); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9857 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9858 |
if (xIcon) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9859 |
yIcon = (HICON)GetClassLong(win,GCL_HICON); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9860 |
SetClassLong(win,GCL_HICON,(DWORD)xIcon); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9861 |
/* 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
|
9862 |
if( yIcon ) { |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9863 |
if( DestroyIcon( yIcon ) ) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9864 |
DPRINTF(( "Old icon deleted\n" )); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9865 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9866 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9867 |
RETURN (self); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9868 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9869 |
%} |
2232 | 9870 |
! |
9871 |
||
2151 | 9872 |
raiseWindow:aWindowId |
9873 |
"bring a window to front" |
|
9874 |
||
2232 | 9875 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2151 | 9876 |
|
9877 |
if (__isExternalAddress(aWindowId)) { |
|
9878 |
HWND hWnd = _HWNDVal(aWindowId); |
|
9879 |
||
9880 |
if (hWnd) { |
|
2244 | 9881 |
CPRINTF(("raiseWindow %x\n",hWnd)); |
2253 | 9882 |
SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, /*SWP_NOOWNERZORDER |*/SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOMOVE|SWP_NOSIZE); |
2151 | 9883 |
} |
9884 |
RETURN ( self ); |
|
9885 |
} |
|
9886 |
%} |
|
2232 | 9887 |
! |
9888 |
||
2151 | 9889 |
resizeWindow:aWindowId width:w height:h |
9890 |
"resize a window" |
|
9891 |
||
2232 | 9892 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2151 | 9893 |
RECT rec; |
9894 |
if (__isExternalAddress(aWindowId) |
|
9895 |
&& __bothSmallInteger(w, h)) { |
|
9896 |
HWND hWnd = _HWNDVal(aWindowId); |
|
9897 |
||
9898 |
if (hWnd) |
|
9899 |
{ |
|
9900 |
rec.left = 0; |
|
9901 |
rec.top = 0; |
|
9902 |
rec.right = __intVal(w); |
|
9903 |
rec.bottom = __intVal(h); |
|
2232 | 9904 |
#ifdef ADJUSTWINDOW |
2151 | 9905 |
AdjustWindowRectEx(&rec,GetWindowLong(hWnd,GWL_STYLE),0,GetWindowLong(hWnd,GWL_EXSTYLE)); |
2232 | 9906 |
#endif |
9907 |
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 | 9908 |
SetWindowPos(hWnd, (HWND)0, |
9909 |
0, 0, |
|
9910 |
rec.right - rec.left, rec.bottom - rec.top, |
|
2253 | 9911 |
SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER|SWP_NOOWNERZORDER); |
2151 | 9912 |
} |
9913 |
RETURN ( self ); |
|
9914 |
} |
|
9915 |
%} |
|
2232 | 9916 |
! |
9917 |
||
1127 | 9918 |
setBackingStore:how in:aWindowId |
9919 |
"turn on/off backing-store for a window" |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9920 |
'setBackingStore:in: not yet implemented' errorPrintCR. |
1127 | 9921 |
|
2232 | 9922 |
! |
9923 |
||
1127 | 9924 |
setBitGravity:how in:aWindowId |
9925 |
"set bit gravity for a window" |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9926 |
"/ 'setBitGravity:in: not yet implemented' errorPrintCR. |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9927 |
|
2232 | 9928 |
! |
9929 |
||
1127 | 9930 |
setCursor:aCursorId in:aWindowId |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9931 |
"define a windows cursor |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9932 |
Ignored here, since in windows, an application |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9933 |
has to manage the cursor itself." |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9934 |
|
2232 | 9935 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
9936 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
9937 |
HCURSOR newCursor; |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
9938 |
|
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
9939 |
if (ISCONNECTED |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
9940 |
&& __isExternalAddress(aWindowId) |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
9941 |
&& __isExternalAddress(aCursorId)) { |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9942 |
HWND win = _HWNDVal(aWindowId); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9943 |
POINT p; |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9944 |
|
2240 | 9945 |
/*printf("setCursor:in:\n");*/ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9946 |
SetWindow_Cursor(win, _HCURSORVal(aCursorId)); |
2232 | 9947 |
#if 1 |
2247 | 9948 |
PostMessage(win,WM_THREADSETCURSOR,0,(INT)_HCURSORVal(aCursorId)); |
9949 |
//PostMessage(win,WM_SETCURSOR,0,HTCLIENT); |
|
2232 | 9950 |
#else |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9951 |
/* |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9952 |
* if the pointer is currently in that window ... |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9953 |
*/ |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9954 |
GetCursorPos(&p); |
2232 | 9955 |
if (1/*WindowFromPoint(p) == win*/) |
9956 |
{ |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9957 |
SetCursor(_HCURSORVal(aCursorId)); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9958 |
} |
2232 | 9959 |
#endif |
1416
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
9960 |
RETURN ( self ); |
85b4e23ecd86
davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
9961 |
} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9962 |
%} |
2232 | 9963 |
! |
9964 |
||
1127 | 9965 |
setIconName:aString in:aWindowId |
9966 |
"define a windows iconname" |
|
9967 |
||
2232 | 9968 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9969 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9970 |
if (__isExternalAddress(aWindowId) |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9971 |
&& (__isString(aString) || __isSymbol(aString))) { |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9972 |
HWND win = _HWNDVal(aWindowId); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9973 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9974 |
SetWindowText(win, __stringVal(aString)); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9975 |
RETURN (self); |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
9976 |
} |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9977 |
%} |
2232 | 9978 |
! |
9979 |
||
1127 | 9980 |
setSaveUnder:yesOrNo in:aWindowId |
9981 |
"turn on/off save-under for a window" |
|
9982 |
||
2232 | 9983 |
! |
9984 |
||
1127 | 9985 |
setTransient:aWindowId for:aMainWindowId |
9986 |
"set aWindowId to be a transient of aMainWindow" |
|
9987 |
||
2232 | 9988 |
! |
9989 |
||
1127 | 9990 |
setWindowBackground:aColorIndex in:aWindowId |
9991 |
"set the windows background color. This is the color with which |
|
9992 |
the view is filled whenever exposed. Do not confuse this with |
|
9993 |
the background drawing color, which is used with opaque drawing." |
|
2232 | 9994 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9995 |
|
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9996 |
if (__isExternalAddress(aWindowId) |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
9997 |
&& (__isSmallInteger(aColorIndex))) { |
2151 | 9998 |
HWND hWnd = _HWNDVal(aWindowId); |
2232 | 9999 |
/*HBRUSH hBrush = CreateSolidBrush(st2RGB(__intVal(aColorIndex),0)); |
2151 | 10000 |
if (GetWindow_bgBrush(hWnd)) |
2232 | 10001 |
DelObject(GetWindow_bgBrush(hWnd));*/ |
10002 |
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
|
10003 |
RETURN (self); |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
10004 |
} |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
10005 |
%} |
2232 | 10006 |
! |
10007 |
||
1127 | 10008 |
setWindowBackgroundPixmap:aPixmapId in:aWindowId |
10009 |
"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
|
10010 |
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
|
10011 |
Do not confuse this with the background drawing color, which is used |
1127 | 10012 |
with opaque drawing." |
10013 |
||
2151 | 10014 |
'setWindowBackgroundPixmap:in: not yet implemented' errorPrintCR. |
10015 |
||
2232 | 10016 |
! |
10017 |
||
1127 | 10018 |
setWindowBorderColor:aColorIndex in:aWindowId |
10019 |
"set the windows border color" |
|
10020 |
||
2232 | 10021 |
! |
10022 |
||
1127 | 10023 |
setWindowBorderPixmap:aPixmapId in:aWindowId |
10024 |
"set the windows border pattern" |
|
10025 |
||
2232 | 10026 |
! |
10027 |
||
1127 | 10028 |
setWindowBorderWidth:aNumber in:aWindowId |
10029 |
"set the windows border width" |
|
10030 |
||
2232 | 10031 |
! |
10032 |
||
1127 | 10033 |
setWindowClass:wClass name:wName in:aWindowId |
10034 |
"define class and name of a window. |
|
10035 |
This may be used by the window manager to |
|
10036 |
select client specific resources." |
|
2232 | 10037 |
%{ /* NOCONTEXT */ |
10038 |
DPRINTF(("setWindowClass:name:in: not yet implemented\n")); |
|
10039 |
%}. |
|
10040 |
||
10041 |
! |
|
10042 |
||
1127 | 10043 |
setWindowGravity:how in:aWindowId |
10044 |
"set window gravity for a window" |
|
10045 |
||
2232 | 10046 |
! |
10047 |
||
1127 | 10048 |
setWindowIcon:aForm in:aWindowId |
10049 |
"define a bitmap to be used as icon" |
|
10050 |
||
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
10051 |
|wiconId wiconHeight wiconWidth| |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
10052 |
|
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
10053 |
aForm notNil ifTrue:[ |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
10054 |
wiconId := aForm id. |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
10055 |
wiconHeight := aForm height. |
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
10056 |
wiconWidth := aForm width. |
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
10057 |
self |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
10058 |
primSetWindowIconId:wiconId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
10059 |
width:wiconWidth |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
10060 |
height:wiconHeight |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
10061 |
in:aWindowId |
1676
9016c45cfd81
fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
10062 |
]. |
2232 | 10063 |
! |
10064 |
||
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
10065 |
setWindowIcon:aForm mask:aMaskForm in:aWindowId |
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
10066 |
"set a windows icon & iconMask" |
2232 | 10067 |
%{ /* NOCONTEXT */ |
10068 |
DPRINTF(("setWindowIcon:mask:in: not yet implemented\n")); |
|
10069 |
%}. |
|
10070 |
||
10071 |
! |
|
10072 |
||
1127 | 10073 |
setWindowIconWindow:aView in:aWindowId |
10074 |
"define a window to be used as icon" |
|
2151 | 10075 |
'setWindowIcon:in: not yet implemented' printCR. |
10076 |
||
2232 | 10077 |
! |
10078 |
||
1127 | 10079 |
setWindowName:aString in:aWindowId |
10080 |
"define a windows name" |
|
10081 |
||
2232 | 10082 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 10083 |
|
10084 |
if (__isExternalAddress(aWindowId) |
|
10085 |
&& (__isString(aString) || __isSymbol(aString))) { |
|
10086 |
HWND win = _HWNDVal(aWindowId); |
|
10087 |
||
10088 |
SetWindowText(win, __stringVal(aString)); |
|
10089 |
RETURN (self); |
|
10090 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
10091 |
%} |
2232 | 10092 |
! |
10093 |
||
1127 | 10094 |
unmapWindow:aWindowId |
10095 |
"make a window invisible" |
|
10096 |
||
2232 | 10097 |
%{ /* xxLIMITEDSTACK (WIN95 only) */ |
1127 | 10098 |
|
10099 |
if (__isExternalAddress(aWindowId)) { |
|
10100 |
HWND win = _HWNDVal(aWindowId); |
|
10101 |
||
10102 |
if (win) { |
|
2253 | 10103 |
CPRINTF(("unmapWindow %x\n",win)); |
1127 | 10104 |
ShowWindow(win, SW_HIDE); |
2253 | 10105 |
CPRINTF(("unmapWindow1 %x\n",win)); |
2232 | 10106 |
//enqEvent(win, WM_SHOWWINDOW, FALSE, 0, 0, 0, 0); |
1127 | 10107 |
} |
10108 |
RETURN ( self ); |
|
10109 |
} |
|
2000
3327602cb32e
too many changes to be listed
Claus Gittinger <cg@exept.de>
parents:
1920
diff
changeset
|
10110 |
%} |
2232 | 10111 |
! ! |
10112 |
||
10113 |
!WinWorkstation class methodsFor:'documentation'! |
|
10114 |
||
1127 | 10115 |
version |
2253 | 10116 |
^ '$Header: /cvs/stx/stx/libview/Attic/WinWorkstat.st,v 1.44 1998-08-19 14:21:21 cg Exp $' |
2232 | 10117 |
! ! |
10118 |
WinWorkstation initialize! |