WinWorkstation.st
author Claus Gittinger <cg@exept.de>
Wed, 28 Apr 1999 19:58:23 +0200
changeset 2602 2d8af0930e87
parent 2601 d97601d0098e
child 2604 cbac29ab6d78
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     1
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     2
COPYRIGHT (c) 1996 by Claus Gittinger
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     3
	      All Rights Reserved
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     5
 This software is furnished under a license and may be used
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     6
 only in accordance with the terms of that license and with the
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     9
 other person.  No title to or ownership of the software is
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    10
 hereby transferred.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    11
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    12
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    13
DeviceWorkstation subclass:#WinWorkstation
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    14
	instanceVariableNames:'blackpixel whitepixel listOfFonts rootWin rootDC buttonsPressed
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    15
		eventTrace eventBuffer usingSystemPalette inRecursiveDispatch
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
    16
		dispatchingExpose isWin95'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    17
	classVariableNames:'BeepFrequency BeepDuration NativeWindows NativeWindowClassTable
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
    18
		StandardColorValues IgnoreSysColorChanges IgnoreFontChanges'
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    19
	poolDictionaries:''
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    20
	category:'Interface-Graphics'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    21
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    22
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    23
!WinWorkstation primitiveDefinitions!
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    24
%{
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
    25
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    26
#define COUNT_RESOURCES 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    27
#define COUNT_BMP_RESOURCES
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
    28
#define DEBUG_DELETEOBJECT
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    29
#define ADJUSTWINDOW
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    30
#define ALWAYSTRUECOLOR
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    31
#define WIN32THREADS
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    32
/*#define DEBUGMASK*/
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
    33
#define SET_FOCUS_IN_WINTHREAD
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
    34
#define SET_CURSOR_IN_WINTHREAD
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    35
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    36
#undef INT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    37
#define INT WIN_INT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    38
#undef Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    39
#define Array WIN_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    40
#undef Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    41
#define Number WIN_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    42
#undef Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    43
#define Method WIN_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    44
#undef Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    45
#define Point WIN_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    46
#undef Rectangle
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    47
/* #define Rectangle WIN_Rectangle*/
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    48
#undef True
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    49
#define True WIN_True
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    50
#undef False
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    51
#define False WIN_False
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    52
#undef Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    53
#define Block WIN_Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    54
#undef Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    55
#define Context WIN_Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    56
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    57
#undef xxCONTEXT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    58
#define xxCONTEXT        WIN_CONTEXT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    59
#undef _xxCONTEXT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    60
#define _xxCONTEXT       _WIN_CONTEXT
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    61
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    62
2328
478ec9b5cbe1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2327
diff changeset
    63
#include <stdio.h>
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    64
/* #include <malloc.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    65
/* #include <math.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    66
/* #include <string.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    67
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    68
/*#include <stdarg.h>   */
2328
478ec9b5cbe1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2327
diff changeset
    69
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    70
#ifdef __BORLANDC__
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    71
# define NOATOM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    72
# define NOGDICAPMASKS
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    73
# define NOMETAFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    74
# define NOMINMAX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    75
# define NOOPENFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    76
# define NOSOUND
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    77
# define NOWH
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    78
# define NOCOMM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    79
# define NOKANJI
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    80
# define NOCRYPT
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    81
# define NOMCX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    82
# define WIN32_LEAN_AND_MEAN
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    83
# include <windows.h>
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
    84
# include <shellapi.h>
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    85
# include <sys\timeb.h>
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
    86
# include <dir.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    87
#else
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    88
# define _USERENTRY /**/
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    89
# define NOATOM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    90
# define NOGDICAPMASKS
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    91
# define NOMETAFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    92
# define NOMINMAX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    93
# define NOOPENFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    94
# define NOSOUND
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    95
# define NOWH
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    96
# define NOCOMM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    97
# define NOKANJI
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    98
# define NOCRYPT
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    99
# define NOMCX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   100
# define WIN32_LEAN_AND_MEAN
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   101
# include <windows.h>
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   102
# include <sys\timeb.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   103
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   104
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   105
#include <process.h>
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   106
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   107
#ifdef __DEF_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   108
# undef Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   109
# define Array __DEF_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   110
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   111
#ifdef __DEF_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   112
# undef Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   113
# define Number __DEF_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   114
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   115
#ifdef __DEF_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   116
# undef Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   117
# define Method __DEF_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   118
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   119
#ifdef __DEF_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   120
# undef Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   121
# define Point __DEF_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   122
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   123
#ifdef __DEF_Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   124
# undef Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   125
# define Block __DEF_Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   126
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   127
#ifdef __DEF_Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   128
# undef Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   129
# define Context __DEF_Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   130
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   131
#undef INT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   132
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   133
#define INT int
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   134
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   135
/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   136
 * some defines - tired of typing ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   137
 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   138
#define _HANDLEVal(o)        (HANDLE)(__MKCP(o))
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   139
#define _HBITMAPVAL(o)       (HBITMAP)(__MKCP(o))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   140
#define _HWNDVal(o)          (HWND)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   141
#define _HPALETTEVal(o)      (HPALETTE)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   142
#define _HCURSORVal(o)       (HCURSOR)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   143
#define _HGDIOBJVal(o)       (HGDIOBJ)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   144
#define _LOGPALETTEVal(o)    (LOGPALETTE *)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   145
#define _COLORREFVal(o)      (COLORREF)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   146
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   147
#define _GCDATA(o)           ((struct gcData *)(__MKCP(o)))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   148
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   149
#ifdef LATER
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   150
  /* for multi-WIN display support, we need this as an instance var (as below)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   151
   * however, there are many more places, where a single static datum is
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   152
   * used currently - therefore dont care for this - at least now.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   153
   */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   154
# define __rootDC             (HDC)(__MKCP(__INST(rootDC)))
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   155
#endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   156
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   157
#define ISCONNECTED         1
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   158
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   159
struct gcData {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   160
    HWND        hWnd;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   161
    HBITMAP     hBitmap;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   162
    HBITMAP     save_hBitmap;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   163
    HDC         _hDC;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   164
    HBITMAP     hMask;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   165
    short       clipX;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   166
    short       clipY;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   167
    short       clipW;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   168
    short       clipH;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   169
    short       clipping;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   170
    short       clipByChild;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   171
    short       bitmapColorBitCount;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   172
    short       maskOrgX;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   173
    short       maskOrgY;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   174
    short       lineWidth;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   175
    short       fontAscent;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   176
    int         lStyle;   /* is lineStyle | joinStyle | capStyle */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   177
    int         rop2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   178
    int         bitbltrop2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   179
    COLORREF    fgColor;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   180
    COLORREF    bgColor;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   181
    HFONT       hFont;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   182
    HPEN        hPen;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   183
    HPEN        save_hPen;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   184
    HBRUSH      hBrush;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   185
    HBRUSH      save_hBrush;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   186
};
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   187
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   188
/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   189
 * some synthetic values
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   190
 */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   191
/*****************************************************************
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   192
 * EVENT DEFINITIONS
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   193
 *****************************************************************/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   194
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   195
/* Input Event Masks. Used as event-mask window attribute and as arguments
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   196
   to Grab requests.  Not to be confused with event names.  */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   197
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   198
#define NoEventMask                     0L
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   199
#define KeyPressMask                    (1L<<0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   200
#define KeyReleaseMask                  (1L<<1)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   201
#define ButtonPressMask                 (1L<<2)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   202
#define ButtonReleaseMask               (1L<<3)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   203
#define EnterWindowMask                 (1L<<4)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   204
#define LeaveWindowMask                 (1L<<5)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   205
#define PointerMotionMask               (1L<<6)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   206
#define PointerMotionHintMask           (1L<<7)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   207
#define Button1MotionMask               (1L<<8)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   208
#define Button2MotionMask               (1L<<9)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   209
#define Button3MotionMask               (1L<<10)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   210
#define Button4MotionMask               (1L<<11)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   211
#define Button5MotionMask               (1L<<12)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   212
#define ButtonMotionMask                (1L<<13)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   213
#define KeymapStateMask                 (1L<<14)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   214
#define ExposureMask                    (1L<<15)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   215
#define VisibilityChangeMask            (1L<<16)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   216
#define StructureNotifyMask             (1L<<17)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   217
#define ResizeRedirectMask              (1L<<18)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   218
#define SubstructureNotifyMask          (1L<<19)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   219
#define SubstructureRedirectMask        (1L<<20)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   220
#define FocusChangeMask                 (1L<<21)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   221
#define PropertyChangeMask              (1L<<22)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   222
#define ColormapChangeMask              (1L<<23)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   223
#define OwnerGrabButtonMask             (1L<<24)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   224
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   225
/* Event names.  Used in "type" field in XEvent structures.  Not to be
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   226
confused with event masks above.  They start from 2 because 0 and 1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   227
are reserved in the protocol for errors and replies. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   228
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   229
#define KeyPress                2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   230
#define KeyRelease              3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   231
#define ButtonPress             4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   232
#define ButtonRelease           5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   233
#define MotionNotify            6
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   234
#define EnterNotify             7
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   235
#define LeaveNotify             8
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   236
#define FocusIn                 9
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   237
#define FocusOut                10
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   238
#define KeymapNotify            11
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   239
#define Expose                  12
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   240
#define GraphicsExpose          13
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   241
#define NoExpose                14
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   242
#define VisibilityNotify        15
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   243
#define CreateNotify            16
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   244
#define DestroyNotify           17
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   245
#define UnmapNotify             18
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   246
#define MapNotify               19
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   247
#define MapRequest              20
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   248
#define ReparentNotify          21
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   249
#define ConfigureNotify         22
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   250
#define ConfigureRequest        23
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   251
#define GravityNotify           24
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   252
#define ResizeRequest           25
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   253
#define CirculateNotify         26
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   254
#define CirculateRequest        27
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   255
#define PropertyNotify          28
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   256
#define SelectionClear          29
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   257
#define SelectionRequest        30
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   258
#define SelectionNotify         31
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   259
#define ColormapNotify          32
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   260
#define ClientMessage           33
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   261
#define MappingNotify           34
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   262
#define LASTEvent               35      /* must be bigger than any event # */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   263
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   264
/*#define Button1MotionMask      1
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   265
#define Button2MotionMask       2
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   266
#define Button3MotionMask       4
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   267
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   268
#define Button1Mask             Button1MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   269
#define Button2Mask             Button2MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   270
#define Button3Mask             Button3MotionMask*/
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   271
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   272
/* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   273
   state in various key-, mouse-, and button-related events. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   274
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   275
#define ShiftMask               (1<<0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   276
#define LockMask                (1<<1)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   277
#define ControlMask             (1<<2)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   278
#define Mod1Mask                (1<<3)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   279
#define Mod2Mask                (1<<4)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   280
#define Mod3Mask                (1<<5)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   281
#define Mod4Mask                (1<<6)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   282
#define Mod5Mask                (1<<7)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   283
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   284
/* modifier names.  Used to build a SetModifierMapping request or
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   285
   to read a GetModifierMapping request.  These correspond to the
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   286
   masks defined above. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   287
#define ShiftMapIndex           0
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   288
#define LockMapIndex            1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   289
#define ControlMapIndex         2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   290
#define Mod1MapIndex            3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   291
#define Mod2MapIndex            4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   292
#define Mod3MapIndex            5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   293
#define Mod4MapIndex            6
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   294
#define Mod5MapIndex            7
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   295
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   296
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   297
/* button masks.  Used in same manner as Key masks above. Not to be confused
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   298
   with button names below. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   299
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   300
#define Button1Mask            Button1MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   301
#define Button2Mask            Button2MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   302
#define Button3Mask            Button3MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   303
#define Button4Mask            Button4MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   304
#define Button5Mask            Button5MotionMask
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   305
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   306
#define AnyModifier             (1<<15)  /* used in GrabButton, GrabKey */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   307
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   308
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   309
/* button names. Used as arguments to GrabButton and as detail in ButtonPress
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   310
   and ButtonRelease events.  Not to be confused with button masks above.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   311
   Note that 0 is already defined above as "AnyButton".  */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   312
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   313
#define Button1                 1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   314
#define Button2                 2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   315
#define Button3                 3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   316
#define Button4                 4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   317
#define Button5                 5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   318
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   319
#define CAPTURE_NONE     0
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   320
#define CAPTURE_IMPLICIT 7
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   321
#define CAPTURE_EXPLICIT 8
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   322
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   323
/*#define ControlMask            8
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   324
#define ShiftMask              16*/
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   325
#define LeftAltMask            Mod1Mask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   326
#define RightAltMask           Mod2Mask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   327
#define TRANSLATED_KEY         Mod5Mask
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   328
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   329
#define WIN32PADDING 32
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   330
/*
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   331
 * synthetic events
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   332
 */
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   333
#define __WM_MOUSEENTER        0x10001
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   334
#define __WM_MOUSELEAVE        0x10002
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   335
#define __WM_GEXPOSE           0x10003
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   336
#define __WM_NOGEXPOSE         0x10004
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   337
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   338
static int AltMask = RightAltMask;
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   339
static int MetaMask = LeftAltMask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   340
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   341
#define WhitePixel     RGB(0xFF, 0xFF, 0xFF)
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   342
#define BlackPixel     RGB(0, 0, 0)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   343
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   344
/*#undef DEBUG*/
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   345
#ifdef DEBUG
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   346
# define PRINTF(x)              { printf x;}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   347
# define CPRINTF(x)             { if (__debug__) printf x;}
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   348
# define RESPRINTF(x)           /*{ if (__debug__) printf x;}*/
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   349
# define RES1PRINTF(x)          /*{ if (__debug__) printf x;}*/
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   350
# 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
   351
# define TH_DPRINTF(x)          /*{ if (__debug__) printf x;}*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   352
# define POSTPRINTF(x)          { if (__debug__) printf x;}
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   353
# define DPRINTF(x)             { if (__debug__) printf x;}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   354
# define DDPRINTF(x)            /*{ if (__debug__) printf x;}*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   355
# define EVENT_PRINTF(x)        /*{ if (__debug__) printf x;}*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   356
# define EVENT_PRINTF2(x)       /*{ if (__debug__) printf x;}*/
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   357
# define EVENT_PRINTF3(x)       /* */
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   358
# define UNHANDLED_EVENT_PRINTF(x)  { if (__debug__) printf x;}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   359
#else
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   360
# define PRINTF(x)              /* */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   361
# define CPRINTF(x)             /* */
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   362
# define RES_BMP_PRINTF(x)      /* */
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   363
# define RESPRINTF(x)           /* */
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   364
# define RES1PRINTF(x)          /* */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   365
# define TH_DPRINTF(x)          /* */
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   366
# define POSTDPRINTF(x)         /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   367
# define DPRINTF(x)             /* */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   368
# define DDPRINTF(x)            /* */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   369
# define EVENT_PRINTF(x)        /* */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   370
# define EVENT_PRINTF2(x)       /* */
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   371
# define EVENT_PRINTF3(x)       /* */
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   372
# define UNHANDLED_EVENT_PRINTF(x)        /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   373
#endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   374
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   375
#define INFOPRINT(__x__)                 \
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   376
    if (@global(InfoPrinting) == true) { \
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   377
	__win32_fprintf __x__;           \
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   378
    }
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   379
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   380
#define BR_SOLID       0
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   381
#define BR_PATTERN     1
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   382
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   383
#define LINE_SOLID     0
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   384
#define LINE_DASH      1
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   385
#define LINE_DDASH     2
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   386
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   387
#ifdef KEEP_STD_CURSORS
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   388
# define _C_ARROW       1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   389
# define _C_CROSS       2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   390
# define _C_IBEAM       3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   391
# define _C_ICON        4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   392
# define _C_NO          5
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   393
# define _C_SIZE        6
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   394
# define _C_SIZEALL     7
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   395
# define _C_SIZENESW    8
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   396
# define _C_SIZENS      9
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   397
# define _C_SIZENWSE    10
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   398
# define _C_UPARROW     11
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   399
# define _C_WAIT        12
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   400
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   401
 static HCURSOR H_C_ARROW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   402
 static HCURSOR H_C_CROSS = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   403
 static HCURSOR H_C_IBEAM = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   404
 static HCURSOR H_C_ICON = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   405
 static HCURSOR H_C_NO = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   406
 static HCURSOR H_C_SIZE = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   407
 static HCURSOR H_C_SIZEALL = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   408
 static HCURSOR H_C_SIZENESW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   409
 static HCURSOR H_C_SIZENS = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   410
 static HCURSOR H_C_SIZENWSE = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   411
 static HCURSOR H_C_UPARROW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   412
 static HCURSOR H_C_WAIT = (HCURSOR)0;
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
   413
 static HCURSOR H_C_APPSTARTING = (HCURSOR)0;
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   414
#endif /* KEEP_STD_CURSORS */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   415
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   416
static int c_count;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   417
static int evRootX, evRootY;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   418
static int multiClickState;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   419
static UINT lastMSGTime;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   420
static UINT multiClickTime;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   421
static UINT nextMultiClickTime;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   422
static int destroyWin;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   423
static int __modifiers;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   424
static HDC __tmpDC;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   425
static int __isWinNT;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   426
static int __logPixelSY;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   427
static struct gcData *lastGcData = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   428
static int            lastGcOwnerThreadID = 0;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   429
#ifndef __rootDC
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   430
 static HDC __rootDC;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   431
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   432
2383
9a5be0903b57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2378
diff changeset
   433
/*
9a5be0903b57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2378
diff changeset
   434
 * does not work, yet
9a5be0903b57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2378
diff changeset
   435
 */
2511
5795501d41cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2508
diff changeset
   436
#define CACHE_LAST_DC
5795501d41cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2508
diff changeset
   437
#define CACHE_LAST_PEN
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   438
#define xxCACHE_LAST_BRUSH
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   439
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   440
#define WM_THREADCREATEWINDOW   WM_USER + 0x101
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   441
#define WM_THREADDESTROYWINDOW  WM_USER + 0x102
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   442
#define WM_THREADSETFOCUS       WM_USER + 0x103
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   443
#define WM_THREADSETCAPTURE     WM_USER + 0x104
2247
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   444
#define WM_THREADSETCURSOR      WM_USER + 0x105
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   445
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   446
#define hasEventQueued() (eventQueueHead != NULL)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   447
#define EVENT_THREAD_STACKSIZE  (4096*4)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   448
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   449
typedef int (*intf)(int);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   450
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
 * 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
   453
 */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   454
#define LI_TOPWIN       0x0001
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   455
#define LI_INPUTWIN     0x0002
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   456
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   457
typedef struct {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   458
	HCURSOR hCursor;
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   459
	int bgBrush;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   460
	int flag;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   461
	short minWidth;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   462
	short maxWidth;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   463
	short minHeight;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   464
	short maxHeight;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   465
	int eventMask;
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   466
	int bw;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   467
} localWindowInfo;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   468
typedef localWindowInfo *plocalWindowInfo;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   469
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   470
#define N_WINDOW_PRIVATE (sizeof(plocalWindowInfo))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   471
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   472
#define GETLOCALWINDOWINFOPTR(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   473
	((localWindowInfo*)GetWindowLong(__hWnd__, 0))
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   474
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   475
#define SETLOCALWINDOWINFOPTR(__hWnd__,__ptr__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   476
	SetWindowLong(__hWnd__, 0 , (DWORD)__ptr__)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   477
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   478
#define SetWindow_Cursor(__hWnd__, __hCurs__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   479
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor = __hCurs__) : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   480
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   481
#define GetWindow_Cursor(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   482
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   483
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   484
#define SetWindow_bgBrush(__hWnd__, __bgBrush__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   485
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->bgBrush = __bgBrush__) : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   486
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   487
#define GetWindow_bgBrush(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   488
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->bgBrush : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   489
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   490
#define SetWindow_bw(__hWnd__, __bw__) \
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   491
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->bw = __bw__) : 0)
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   492
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   493
#define GetWindow_bw(__hWnd__) \
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   494
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->bw : 0)
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   495
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   496
#define GetWindow_paintInfoPtr(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   497
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->paintInfo) : 0)
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   498
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   499
#define GetWindow_sizeInfoPtr(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   500
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->sizeInfo) : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   501
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   502
#define SetWindow_Flag(__hWnd__, __flag__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   503
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->flag = __flag__) : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   504
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   505
#define GetWindow_Flag(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   506
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->flag : 0)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   507
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   508
#define GetWindow_eventMask(__hWnd__) \
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   509
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->eventMask) : 0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   510
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   511
struct queuedEvent {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   512
	struct queuedEvent     *ev_next;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   513
	int                     count;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   514
	int                     ev_flag;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   515
	HWND                    ev_hWnd;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   516
	UINT                    ev_message;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   517
	UINT                    ev_wParam;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   518
	int                     ev_arg1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   519
	int                     ev_arg2;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   520
	int                     ev_arg3;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   521
	int                     ev_arg4;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   522
};
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   523
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   524
#define ev_x    ev_arg1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   525
#define ev_y    ev_arg2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   526
#define ev_w    ev_arg3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   527
#define ev_h    ev_arg4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   528
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   529
#define ev_keyCode   ev_wParam
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   530
#define ev_scanCode  ev_arg3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   531
#define ev_modifiers ev_arg4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   532
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   533
#define EV_CHUNK_CNT    10000
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   534
#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
   535
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   536
#define BITBLT_COPY             SRCCOPY
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   537
#define BITBLT_COPYINVERTED     NOTSRCCOPY
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   538
#define BITBLT_XOR              SRCINVERT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   539
#define BITBLT_AND              SRCAND
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   540
#define BITBLT_OR               SRCPAINT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   541
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   542
/*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   543
 * need threadSafe printf versions
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   544
 */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   545
#define printf  __win32_printf
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   546
#define fprintf __win32_fprintf
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   547
#define fflush  __win32_fflush
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   548
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   549
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   550
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   551
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   552
!WinWorkstation primitiveVariables!
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   553
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   554
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   555
static int firstInstance = 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   556
static char *app_name = "ST/X";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   557
static char *app_nameroot = "ST/X:Root";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   558
static int __debug__ = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   559
static int __depth;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   560
static HWND __rootWin = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   561
static HWND __rootWinSpezial = NULL;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   562
#if 0
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   563
static HDESK __rootDesk;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   564
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   565
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   566
static int activateOnClick = 1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   567
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   568
static int currentCapture = CAPTURE_NONE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   569
static int lastNCMouseX, lastNCMouseY;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   570
static int lastMoveX, lastMoveY, lastSizeWidth, lastSizeHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   571
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   572
static HANDLE currentPointerView = (HANDLE)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   573
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   574
/* MessageDispatchThread */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   575
static char *_thread_windowName;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   576
static char *_thread_className;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   577
static int _thread_winStyleBits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   578
static int _thread_winStyleBitsEx;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   579
static HANDLE _thread_parentHandle;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   580
static int _thread_x;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   581
static int _thread_y;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   582
static int _thread_dx;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   583
static int _thread_dy;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   584
static localWindowInfo *_thread_local;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   585
static HANDLE _thread_newWinHandle;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   586
#ifndef WIN32THREADS
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   587
static DWORD _masterThreadId;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   588
static HANDLE _masterThread;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   589
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   590
static DWORD _dispatchThreadId = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   591
static int lockcountQ = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   592
static int lockcountF = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   593
static HANDLE hEventQMutex;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   594
static HANDLE hEventFreeListMutex;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   595
static HANDLE hCreateEvent;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   596
static HANDLE hInputEvent;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   597
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   598
static int __cnt_bmpdc;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   599
static int __cnt_gcData;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   600
static int __cnt_createWindows;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   601
static int __cnt_bitmap;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   602
static int __cnt_cur;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   603
static int __cnt_font;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   604
struct queuedEvent *eventFreeList = (struct queuedEvent *)0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   605
struct queuedEvent *eventQueueHead = (struct queuedEvent *)0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   606
struct queuedEvent *eventQueueTail = (struct queuedEvent *)0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   607
static int eventsendcount = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   608
static int eventempfcount = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   609
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   610
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   611
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   612
!WinWorkstation primitiveFunctions!
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   613
%{
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   614
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   615
#ifdef xxWIN32THREADS
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   616
extern void __suspendAktThread();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   617
extern void __resumeAktThread();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   618
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   619
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   620
__debugEvent__() {}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   621
#ifdef DEBUGMASK
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   622
printMask(int mask)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   623
{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   624
    if (mask & KeyPressMask)        printf("KeyPressMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   625
    if (mask & KeyReleaseMask)      printf("KeyReleaseMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   626
    if (mask & ButtonPressMask)     printf("ButtonPressMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   627
    if (mask & ButtonReleaseMask)   printf("ButtonReleaseMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   628
    if (mask & ButtonMotionMask)    printf("ButtonMotionMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   629
    if (mask & PointerMotionMask)   printf("PointerMotionMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   630
    if (mask & ExposureMask)        printf("ExposureMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   631
    if (mask & FocusChangeMask)     printf("FocusChangeMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   632
    if (mask & EnterWindowMask)     printf("EnterWindowMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   633
    if (mask & LeaveWindowMask)     printf("LeaveWindowMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   634
    if (mask & KeymapStateMask)     printf("KeymapStateMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   635
    if (mask & VisibilityChangeMask)printf("VisibilityChangeMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   636
    if (mask & StructureNotifyMask) printf("StructureNotifyMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   637
    if (mask & ResizeRedirectMask)  printf("ResizeRedirectMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   638
    if (mask & PropertyChangeMask)  printf("PropertyChangeMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   639
    if (mask & ColormapChangeMask)  printf("ColormapChangeMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   640
}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   641
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   642
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   643
static int
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   644
st2RGB(int color,struct gcData *gcData)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   645
{
2418
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   646
    int ir,ig,ib;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   647
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   648
    if (gcData) {
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   649
	if (gcData->bitmapColorBitCount == 1) {
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   650
	  if (color)
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   651
	      return WhitePixel;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   652
	  else
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   653
	      return BlackPixel;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   654
	}
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   655
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   656
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   657
    return (color & 0xffffff);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   658
#else
2418
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   659
    if (__depth < 15) {
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   660
	return 0;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   661
    } else {
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   662
	if ((__depth == 16) || (__depth == 15)) {
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   663
	    ib = (color & 0x1f) << 3;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   664
	    ig = ((color >> 5) & 0x3f) << 2;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   665
	    ir = ((color >> 11) & 0x1f) << 3;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   666
	    ir |= 7;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   667
	    ig |= 3;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   668
	    ib |= 7;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   669
	    return RGB(ir,ig,ib);
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   670
	}
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   671
	return (color & 0xffffff);
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   672
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   673
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   674
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   675
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   676
static int
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   677
RGB2st(int r,int g,int b)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   678
{
2418
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   679
    int ir,ig,ib,id;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   680
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   681
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   682
    ir = (r >> 8) & 0xff;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   683
    ig = (g >> 8) & 0xff;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   684
    ib = (b >> 8) & 0xff;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   685
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   686
    id = RGB( ir, ig, ib);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   687
#else
2418
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   688
    if (__depth < 15) {
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   689
	id = 0;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   690
    } else {
2418
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   691
	if ((__depth == 16) || (__depth == 15)) {
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   692
	    ir = (r >> 11) & 0x1f;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   693
	    ig = (g >> 10) & 0x3f;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   694
	    ib = (b >> 11) & 0x1f;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   695
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   696
	    id = ( ir << 11 ) | ( ig << 5 ) | ib;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   697
	} else {
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   698
	    ir = (r >> 8) & 0xff;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   699
	    ig = (g >> 8) & 0xff;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   700
	    ib = (b >> 8) & 0xff;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   701
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   702
	    id = RGB( ir, ig, ib);
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   703
	}
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   704
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   705
#endif
2418
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   706
    return id;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   707
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   708
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   709
#ifdef DEBUG_DELETEOBJECT
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   710
static int
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   711
_DeleteObject(HANDLE o)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   712
{
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   713
    int r = DeleteObject(o);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   714
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   715
    if (r == 0)
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   716
	fprintf(stderr, "WinWorkstation: ERROR in DeleteObject\n");
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   717
    return r;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   718
}
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   719
#else
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   720
# define _DeleteObject  DeleteObject
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   721
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   722
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   723
static struct gcData *
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   724
newGcData() {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   725
    struct gcData *gcData = (struct gcData *)malloc(sizeof(struct gcData));
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   726
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   727
    if (! gcData) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
   728
	fprintf(stderr, "WinWorkstat [warning]: failed to allocate gcData\n");
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   729
	return 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   730
    }
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   731
    memset(gcData, 0, sizeof(struct gcData));
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   732
    gcData->fgColor = 0xffffff;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   733
    /* gcData->bgColor = 0; - not needed - memset does it */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   734
    gcData->clipping = FALSE;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   735
    gcData->clipByChild = TRUE;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   736
    gcData->bitbltrop2 = BITBLT_COPY;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   737
    gcData->lineWidth = 1;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   738
    gcData->lStyle = PS_SOLID | PS_JOIN_MITER | PS_ENDCAP_FLAT;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   739
    /* gcData->brushOrgX = gcData->brushOrgY = 0; - not needed - memset does it */
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   740
    /* gcData->hPen = 0; - not needed - memset does it */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   741
    /* gcData->hBrush = 0; - not needed - memset does it */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   742
    return gcData;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   743
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   744
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   745
#ifdef CACHE_LAST_DC
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   746
# define FLUSH_CACHED_DC(__gcData__) \
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   747
    if (lastGcData == __gcData__) {  \
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   748
	_releaseDC(lastGcData);      \
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   749
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   750
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   751
# define FLUSH_CACHED_DC(x)     /* */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   752
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   753
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   754
#ifdef CACHE_LAST_PEN
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   755
# define FLUSH_CACHED_PEN(__gcData__) \
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   756
    if (__gcData__->hPen) {           \
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   757
	if (__gcData__->save_hPen) {  \
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   758
	    SelectObject(__gcData__->_hDC, __gcData__->save_hPen); \
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   759
	    __gcData__->save_hPen = 0;   \
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   760
	}                                \
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   761
	_DeleteObject(__gcData__->hPen); \
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   762
	__gcData__->hPen = 0;            \
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   763
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   764
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   765
# define FLUSH_CACHED_PEN(x)    /* */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   766
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   767
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   768
#ifdef CACHE_LAST_BRUSH
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   769
# define FLUSH_CACHED_BRUSH(__gcData__) \
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   770
    if (__gcData__->hBrush) {           \
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   771
	_DeleteObject(__gcData__->hBrush); \
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   772
	__gcData__->hBrush = 0;            \
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   773
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   774
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   775
# define FLUSH_CACHED_BRUSH(x)    /* */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   776
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   777
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   778
static void
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   779
_releaseDC(gcData)
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   780
    struct gcData *gcData;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   781
{
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   782
    HDC hDC = gcData->_hDC;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   783
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   784
    if (gcData->save_hPen) {
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   785
	SelectObject(hDC, gcData->save_hPen);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   786
	gcData->save_hPen = 0;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   787
    }
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   788
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   789
    if (gcData->hWnd) {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   790
	if (hDC) {
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   791
	    ReleaseDC(gcData->hWnd, hDC);
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   792
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   793
    } else if (gcData->hBitmap) {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   794
	SelectObject(hDC, gcData->save_hBitmap);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   795
	DeleteDC(hDC);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   796
    }
2383
9a5be0903b57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2378
diff changeset
   797
    gcData->_hDC = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   798
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   799
#ifdef CACHE_LAST_PEN
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   800
    if (gcData->hPen) {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   801
	_DeleteObject(gcData->hPen);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   802
	gcData->hPen = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   803
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   804
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   805
#ifdef CACHE_LAST_BRUSH
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   806
    if (gcData->hBrush) {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   807
	_DeleteObject(gcData->hBrush);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   808
	gcData->hBrush = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   809
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   810
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   811
#ifdef CACHE_LAST_DC
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   812
    if (lastGcData == gcData) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   813
	lastGcData = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   814
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   815
#endif
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   816
}
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   817
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   818
static HDC
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   819
_getDC(gcData)
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   820
    struct gcData *gcData;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   821
{
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   822
#ifdef CACHE_LAST_DC
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
   823
    int currThreadId = GetCurrentThreadId();
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
   824
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   825
    if (lastGcData) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   826
	if ((lastGcData == gcData) 
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
   827
	 && (lastGcOwnerThreadID == currThreadId) 
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
   828
	) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   829
	    //printf(".");
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   830
	    return gcData->_hDC;
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   831
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   832
	_releaseDC(lastGcData);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   833
    }
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   834
#endif
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   835
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   836
    if (gcData->hWnd != 0) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   837
	if (__isWinNT && (gcData->hWnd == __rootWin)) {
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   838
	    gcData->_hDC = GetDCEx(gcData->hWnd,0,DCX_WINDOW);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   839
	    //gcData->_hDC = GetDC(gcData->hWnd);
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   840
	} else {
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   841
	    if (gcData->clipByChild) {
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   842
		//gcData->_hDC = GetDCEx(gcData->hWnd,0,DCX_CLIPCHILDREN);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   843
		gcData->_hDC = GetDC(gcData->hWnd);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   844
	    } else
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   845
		gcData->_hDC = GetDCEx(gcData->hWnd,0,DCX_PARENTCLIP);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   846
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   847
    } else if (gcData->hBitmap) {
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   848
	gcData->_hDC = CreateCompatibleDC(__tmpDC);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   849
	gcData->save_hBitmap = SelectObject(gcData->_hDC,gcData->hBitmap);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   850
    }
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   851
    if (gcData->_hDC) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   852
	SetTextColor(gcData->_hDC, gcData->bgColor);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   853
	SetBkColor(gcData->_hDC, gcData->fgColor);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
   854
	if (gcData->rop2) 
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   855
	    SetROP2(gcData->_hDC, gcData->rop2);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   856
	if (gcData->clipping) {
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   857
	    HRGN  region = CreateRectRgn( gcData->clipX,gcData->clipY,
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   858
					  gcData->clipX + gcData->clipW,
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   859
					  gcData->clipY + gcData->clipH );
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   860
	    if( region == NULL ) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   861
		DPRINTF((" clipping region creation failed!\n"));
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   862
	    } else {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   863
		if (SelectClipRgn(gcData->_hDC, region) == ERROR ) {
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   864
		    DPRINTF((" clipping region release unsuccessful\n" ));
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   865
		}
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   866
		/*printf("%x c\n",hDC);*/
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   867
		_DeleteObject(region);
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   868
	    }
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   869
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   870
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   871
#ifdef CACHE_LAST_DC
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   872
    lastGcData = gcData;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
   873
    lastGcOwnerThreadID = currThreadId;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   874
#endif
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   875
    return gcData->_hDC;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   876
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   877
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   878
static HBRUSH
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   879
GcDataGetBrush(hDC, gcData)
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   880
    HDC hDC;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   881
    struct gcData *gcData;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   882
{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   883
    HBRUSH hBrush = 0;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   884
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   885
#ifdef CACHE_LAST_BRUSH
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   886
    if (gcData->hBrush) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   887
	return gcData->hBrush;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   888
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   889
#endif
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   890
    if (gcData->hMask) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   891
	hBrush = CreatePatternBrush(gcData->hMask);
2340
0712b35328f6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
   892
	SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);       
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   893
	RESPRINTF(("CreatePatternBrush %x\n",gcData->hMask));
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   894
    } else {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   895
	hBrush = CreateSolidBrush(gcData->fgColor);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   896
	RESPRINTF(("CreateSolidBrush %x\n",gcData->fgColor));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   897
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   898
#ifdef CACHE_LAST_BRUSH
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   899
    gcData->hBrush = hBrush;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   900
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   901
    return hBrush;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   902
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   903
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   904
static HPEN
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   905
GcDataGetPen(hDC, gcData)
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   906
    HDC hDC;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   907
    struct gcData *gcData;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   908
{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   909
    HPEN hPen = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   910
    LOGBRUSH Brush;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   911
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   912
#ifdef CACHE_LAST_PEN
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   913
    if (gcData->hPen) {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   914
	if (! gcData->save_hPen) {
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   915
	    gcData->save_hPen = SelectObject(gcData->_hDC, gcData->hPen);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   916
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   917
	return gcData->hPen;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   918
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   919
#endif
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   920
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   921
    if (__isWinNT) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   922
	/*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   923
	 * NT supports masked drawing with any lineStyle
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   924
	 */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   925
	if (gcData->hMask) {
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   926
	    Brush.lbStyle = BS_PATTERN;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   927
	    Brush.lbHatch = (DWORD)gcData->hMask;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   928
	    Brush.lbColor = gcData->fgColor;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   929
	} else {
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   930
	    Brush.lbStyle = BS_SOLID;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   931
	    Brush.lbHatch = 0;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   932
	    Brush.lbColor = gcData->fgColor;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   933
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   934
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   935
	hPen = ExtCreatePen(PS_GEOMETRIC | gcData->lStyle,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   936
			  gcData->lineWidth,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   937
			  &Brush,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   938
			  0, 0);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   939
	RESPRINTF(("ExtCreatePen1 %x %d %x %x\n",
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   940
			gcData->lStyle,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   941
			gcData->lineWidth,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   942
			gcData->fgColor, gcData->hMask));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   943
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   944
	if (gcData->hMask) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   945
	    SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   946
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   947
    } else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   948
	/*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   949
	 * W95 only supports masked drawing with SOLID lines
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   950
	 */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   951
	if ((gcData->lStyle & PS_STYLE_MASK) == PS_SOLID) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   952
	    if (gcData->hMask) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   953
		Brush.lbStyle = BS_PATTERN;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   954
		Brush.lbHatch = (DWORD)gcData->hMask;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   955
		Brush.lbColor = gcData->fgColor;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   956
	    } else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   957
		Brush.lbStyle = BS_SOLID;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   958
		Brush.lbHatch = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   959
		Brush.lbColor = gcData->fgColor;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   960
	    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   961
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   962
	    hPen = ExtCreatePen(PS_GEOMETRIC | gcData->lStyle,
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   963
			      gcData->lineWidth,
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   964
			      &Brush,
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   965
			      0, 0);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   966
	    RESPRINTF(("ExtCreatePen1 %x %d %x %x\n",
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   967
			    gcData->lStyle,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   968
			    gcData->lineWidth,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   969
			    gcData->fgColor, gcData->hMask));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   970
	    if (gcData->hMask) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   971
		SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   972
	    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   973
	} else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   974
	    /*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   975
	     * dashes only supported with lineWidth 0
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   976
	     */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   977
	    if ((gcData->lStyle & PS_STYLE_MASK) == PS_SOLID) {
2383
9a5be0903b57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2378
diff changeset
   978
		hPen = CreatePen(PS_SOLID,
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   979
				 gcData->lineWidth,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   980
				 gcData->fgColor);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   981
	    } else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   982
		hPen = CreatePen((gcData->lStyle & PS_STYLE_MASK),
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   983
				 0,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   984
				 gcData->fgColor);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   985
	    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   986
	    RESPRINTF(("CreatePen %x %d %x\n",
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   987
				(gcData->lStyle & PS_STYLE_MASK),
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   988
				gcData->lineWidth,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   989
				gcData->fgColor));
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   990
	    //SetTextColor(hDC, gcData->fgColor);
2383
9a5be0903b57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2378
diff changeset
   991
	    //
9a5be0903b57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2378
diff changeset
   992
	    // CG: wrong; must set to opaque, if doubleDashed
9a5be0903b57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2378
diff changeset
   993
	    //    
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   994
	    SetBkMode(hDC, TRANSPARENT);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   995
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   996
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   997
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   998
#ifdef CACHE_LAST_PEN
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   999
    gcData->hPen = hPen;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1000
    gcData->save_hPen = SelectObject(hDC, hPen);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1001
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1002
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1003
    return hPen;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1004
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1005
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1006
#ifdef CACHE_LAST_PEN
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1007
# define GcDataReleasePen(hDC, gcData)  /* nothing*/
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1008
#else
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1009
static void
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1010
GcDataReleasePen(hDC, gcData)
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1011
    HDC hDC;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1012
    struct gcData *gcData;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1013
{
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1014
    if (gcData->saved_hPen) {
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1015
	SelectObject(hDC, gcData->saved_hPen);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1016
	gcData->saved_hPen = NULL;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1017
    }
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1018
    _DeleteObject(hPen); 
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1019
    gcData->hPen = 0;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1020
}
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1021
#endif
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1022
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1023
static int
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1024
lockEventQ() {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1025
    DWORD dwWaitResult;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1026
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1027
    /* Request ownership of mutex. */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1028
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1029
    dwWaitResult = WaitForSingleObject(
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1030
					hEventQMutex,   /* handle of mutex */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1031
					5000L);           /* time-out interval */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1032
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1033
    lockcountQ++;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1034
    if (lockcountQ != 1) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1035
	fprintf(stderr, "WinWorkstation: lockcountQ (%d) != 1\n", lockcountQ);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1036
	lockcountQ = 1;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1037
    }
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1038
    switch (dwWaitResult) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1039
	// The thread got mutex ownership.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1040
	case WAIT_OBJECT_0:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1041
	    break;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1042
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1043
	// Cannot get mutex ownership due to time-out.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1044
	case WAIT_TIMEOUT:
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1045
	    fprintf(stderr, "WinWorkstation: lockEventQ timeout\n");
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1046
	    return FALSE;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1047
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1048
	// Got ownership of the abandoned mutex object.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1049
	default:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1050
	    return FALSE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1051
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1052
    return TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1053
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1054
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1055
static void
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1056
unlockEventQ() {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1057
    lockcountQ--;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1058
    if (lockcountQ != 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1059
	fprintf(stderr, "WinWorkstation: lockcountQ (%d) != 0\n", lockcountQ);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1060
	lockcountQ = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1061
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1062
    /* Release ownership of the mutex object. */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1063
    if (! ReleaseMutex(hEventQMutex)) {
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1064
       /* Deal with error. */
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1065
       printf("unlock Error\n");
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1066
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1067
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1068
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1069
static int
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1070
lockEventFreeList() {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1071
    DWORD dwWaitResult;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1072
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1073
    /* Request ownership of mutex. */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1074
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1075
    dwWaitResult = WaitForSingleObject(
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1076
					hEventFreeListMutex,   /* handle of mutex */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1077
					5000L);           /* time-out interval */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1078
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1079
    lockcountF++;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1080
    if (lockcountF != 1) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1081
	fprintf(stderr, "WinWorkstation: lockcountF (%d) != 1\n", lockcountF);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1082
	lockcountF = 1;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1083
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1084
    switch (dwWaitResult) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1085
	// The thread got mutex ownership.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1086
	case WAIT_OBJECT_0:
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1087
	    break;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1088
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1089
	// Cannot get mutex ownership due to time-out.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1090
	case WAIT_TIMEOUT:
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1091
	    fprintf(stderr, "WinWorkstation: lockEventF timeout\n");
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1092
	    return FALSE;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1093
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1094
	// Got ownership of the abandoned mutex object.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1095
	default:
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1096
	    return FALSE;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1097
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1098
    return TRUE;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1099
}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1100
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1101
static void
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1102
unlockEventFreeList() {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1103
    lockcountF--;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1104
    if (lockcountF != 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1105
	fprintf(stderr, "WinWorkstation: lockcountF (%d) != 0\n", lockcountF);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1106
	lockcountF = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1107
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1108
    /* Release ownership of the mutex object. */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1109
    if (! ReleaseMutex(hEventFreeListMutex)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1110
       /* Deal with error. */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1111
       printf("unlock Error\n");
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1112
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1113
}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1114
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1115
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1116
static int
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1117
initqueue() {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1118
    struct queuedEvent *bulk;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1119
    int i = 0;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1120
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1121
    bulk = (struct queuedEvent *) malloc(EV_CHUNK_SZ);
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1122
    if (bulk == 0) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  1123
	fprintf(stderr, "WinWorkstation [warning]: no memory for dispatchqueue\n");
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  1124
	return 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1125
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1126
    for (i=1; i<EV_CHUNK_CNT; i++) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1127
	bulk[i-1].ev_next = &(bulk[i]);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1128
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1129
    bulk[EV_CHUNK_CNT-1].ev_next = (struct queuedEvent *)0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1130
    eventFreeList = bulk;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1131
    return 1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1132
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1133
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1134
#define ENQ_AT_END      0
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1135
#define ENQ_AT_FRONT    1
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1136
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1137
static void
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1138
enqEvent(atFront, flag, hWnd, message, wParam, arg1, arg2, arg3, arg4)
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1139
    HWND hWnd;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1140
    UINT message;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1141
    UINT wParam;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1142
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1143
    struct queuedEvent *ev = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1144
    int repeatCount = 0;
2511
5795501d41cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2508
diff changeset
  1145
    int needSetEvent;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1146
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1147
  again: ;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1148
    if (lockEventFreeList()) {
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1149
	ev = eventFreeList;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1150
	if (! ev) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1151
	    unlockEventFreeList();
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1152
	    SetEvent(hInputEvent);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1153
	    if (repeatCount++ < 5) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1154
		fprintf(stderr, "WinWorkstation: wait for event memory\n");
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1155
		Sleep(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1156
		goto again;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1157
	    }
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1158
	    fprintf(stderr, "WinWorkstation: event throw away\n");
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1159
	    /* throw away sorry */
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1160
	    return;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1161
	}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1162
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1163
	eventFreeList = ev->ev_next;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1164
	unlockEventFreeList();
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1165
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1166
	ev->ev_flag = flag;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1167
	ev->ev_hWnd = hWnd;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1168
	ev->ev_message = message;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1169
	ev->ev_wParam = wParam;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1170
	ev->ev_arg1 = arg1;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1171
	ev->ev_arg2 = arg2;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1172
	ev->ev_arg3 = arg3;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1173
	ev->ev_arg4 = arg4;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1174
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1175
	lockEventQ();
2511
5795501d41cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2508
diff changeset
  1176
	needSetEvent = (eventQueueHead == NULL);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1177
	if (atFront) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1178
	    ev->count = -1;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1179
	    ev->ev_next = eventQueueHead;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1180
	    eventQueueHead = ev;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1181
	    if (eventQueueTail == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1182
		eventQueueTail = ev;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1183
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1184
	} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1185
	    ev->count = eventsendcount++;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1186
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1187
	    ev->ev_next = (struct queuedEvent *)0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1188
	    if (eventQueueTail) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1189
		eventQueueTail->ev_next = ev;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1190
	    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1191
		eventQueueHead = ev;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1192
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1193
	    eventQueueTail = ev;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1194
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1195
	unlockEventQ();
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1196
2511
5795501d41cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2508
diff changeset
  1197
	if (needSetEvent) {
5795501d41cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2508
diff changeset
  1198
	    SetEvent(hInputEvent);
5795501d41cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2508
diff changeset
  1199
	}
5795501d41cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2508
diff changeset
  1200
2337
79f957096b99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2336
diff changeset
  1201
#if 0
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1202
	SetThreadPriority(_masterThread,THREAD_PRIORITY_HIGHEST);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1203
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1204
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1205
}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1206
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1207
static int
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1208
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
  1209
{
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1210
    struct queuedEvent *ev = NULL;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1211
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1212
    if (mask != ~0) {
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1213
	PRINTF(("deqEvent mask:%x\n",mask));
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1214
    }
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1215
    if (hWnd) {
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1216
	PRINTF(("deqEvent hWnd:%x\n",hWnd));
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1217
    }
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1218
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1219
  again: ;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1220
    if (lockEventQ()) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1221
	TH_DPRINTF(("TDEQ\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1222
	ev = eventQueueHead;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1223
	if (ev != NULL) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1224
	    eventQueueHead = ev->ev_next;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1225
	    if (! eventQueueHead) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1226
		eventQueueTail = (struct queuedEvent *)0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1227
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1228
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1229
	unlockEventQ();
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1230
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1231
	if (ev != NULL) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1232
	    if (ev->count != -1) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1233
		if (eventempfcount != ev->count) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1234
		    fprintf(stderr, "eventcount error %d <-> %d\n",eventempfcount,ev->count);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1235
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1236
		eventempfcount++;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1237
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1238
	    if (ev->ev_message == WM_DESTROY) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1239
		if (ev->ev_arg2) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1240
		    free((char*)ev->ev_arg2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1241
		    ev->ev_arg2 = 0;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1242
		}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1243
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1244
#ifdef TOPWINDOWCLASS
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1245
		if (ev->ev_arg1) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1246
		    if (UnregisterClass((char*)ev->ev_arg1,(HANDLE) __getHInstance())) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1247
			/*printf("UnregisterClass %s ok.\n",(char*)ev->ev_arg1);*/
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1248
			free((char*)ev->ev_arg1);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1249
			ev->ev_arg1 = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1250
		    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1251
			/* noch einmal in die queue */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1252
			if (ev->ev_arg2++ < 100) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1253
			    lockEventQ();
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1254
			    ev->ev_next = (struct queuedEvent *)0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1255
			    ev->count = eventsendcount++;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1256
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1257
			    if (eventQueueTail) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1258
				eventQueueTail->ev_next = ev;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1259
			    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1260
				eventQueueHead = ev;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1261
			    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1262
			    eventQueueTail = ev;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1263
			    unlockEventQ();
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1264
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1265
			    if (ev->ev_arg2 > 98) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1266
				fprintf(stderr, "WinWorkstation: UnregisterClass %s failed. Wait 1 sec.\n",(char*)ev->ev_arg1);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1267
				sleep(1);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1268
			    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1269
				sleep(0);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1270
			    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1271
			    goto again;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1272
			} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1273
			    /* fail evtl. später ändern und in st verzögert aufrufen */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1274
			    fprintf(stderr, "WinWorkstation: UnregisterClass %s failed.\n",(char*)ev->ev_arg1);
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1275
			    free((char*)ev->ev_arg1);
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1276
			    ev->ev_arg1 = 0;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1277
			}
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1278
		    }
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1279
		}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1280
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1281
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1282
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1283
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1284
	if (ev) {
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1285
	    *ret_ev = *ev;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1286
	    lockEventFreeList();
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1287
	    ev->ev_next = eventFreeList;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1288
	    eventFreeList = ev;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1289
	    unlockEventFreeList();
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1290
	}
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1291
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1292
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1293
#if 0
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1294
    if (!ev)
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1295
	SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_NORMAL);
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1296
#endif
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1297
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1298
    return (ev != 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1299
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1300
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1301
static
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1302
getModifiers()
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1303
{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1304
    int modifiers = 0;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1305
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1306
    if (GetKeyState(VK_SHIFT) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1307
	modifiers |= ShiftMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1308
    if (GetKeyState(VK_CONTROL) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1309
	modifiers |= ControlMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1310
#if 0
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1311
    if (GetKeyState(VK_RMENU) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1312
	modifiers |= RightAltMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1313
    if (GetKeyState(VK_LMENU) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1314
	modifiers |= LeftAltMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1315
#else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1316
    if (GetKeyState(VK_MENU) & 0x8000)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1317
	modifiers |= LeftAltMask;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1318
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1319
    if (GetKeyState(VK_LBUTTON) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1320
	modifiers |= Button1Mask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1321
    if (GetKeyState(VK_MBUTTON) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1322
	modifiers |= Button2Mask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1323
    if (GetKeyState(VK_RBUTTON) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1324
	modifiers |= Button3Mask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1325
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1326
    __modifiers = modifiers;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1327
    return modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1328
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1329
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1330
static
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1331
winEventProcessing(hWnd, message, wParam, lParam, pDefault)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1332
    HWND hWnd;                /* window handle                   */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1333
    UINT message;             /* type of message                 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1334
    UINT wParam;              /* additional information          */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1335
    LONG lParam;              /* additional information          */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1336
    int *pDefault;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1337
{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1338
    LPMINMAXINFO lpmmi;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1339
    WINDOWPOS *posStruct;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1340
    RECT upd;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1341
    int modifiers;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1342
    int curButton;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1343
    int x, y, w, h;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1344
    int isNative = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1345
    PAINTSTRUCT ps;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1346
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1347
/*
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1348
    EVENT_PRINTF(("winEvent hWin=0x%x message=0x%x wP=0x%x lP=0x%x\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1349
			hWnd, message, wParam, lParam));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1350
*/
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1351
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1352
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1353
    /*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1354
     * messages which are enqueued to be handled by the view thread
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1355
     */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1356
    switch (message) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1357
	case WM_CREATE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1358
	    {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1359
		CREATESTRUCT *lpcs = (LPCREATESTRUCT) lParam; // structure with creation data
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1360
		SETLOCALWINDOWINFOPTR(hWnd,lpcs->lpCreateParams);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1361
		if (GETLOCALWINDOWINFOPTR(hWnd) != lpcs->lpCreateParams) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1362
		    PRINTF(("SETLOCALWINDOWINFOPTR ERROR\n"));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1363
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1364
		*pDefault = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1365
#ifdef COUNT_RESOURCES
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1366
		__cnt_createWindows++;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1367
		RESPRINTF(("CreateWindows %d\n",__cnt_createWindows));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1368
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1369
		DPRINTF(("WM_CREATE\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1370
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1371
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1372
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1373
	case WM_THREADDESTROYWINDOW:
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1374
	    if (! DestroyWindow(hWnd)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1375
		DPRINTF(("DestroyWindow ERROR\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1376
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1377
	    *pDefault = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1378
	    return 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1379
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1380
	case WM_CLOSE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1381
	    DPRINTF(("WM_CLOSE\n"));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1382
	    if (! destroyWin) {
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1383
		enqEvent(ENQ_AT_END, 0, hWnd, message, wParam, 0, 0, 0, 0);
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1384
	    } else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1385
		destroyWin = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1386
		if (!DestroyWindow(hWnd)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1387
		    DPRINTF(("DestroyWindow ERROR\n"));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1388
		}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1389
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1390
	    *pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1391
	    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1392
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1393
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1394
	case WM_DESTROY:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1395
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1396
	      char *n = 0;
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  1397
	      char *l;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1398
	      DPRINTF(("WM_DESTROY\n"));
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  1399
	      l = (char *)GETLOCALWINDOWINFOPTR(hWnd);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1400
#ifdef TOPWINDOWCLASS
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1401
	      if (l) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1402
		  if (GETLOCALWINDOWINFOPTR(hWnd)->flag & LI_TOPWIN) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  1403
		      n = (char*) malloc(200);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1404
		      GetClassName(hWnd,n,200);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1405
		  }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1406
		  /* free all resources */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1407
		  /*if (GetWindow_bgBrush(hWnd))
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1408
		   *    _DeleteObject(GetWindow_bgBrush(hWnd));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1409
		   */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1410
		  //free(GETLOCALWINDOWINFOPTR(hWnd));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1411
	      }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1412
#endif
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1413
	      SETLOCALWINDOWINFOPTR(hWnd,0);
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1414
	      enqEvent(ENQ_AT_END, 0, hWnd, message, wParam, (int)n, (int)l, 0, 0);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1415
#ifdef COUNT_RESOURCES
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1416
	      __cnt_createWindows--;
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1417
	      RESPRINTF(("DestroyWindows %d\n",__cnt_createWindows));
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1418
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1419
	      *pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1420
	      return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1421
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1422
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1423
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1424
	case WM_GETMINMAXINFO:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1425
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1426
		lpmmi = (LPMINMAXINFO) lParam;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1427
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1428
		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
  1429
			    hWnd,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1430
			    lpmmi->ptMinTrackSize.x,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1431
			    lpmmi->ptMinTrackSize.y));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1432
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1433
		if (GETLOCALWINDOWINFOPTR(hWnd) &&
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1434
		    GETLOCALWINDOWINFOPTR(hWnd)->minWidth &&
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1435
		    GETLOCALWINDOWINFOPTR(hWnd)->maxWidth
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1436
		   )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1437
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1438
		  lpmmi->ptMaxSize.x = GETLOCALWINDOWINFOPTR(hWnd)->maxWidth;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1439
		  lpmmi->ptMaxSize.y = GETLOCALWINDOWINFOPTR(hWnd)->maxHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1440
		  lpmmi->ptMaxTrackSize.x = GETLOCALWINDOWINFOPTR(hWnd)->maxWidth;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1441
		  lpmmi->ptMaxTrackSize.y = GETLOCALWINDOWINFOPTR(hWnd)->maxHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1442
		  lpmmi->ptMinTrackSize.x = GETLOCALWINDOWINFOPTR(hWnd)->minWidth;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1443
		  lpmmi->ptMinTrackSize.y = GETLOCALWINDOWINFOPTR(hWnd)->minHeight;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1444
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1445
		  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
  1446
				  hWnd,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1447
				  GETLOCALWINDOWINFOPTR(hWnd)->minWidth, GETLOCALWINDOWINFOPTR(hWnd)->minHeight,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1448
				  GETLOCALWINDOWINFOPTR(hWnd)->maxWidth, GETLOCALWINDOWINFOPTR(hWnd)->maxHeight));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1449
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1450
		*pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1451
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1452
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1453
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1454
	case WM_SETCURSOR:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1455
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1456
		HCURSOR curs;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1457
		int hitCode;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1458
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1459
		hitCode = LOWORD(lParam);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1460
		if (hitCode != HTCLIENT) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1461
		    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1462
		     * not in client area ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1463
		     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1464
		    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1465
		}
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  1466
		DDPRINTF(("WM_SETCURSOR\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1467
		curs = GetWindow_Cursor(hWnd);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1468
		if (curs) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1469
		    SetCursor(curs);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1470
		    *pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1471
		    return 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1472
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1473
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1474
	    return 0;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1475
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1476
	case WM_WINDOWPOSCHANGED:
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1477
	    if (currentCapture == CAPTURE_NONE) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1478
		POINT p;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1479
		HWND hWndChild,hWndTemp;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1480
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1481
		if (hWnd == __rootWinSpezial) {
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1482
		    *pDefault = 1;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1483
		    return 0;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1484
		}
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1485
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1486
		p.x = evRootX;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1487
		p.y = evRootY;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1488
		ScreenToClient(hWnd, &p);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1489
		hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1490
		do {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1491
		    hWndTemp = hWndChild;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1492
		    hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1493
		} while ((hWndChild) && (hWndChild != hWndTemp));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1494
		if (hWndChild /*&& (hWndChild != hWnd)*/) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1495
		    modifiers = getModifiers();
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1496
		    if (hWndChild != currentPointerView) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1497
			if (currentPointerView) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1498
			    if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1499
				enqEvent(ENQ_AT_END, LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1500
			    currentPointerView = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1501
			}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1502
			if (GetWindow_eventMask(hWndChild) & EnterWindowMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1503
			    enqEvent(ENQ_AT_END, EnterWindowMask,hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1504
			//SetFocus(hWndChild);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1505
			//printf("WM_WINDOWPOSCHANGED h=%x p=%d.%d in %x\n", hWnd,p.x,p.y,hWndChild);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1506
			currentPointerView = hWndChild;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1507
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1508
		}
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1509
	    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1510
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1511
	    /*
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1512
	     * ignore child window messages ...
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1513
	     */
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1514
	    if (GetParent(hWnd)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1515
		break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1516
	    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1517
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1518
	    {
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1519
		WINDOWPOS *wp = (WINDOWPOS *)lParam;
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1520
		RECT rct;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1521
		int x, y, w, h;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1522
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1523
#if 0
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1524
		if (wp->flags & SWP_HIDEWINDOW) {
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1525
printf("W_UNMAPPED\n");
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1526
		}
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1527
		if (wp->flags & SWP_SHOWWINDOW) {
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1528
printf("W_MAPPED\n");
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1529
		}
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1530
#endif
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1531
		GetClientRect(hWnd, &rct);
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1532
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1533
		x = rct.left;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1534
		y = rct.top;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1535
		w = rct.right - rct.left;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1536
		h = rct.bottom - rct.top;
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1537
		DPRINTF(("WM_WINDOWPOSCHANGED %d %d %d %d %x ->",wp->x,wp->y,wp->cx,wp->cy,wp->flags));
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1538
		DPRINTF(("%d %d %d %d\n",x, y, w, h));
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1539
		enqEvent(ENQ_AT_END, 0, hWnd, message, wParam, x, y, w, h);
2464
ad7fcfff0b0c fix slow GUI painter startup - finally
Claus Gittinger <cg@exept.de>
parents: 2463
diff changeset
  1540
#ifdef MAKES_GUI_PAINTER_START_SLOW
2491
be54b494a252 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2464
diff changeset
  1541
		*pDefault = 0;
2464
ad7fcfff0b0c fix slow GUI painter startup - finally
Claus Gittinger <cg@exept.de>
parents: 2463
diff changeset
  1542
#endif
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1543
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1544
	    return 0;
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1545
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1546
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1547
	case WM_ERASEBKGND:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1548
	    EVENT_PRINTF(("WM_ERASEBKGND\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1549
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1550
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1551
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1552
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1553
	    *pDefault = 0;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1554
	    return 1;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1555
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1556
	case WM_PAINT:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1557
	    EVENT_PRINTF(("WM_PAINT\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1558
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1559
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1560
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1561
	    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1562
	    if (((GetWindow_Flag(hWnd) & LI_INPUTWIN) == 0) && (__rootWinSpezial != hWnd)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1563
		if (GetUpdateRect(hWnd, &upd, FALSE)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1564
		    if (GetWindow_eventMask(hWnd) & ExposureMask) {
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1565
# ifndef LATE_PAINT
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1566
			HDC dc = (HDC)GetDC(hWnd);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1567
			HBRUSH br = CreateSolidBrush(st2RGB(GetWindow_bgBrush(hWnd),0));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1568
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1569
			if (br) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1570
			    // printf("erase %d %d %d %d\n",rec.left,rec.top,rec.right,rec.bottom);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1571
			    SelectClipRgn(dc,0);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1572
			    FillRect(dc, &upd, br);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1573
			    _DeleteObject(br);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1574
			}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1575
			ReleaseDC(hWnd,dc);
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1576
# endif
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1577
			enqEvent(ENQ_AT_END, ExposureMask, hWnd, message, wParam, upd.left, upd.top, upd.right-upd.left+1, upd.bottom-upd.top+1);
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  1578
		    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1579
		}
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1580
	    } else {
2463
b72624912746 GUI painter slow startup
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
  1581
# ifdef THIS_MAKES_GUI_PAINTER_START_SLOW
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1582
		*pDefault = 0;
2463
b72624912746 GUI painter slow startup
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
  1583
# endif
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1584
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1585
	    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1586
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1587
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1588
	case WM_SIZE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1589
	    EVENT_PRINTF(("WM_SIZE\n"));
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1590
#if 0
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1591
	    switch(wParam)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1592
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1593
	      case SIZE_RESTORED:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1594
	      case SIZE_MAXIMIZED:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1595
		GetClientRect(hWnd, (LPRECT) &upd);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1596
		if (GetWindow_eventMask(hWnd) & ExposureMask)
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  1597
		    enqEvent(ENQ_AT_END, ExposureMask, hWnd, WM_PAINT, wParam, upd.left, upd.top, upd.right-upd.left+1, upd.bottom-upd.top+1);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1598
		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
  1599
		break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1600
	    }
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1601
#endif
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1602
	    *pDefault = 0;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1603
	    return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1604
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1605
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1606
	case WM_DROPFILES:
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1607
	    EVENT_PRINTF(("WM_DROPFILES\n"));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1608
	    enqEvent(ENQ_AT_END, 0, hWnd, message, wParam, 0,0,0,0);
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1609
	    break;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1610
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1611
	case WM_SHOWWINDOW:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1612
	    EVENT_PRINTF(("WM_SHOWWINDOW\n"));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1613
	    enqEvent(ENQ_AT_END, 0, hWnd, message, wParam, 0, 0, 0, 0);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1614
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1615
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1616
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1617
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1618
	    break;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1619
	    //*pDefault = 0;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1620
	    //return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1621
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1622
	case WM_MOUSEACTIVATE :
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1623
	    EVENT_PRINTF2(("WM_MOUSEACTIVATE h=%x\n", hWnd));
2597
6031441d0f0d send activate:view: on WM_ACTIVATE / WM_INACTIVATE
Claus Gittinger <cg@exept.de>
parents: 2593
diff changeset
  1624
	    if (! activateOnClick) {
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1625
		*pDefault = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1626
		if ((__rootWinSpezial == hWnd) || (GetActiveWindow() && (LOWORD(lParam) == HTCLIENT)) 
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1627
		    /*((GETLOCALWINDOWINFOPTR(hWnd)->flag & LI_TOPWIN) == 0) */
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  1628
		) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  1629
		    return MA_NOACTIVATE;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1630
		} else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1631
		    return MA_ACTIVATE;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1632
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1633
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1634
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1635
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1636
	case WM_NCHITTEST:
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1637
	    EVENT_PRINTF(("WM_NCHITTEST\n"));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1638
	    if (hWnd == __rootWinSpezial) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1639
		*pDefault = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1640
		return HTCLIENT;
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1641
	    }
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1642
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1643
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1644
	case WM_NCACTIVATE:
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1645
	    EVENT_PRINTF(("WM_NCACTIVATE\n"));
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1646
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1647
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1648
	case WM_ACTIVATE:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1649
	    CPRINTF(("WM_ACTIVATE %s h=%x\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1650
			    LOWORD(wParam) ? "active" : "inactive",
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1651
			    hWnd));
2597
6031441d0f0d send activate:view: on WM_ACTIVATE / WM_INACTIVATE
Claus Gittinger <cg@exept.de>
parents: 2593
diff changeset
  1652
	    //if (! activateOnClick)
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1653
	    {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1654
		switch (LOWORD(wParam)) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1655
		    case WA_INACTIVE:
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1656
			EVENT_PRINTF2(("WM_ACTIVATE inactive h=%x\n", hWnd));
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1657
			break;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1658
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1659
		    case WA_ACTIVE:
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1660
			EVENT_PRINTF2(("WM_ACTIVATE active h=%x\n", hWnd));
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1661
#if 0
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1662
			if (currentCapture == CAPTURE_NONE) {
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1663
			  POINT p;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1664
			  HWND hWndChild,hWndTemp;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1665
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1666
			  p.x = evRootX;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1667
			  p.y = evRootY;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1668
			  ScreenToClient(hWnd, &p);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1669
			  hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1670
			  do {
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1671
			    hWndTemp = hWndChild;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1672
			    hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1673
			  } while ((hWndChild) && (hWndChild != hWndTemp));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1674
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1675
			  /*printf("WM_ACTIVATE active h=%x p=%d.%d in %x\n", hWnd,p.x,p.y,hWndChild);*/
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1676
			  if (hWndChild /*&& (hWndChild != hWnd)*/) {
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1677
			      modifiers = getModifiers();
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1678
			      if (hWndChild != currentPointerView) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1679
				  if (currentPointerView) {
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1680
				      if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1681
					enqEvent(ENQ_AT_END, LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers);
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1682
				      currentPointerView = 0;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1683
				  }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1684
				  if (GetWindow_eventMask(hWndChild) & EnterWindowMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1685
				    enqEvent(ENQ_AT_END, EnterWindowMask,hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers);
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1686
				  //SetFocus(hWndChild);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1687
				  currentPointerView = hWndChild;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1688
			      }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1689
			  }
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1690
			}
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1691
#endif
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1692
			break;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1693
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1694
		    case WA_CLICKACTIVE:
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1695
			EVENT_PRINTF2(("WM_ACTIVATE clkactive h=%x\n", hWnd));
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1696
			break;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1697
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1698
		    default:
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1699
			EVENT_PRINTF2(("WM_ACTIVATE ? h=%x\n", hWnd));
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1700
			break;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1701
		}
2597
6031441d0f0d send activate:view: on WM_ACTIVATE / WM_INACTIVATE
Claus Gittinger <cg@exept.de>
parents: 2593
diff changeset
  1702
		enqEvent(ENQ_AT_END, 0, hWnd, message, wParam, 0, 0, 0, 0);
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1703
		if (isNative) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1704
		    *pDefault = 1;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1705
		    return 0;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1706
		}
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1707
		*pDefault = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1708
		return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1709
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1710
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1711
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1712
	case WM_SYSCHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1713
	    EVENT_PRINTF2(("WM_SYSCHAR h=%x %x\n", hWnd, wParam));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1714
	    goto commonChar;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1715
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1716
	case WM_CHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1717
	    EVENT_PRINTF2(("WM_CHAR h=%x %x\n", hWnd, wParam));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1718
	commonChar:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1719
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1720
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1721
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1722
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1723
	    {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1724
		HWND destWindow;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1725
		int evMask;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1726
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1727
		destWindow = currentPointerView;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1728
		if (destWindow == 0) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1729
		    destWindow = hWnd;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1730
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1731
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1732
		evMask = GetWindow_eventMask(destWindow);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1733
		if (evMask & (KeyPressMask | KeyReleaseMask)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1734
		    POINT p;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1735
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1736
		    modifiers = getModifiers();
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1737
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1738
		    p.x = evRootX;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1739
		    p.y = evRootY;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1740
		    ScreenToClient(destWindow, &p);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1741
		    x = p.x;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1742
		    y = p.y;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1743
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1744
		    if (evMask & KeyPressMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1745
			enqEvent(ENQ_AT_END, KeyPressMask, destWindow, WM_KEYDOWN, wParam, x, y, lParam, modifiers | TRANSLATED_KEY);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1746
		    if (evMask & KeyReleaseMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1747
			enqEvent(ENQ_AT_END, KeyReleaseMask, destWindow, WM_KEYUP, wParam, x, y, lParam, modifiers | TRANSLATED_KEY);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1748
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1749
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1750
	    *pDefault = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1751
	    return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1752
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1753
	case WM_KEYUP:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1754
	    EVENT_PRINTF2(("WM_KEYUP h=%x %x\n", hWnd, wParam));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1755
	    goto commonKeyUp;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1756
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1757
	case WM_SYSKEYUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1758
	    EVENT_PRINTF2(("WM_SYSKEYUP %x\n, wParam"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1759
	commonKeyUp:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1760
	    if (isNative) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1761
		*pDefault = 1;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1762
		return 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1763
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1764
	    {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1765
		HWND destWindow;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1766
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1767
		destWindow = currentPointerView;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1768
		if (destWindow == 0) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1769
		    destWindow = hWnd;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1770
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1771
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1772
		if (GetWindow_eventMask(destWindow) & KeyReleaseMask) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1773
		    POINT p;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1774
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1775
		    p.x = evRootX;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1776
		    p.y = evRootY;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1777
		    ScreenToClient(destWindow, &p);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1778
		    x = p.x;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1779
		    y = p.y;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1780
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1781
		    modifiers = getModifiers();
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1782
		    enqEvent(ENQ_AT_END, KeyReleaseMask, destWindow, message, wParam, x, y, lParam, modifiers);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1783
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1784
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1785
	    *pDefault = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1786
	    return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1787
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1788
	case WM_SYSKEYDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1789
	    EVENT_PRINTF2(("WM_SYSKEYDOWN %x\n, wParam"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1790
	    goto commonKey;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1791
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1792
	case WM_KEYDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1793
	    EVENT_PRINTF2(("WM_KEYDOWN h=%x %x\n", hWnd, wParam));
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1794
#if 0
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1795
	    /* while debugging ... */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1796
	    if (wParam == VK_ESCAPE) {
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1797
		currentCapture = CAPTURE_NONE;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1798
		ReleaseCapture();
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1799
		CPRINTF(("ReleaseCapture <ESC>\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1800
	    }
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1801
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1802
	commonKey:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1803
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1804
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1805
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1806
	    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1807
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1808
	    {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1809
		HWND destWindow;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1810
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1811
		destWindow = currentPointerView;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1812
		if (destWindow == 0) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1813
		    destWindow = hWnd;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1814
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1815
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1816
		if (GetWindow_eventMask(destWindow) & KeyPressMask) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1817
		    POINT p;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1818
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1819
		    p.x = evRootX;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1820
		    p.y = evRootY;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1821
		    ScreenToClient(destWindow, &p);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1822
		    x = p.x;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1823
		    y = p.y;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1824
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1825
		    modifiers = getModifiers();
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1826
		    enqEvent(ENQ_AT_END, KeyPressMask, destWindow, message, wParam, x, y, lParam, modifiers);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1827
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1828
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1829
	    *pDefault = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1830
	    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1831
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1832
	case WM_MOUSEMOVE:
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  1833
	    EVENT_PRINTF3(("WM_MOUSEMOVE h=%x\n", hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1834
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1835
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1836
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1837
	    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1838
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1839
	    {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1840
		short x, y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1841
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1842
		x = (int)(short)LOWORD(lParam);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1843
		y = (int)(short)HIWORD(lParam);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1844
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1845
		modifiers = getModifiers();
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1846
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1847
		if (currentCapture == CAPTURE_NONE) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1848
		    if (hWnd != currentPointerView) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1849
			if (currentPointerView) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1850
			    if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1851
				enqEvent(ENQ_AT_END, LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1852
			    currentPointerView = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1853
			}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1854
			if (GetWindow_eventMask(hWnd) & EnterWindowMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1855
			    enqEvent(ENQ_AT_END, EnterWindowMask,hWnd, __WM_MOUSEENTER, 0, x, y, 0, modifiers);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1856
			currentPointerView = hWnd;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1857
		    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  1858
		    DDPRINTF(("MouseMove %x\n", currentPointerView));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1859
		} else {
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  1860
		    CPRINTF(("MouseMove Capture %x\n", currentPointerView));
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1861
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1862
		if (    (GetWindow_eventMask(currentPointerView) & PointerMotionMask)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1863
		     || (modifiers & (Button1Mask|Button2Mask|Button3Mask))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1864
		   )
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1865
		     enqEvent(ENQ_AT_END, PointerMotionMask,currentPointerView, message, wParam, x, y, 0, modifiers);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1866
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1867
	    *pDefault = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1868
	    return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1869
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1870
	case WM_LBUTTONUP:
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1871
	    curButton = Button1;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1872
	    goto commonButtonUp;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1873
	case WM_MBUTTONUP:
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1874
	    curButton = Button2;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1875
	    goto commonButtonUp;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1876
	case WM_RBUTTONUP:
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1877
	    curButton = Button3;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1878
commonButtonUp:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1879
	    if (isNative) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1880
		*pDefault = 1;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1881
		return 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1882
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1883
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1884
	    if (currentCapture == curButton /* CAPTURE_IMPLICIT*/) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1885
		currentCapture = CAPTURE_NONE;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1886
		ReleaseCapture();
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1887
		CPRINTF(("ReleaseCapture <BUTTONUP>\n"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1888
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1889
	    modifiers = getModifiers();
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1890
	    EVENT_PRINTF3(("WM_BUTTONUP h=%x pos=%d/%d\n",
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1891
			   hWnd, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam)));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1892
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1893
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1894
	    if (GetWindow_eventMask(hWnd) & ButtonReleaseMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1895
		enqEvent(ENQ_AT_END, ButtonReleaseMask, hWnd, 
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1896
			 message, wParam, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam),
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1897
			 wParam, modifiers);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1898
	    *pDefault = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1899
	    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1900
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1901
	case WM_LBUTTONDOWN:
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1902
	    curButton = Button1;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1903
	    goto commonButtonDown;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1904
	case WM_MBUTTONDOWN:
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1905
	    curButton = Button2;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1906
	    goto commonButtonDown;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1907
	case WM_RBUTTONDOWN:
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1908
	    curButton = Button3;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1909
commonButtonDown:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1910
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1911
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1912
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1913
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1914
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1915
	    if (currentCapture == CAPTURE_NONE) {
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1916
		currentCapture = curButton /*CAPTURE_IMPLICIT*/;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1917
		//SetFocus(hWnd);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1918
		SetCapture(hWnd);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1919
		CPRINTF(("SetCapture <BUTTONDOWN>%x\n",hWnd));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1920
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1921
	    goto commonButton;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1922
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1923
	case WM_LBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1924
	case WM_MBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1925
	case WM_RBUTTONDBLCLK:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1926
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1927
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1928
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1929
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1930
	commonButton:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1931
	    modifiers = getModifiers();
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1932
	    EVENT_PRINTF3(("WM_BUTTONDOWN h=%x pos=%d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1933
			   hWnd, LOWORD(lParam), HIWORD(lParam)));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1934
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1935
	    if (GetWindow_eventMask(hWnd) & ButtonPressMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1936
		enqEvent(ENQ_AT_END, ButtonPressMask, hWnd, 
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1937
			 message, wParam, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam),
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1938
			 wParam, modifiers);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1939
	    *pDefault = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1940
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1941
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1942
	case WM_CAPTURECHANGED:
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1943
	    CPRINTF(("WM_CAPTURECHANGED %x to %x\n",hWnd,lParam));
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1944
#if 0
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1945
	    if ((currentCapture != CAPTURE_NONE) && (currentCapture != CAPTURE_EXPLICIT))
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1946
	    {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1947
	    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1948
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1949
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1950
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1951
	case WM_KILLFOCUS:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1952
	    CPRINTF(("WM_KILLFOCUS\n"));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1953
	    //enqEvent(ENQ_AT_END, 0,hWnd, message, wParam, 0, 0, 0, 0);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1954
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1955
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1956
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1957
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1958
	    *pDefault = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1959
	    return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1960
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1961
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1962
	case WM_SETFOCUS:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1963
	    CPRINTF(("WM_SETFOCUS %x\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1964
#if 0
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1965
	    //enqEvent(ENQ_AT_END, 0,hWnd, message, wParam, 0, 0, 0, 0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1966
	    {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1967
		POINT p;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1968
		HWND hWndChild,hWndTemp;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1969
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1970
		p.x = evRootX;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1971
		p.y = evRootY;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1972
		ScreenToClient(hWnd, &p);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1973
		hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1974
		do {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1975
		    hWndTemp = hWndChild;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1976
		    hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1977
		} while ((hWndChild) && (hWndChild != hWndTemp));
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  1978
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1979
		/*printf("WM_ACTIVATE active h=%x p=%d.%d in %x\n", hWnd,p.x,p.y,hWndChild);*/
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1980
		if (hWndChild /*&& (hWndChild != hWnd)*/) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1981
		    modifiers = getModifiers();
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1982
		    if (hWndChild != currentPointerView) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1983
			if (currentPointerView) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1984
			    if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1985
			      enqEvent(ENQ_AT_END, LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1986
			    currentPointerView = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1987
			}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1988
			if (GetWindow_eventMask(hWndChild) & EnterWindowMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1989
			    enqEvent(ENQ_AT_END, EnterWindowMask,hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1990
			//SetFocus(hWndChild);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1991
			currentPointerView = hWndChild;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1992
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1993
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1994
	    }
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1995
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1996
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1997
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1998
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1999
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2000
	    *pDefault = 0;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2001
#endif
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  2002
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2003
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2004
	case WM_STYLECHANGING:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2005
	    UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGING\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2006
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2007
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2008
	case WM_STYLECHANGED:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2009
	    UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGED\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2010
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2011
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2012
	case WM_GETTEXT:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2013
	    /*EVENT_PRINTF(("WM_GETTEXT %x\n", message));*/
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2014
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2015
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2016
	case WM_GETTEXTLENGTH:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2017
	    EVENT_PRINTF(("WM_GETTEXTLENGTH %x\n", message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2018
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2019
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2020
	case WM_NCCREATE:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2021
	    EVENT_PRINTF(("WM_NCCREATE %x\n", message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2022
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2023
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2024
	case WM_NCMOUSEMOVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2025
	    {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2026
		short x, y;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2027
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2028
		x = (int)(short)LOWORD(lParam);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2029
		y = (int)(short)HIWORD(lParam);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2030
		EVENT_PRINTF(("WM_NCMOUSEMOVE %d/%d\n", x, y));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2031
		lastNCMouseX = x;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2032
		lastNCMouseY = y;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2033
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2034
		modifiers = getModifiers();
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2035
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2036
		if (currentCapture == CAPTURE_NONE) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2037
		    if (hWnd != currentPointerView) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2038
			if (currentPointerView) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2039
			    if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2040
			      enqEvent(ENQ_AT_END, LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2041
			    currentPointerView = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2042
			}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2043
		    }
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2044
		}
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2045
	    }
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2046
	    *pDefault = 0;
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2047
	    return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2048
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2049
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2050
	case WM_PARENTNOTIFY:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2051
	    EVENT_PRINTF2(("WM_PARENTNOTIFY h=%x hChild=%x %d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2052
				hWnd, lParam, LOWORD(wParam)));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2053
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2054
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2055
	case WM_NCLBUTTONDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2056
	    EVENT_PRINTF(("WM_NCLBUTTONDOWN\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2057
	    {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2058
		short x, y;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2059
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2060
		x = (int)(short)LOWORD(lParam);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2061
		y = (int)(short)HIWORD(lParam);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2062
		lastNCMouseX = x;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2063
		lastNCMouseY = y;
2499
94c889dc8df6 shift-click in title-area is "lower-window"
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  2064
94c889dc8df6 shift-click in title-area is "lower-window"
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  2065
		/*
94c889dc8df6 shift-click in title-area is "lower-window"
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  2066
		 * with shift, this is a lower-operation
94c889dc8df6 shift-click in title-area is "lower-window"
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  2067
		 */
94c889dc8df6 shift-click in title-area is "lower-window"
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  2068
		if (GetKeyState(VK_SHIFT) & 0x8000) {
94c889dc8df6 shift-click in title-area is "lower-window"
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  2069
		    SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE|SWP_NOSIZE);
94c889dc8df6 shift-click in title-area is "lower-window"
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  2070
		    *pDefault = 0;
94c889dc8df6 shift-click in title-area is "lower-window"
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  2071
		}
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2072
	    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2073
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2074
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2075
	case WM_NCLBUTTONUP:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2076
	    EVENT_PRINTF(("WM_NCLBUTTONUP\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2077
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2078
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2079
	case WM_NCRBUTTONDOWN:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2080
	    EVENT_PRINTF(("WM_NCRBUTTONDOWN\n"));
2508
008953d74e91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2499
diff changeset
  2081
	    SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE|SWP_NOSIZE);
008953d74e91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2499
diff changeset
  2082
	    *pDefault = 0;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2083
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2084
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2085
	case WM_NCRBUTTONUP:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2086
	    EVENT_PRINTF(("WM_NCRBUTTONUP\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2087
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2088
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2089
	case WM_NCMBUTTONDOWN:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2090
	    EVENT_PRINTF(("WM_NCMBUTTONDOWN\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2091
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2092
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2093
	case WM_NCMBUTTONUP:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2094
	    EVENT_PRINTF(("WM_NCMBUTTONUP\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2095
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2096
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2097
	case WM_SETTEXT:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2098
	    EVENT_PRINTF(("WM_SETTEXT\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2099
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2100
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2101
	case 0x88:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2102
	    EVENT_PRINTF(("0x88 (undoc)\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2103
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2104
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2105
	case WM_NCCALCSIZE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2106
	    EVENT_PRINTF(("WM_NCCALCSIZE\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2107
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2108
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2109
	case WM_NCPAINT:
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2110
	    EVENT_PRINTF3(("WM_NCPAINT\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2111
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2112
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2113
	case WM_SYSCOMMAND:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2114
	    switch (wParam & ~0x000F) {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2115
		case SC_CLOSE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2116
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_CLOSE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2117
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2118
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2119
		case SC_MOVE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2120
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_MOVE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2121
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2122
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2123
		case SC_RESTORE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2124
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_RESTORE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2125
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2126
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2127
		case SC_SIZE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2128
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_SIZE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2129
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2130
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2131
		default:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2132
		    EVENT_PRINTF2(("WM_SYSCOMMAND %x\n", wParam));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2133
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2134
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2135
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2136
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2137
	case WM_INITMENU:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2138
	    EVENT_PRINTF(("WM_INITMENU\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2139
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2140
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2141
	case WM_INITMENUPOPUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2142
	    EVENT_PRINTF(("WM_INITMENUPOPUP\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2143
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2144
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2145
	case WM_ENTERIDLE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2146
	    EVENT_PRINTF(("WM_ENTERIDLE\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2147
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2148
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2149
	case WM_ENTERMENULOOP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2150
	    EVENT_PRINTF(("WM_ENTERMENULOOP\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2151
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2152
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2153
	case WM_EXITMENULOOP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2154
	    EVENT_PRINTF(("WM_EXITMENULOOP\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2155
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2156
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2157
	case WM_MENUSELECT:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2158
	    EVENT_PRINTF(("WM_MENUSELECT\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2159
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2160
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2161
	case WM_QUIT:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2162
	    UNHANDLED_EVENT_PRINTF(("WM_QUIT\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2163
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2164
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2165
	case WM_NCDESTROY:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2166
	    EVENT_PRINTF(("WM_NCDESTROY\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2167
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2168
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2169
	case WM_QUERYNEWPALETTE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2170
	    EVENT_PRINTF(("WM_QUERYNEWPALETTE\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2171
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2172
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2173
	case WM_PALETTECHANGED:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2174
	    EVENT_PRINTF(("WM_PALETTECHANGED\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2175
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2176
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2177
	case WM_ACTIVATEAPP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2178
	    EVENT_PRINTF2(("WM_ACTIVATEAPP %s\n", wParam ? "active" : "inactive"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2179
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2180
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2181
	case WM_SYSDEADCHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2182
	    EVENT_PRINTF2(("WM_SYSDEADCHAR %x\n, wParam"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2183
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2184
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2185
	case WM_DEADCHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2186
	    EVENT_PRINTF2(("WM_DEADCHAR %x\n, wParam"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2187
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2188
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2189
	case WM_PAINTICON:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2190
	    EVENT_PRINTF(("WM_PAINTICON\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2191
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2192
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2193
	case WM_ICONERASEBKGND:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2194
	    EVENT_PRINTF(("WM_ICONERASEBKGND\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2195
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2196
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2197
	case WM_WINDOWPOSCHANGING:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2198
	    EVENT_PRINTF(("WM_WINDOWPOSCHANGING\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2199
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2200
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2201
	case WM_QUERYOPEN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2202
	    EVENT_PRINTF(("WM_QUERYOPEN\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2203
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2204
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2205
	case WM_QUERYENDSESSION:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2206
	    EVENT_PRINTF(("WM_QUERYENDSESSION\n"));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2207
	    enqEvent(ENQ_AT_END, 0, hWnd, message, wParam, 0, 0, 0, 0);
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  2208
	    // TODO: enter new event loop
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  2209
	    // which is left when an endSessionConfirmation
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  2210
	    // arrives from smalltalk
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  2211
	    // (either positive or negative).
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  2212
	    // for now, do not allow leaving
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  2213
	    // windows as long as ST/X is open.
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  2214
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  2215
	    *pDefault = 0;
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  2216
	    return 0;    
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  2217
        
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2218
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2219
2602
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2220
	case WM_DISPLAYCHANGE:
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2221
	    EVENT_PRINTF(("WM_DISPLAYCHANGE\n"));
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2222
	    enqEvent(ENQ_AT_END, 0, hWnd, message, wParam, 0, 0, 0, 0);
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2223
	    break;
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2224
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2225
	case WM_FONTCHANGE:
2602
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2226
	    EVENT_PRINTF(("WM_FONTCHANGE\n"));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2227
	    enqEvent(ENQ_AT_END, 0, hWnd, message, wParam, 0, 0, 0, 0);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2228
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2229
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2230
	case WM_SYSCOLORCHANGE:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2231
	    EVENT_PRINTF(("WM_SYSCOLORCHANGE\n"));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2232
	    enqEvent(ENQ_AT_END, 0, hWnd, message, wParam, 0, 0, 0, 0);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2233
	    break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2234
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2235
	case WM_MOVING:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2236
	    EVENT_PRINTF(("WM_MOVING\n"));
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2237
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2238
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2239
	case WM_SIZING:
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2240
	    EVENT_PRINTF(("WM_SIZING\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2241
	    /*__debugEvent__();*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2242
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2243
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2244
	case WM_EXITSIZEMOVE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2245
	    EVENT_PRINTF(("WM_EXITSIZEMOVE\n"));
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2246
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2247
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2248
	case WM_ENTERSIZEMOVE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2249
	    EVENT_PRINTF(("WM_ENTERSIZEMOVE\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2250
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2251
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2252
	case WM_MOVE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2253
	    EVENT_PRINTF(("WM_MOVE\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2254
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2255
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2256
	case WM_POWER:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2257
	    UNHANDLED_EVENT_PRINTF(("WM_POWER\n"));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2258
	    enqEvent(ENQ_AT_END, 0, hWnd, message, wParam, 0, 0, 0, 0);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2259
	    break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2260
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2261
	default:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2262
	    UNHANDLED_EVENT_PRINTF(("WinWorkstat [info]: unhandled msg = %x\n", message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2263
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2264
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2265
    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2266
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2267
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2268
LONG APIENTRY
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2269
MainWndProc(HWND hWnd,UINT message,UINT wParam,LONG lParam);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2270
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2271
static void _USERENTRY
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2272
dispatchThread(void *arg)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2273
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2274
    static int th_calls;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2275
    RECT rect;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2276
    MSG msg;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2277
    localWindowInfo *li;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2278
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2279
    _dispatchThreadId = GetCurrentThreadId();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2280
    TH_DPRINTF(("TS %d\n", th_calls++));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2281
    PeekMessage(&msg,NULL,0,0,PM_NOREMOVE);   /* must be */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2282
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2283
#ifndef WIN32THREADS
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2284
    AttachThreadInput(_dispatchThreadId, _masterThreadId, TRUE);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2285
# if 0
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2286
    SetThreadPriority(_masterThread,THREAD_PRIORITY_HIGHEST);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2287
    SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_ABOVE_NORMAL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2288
# endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2289
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2290
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2291
    GetWindowRect(GetDesktopWindow(), &rect);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2292
    /* allocate localMemory for Window */
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  2293
    li = (localWindowInfo *)malloc(sizeof(localWindowInfo));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2294
    if (li) {
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  2295
	memset(li, 0, sizeof(*li));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2296
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2297
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  2298
    __rootWinSpezial = CreateWindowEx( WS_EX_TOOLWINDOW|WS_EX_TRANSPARENT,app_nameroot,app_nameroot,
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  2299
				       WS_POPUP|WS_DISABLED,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2300
				0,0,
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  2301
				rect.right-rect.left, rect.bottom-rect.top,
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  2302
				0, 0, (HANDLE) __getHInstance(), li);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2303
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2304
#if 0
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2305
    printf("__rootWinSpezial %x\n",__rootWinSpezial);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2306
#endif
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  2307
    //ShowWindow(__rootWinSpezial,SW_SHOWNOACTIVATE);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2308
    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
  2309
    SetEvent(hCreateEvent);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2310
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2311
    for (;;) {
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2312
	HANDLE dummy;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2313
	TH_DPRINTF(("TG %d\n", th_calls++));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2314
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2315
	if (currentPointerView && (currentCapture == CAPTURE_NONE)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2316
	    while (PeekMessage(&msg,0,0,0,PM_NOREMOVE) == 0) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2317
		/*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2318
		 * wait for an event; timeout after 200 millis
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2319
		 */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2320
		if (MsgWaitForMultipleObjects(0,&dummy,FALSE,200,QS_ALLINPUT) == WAIT_TIMEOUT) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2321
		    /*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2322
		     * timeout - see where mouse pointer is
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2323
		     * for synthetic leave events.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2324
		     */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2325
		    POINT point;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2326
		    if (GetCursorPos(&point)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2327
			HWND hWnd = WindowFromPoint(point);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2328
			if (hWnd) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2329
			    if (GetWindowThreadProcessId(hWnd,0) != GetCurrentThreadId()) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2330
				if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2331
				    enqEvent(ENQ_AT_END, LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers());
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2332
				currentPointerView = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2333
				break;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2334
			    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2335
			}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2336
		    }
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2337
		}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2338
	    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2339
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2340
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2341
	GetMessage(&msg, NULL, 0, 0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2342
	TH_DPRINTF(("TD %d\n", th_calls++));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2343
	destroyWin = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2344
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2345
	switch (msg.message) {
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2346
#if 0
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2347
	    case WM_THREADDESTROYWINDOW:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2348
		destroyWin = TRUE;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2349
		msg.message = WM_CLOSE;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2350
		CPRINTF(("thread WM_THREADDESTROYWINDOW %x\n",msg.hwnd));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2351
		break;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2352
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2353
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2354
#ifdef SET_FOCUS_IN_WINTHREAD
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2355
	    case WM_THREADSETFOCUS:
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2356
# ifdef xxWIN32THREADS
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2357
		if (msg.lParam) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2358
		    if (AttachThreadInput(_dispatchThreadId,msg.lParam,TRUE) == FALSE)
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2359
			PRINTF(("SetFocus AttachThreadInput error %d\n",GetLastError()));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2360
		}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2361
# endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2362
		CPRINTF(("threadSetfocus %x\n",msg.wParam));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2363
		if (SetFocus((HWND)msg.wParam) == 0) {
2491
be54b494a252 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2464
diff changeset
  2364
		    DPRINTF(("SetFocus to %x failed.\n",msg.wParam));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2365
		}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2366
		continue;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2367
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2368
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2369
#ifdef SET_CURSOR_IN_WINTHREAD
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2370
	    case WM_THREADSETCURSOR:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2371
		if (msg.lParam) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2372
		    POINT p;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2373
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2374
		    GetCursorPos(&p);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2375
		    if (WindowFromPoint(p) == msg.hwnd) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2376
			CPRINTF(("threadSetCursor %x\n",msg.lParam));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2377
			SetCursor((HCURSOR)msg.lParam);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2378
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2379
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2380
		continue;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2381
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2382
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2383
	    case WM_THREADSETCAPTURE:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2384
		if (msg.wParam) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2385
		    if (currentPointerView) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2386
			if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2387
			    enqEvent(ENQ_AT_END, LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers());
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2388
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2389
		    currentPointerView = msg.wParam;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2390
		    currentCapture = CAPTURE_EXPLICIT;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2391
		    CPRINTF(("threadSetCapture %x\n",msg.wParam));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2392
		    SetCapture(currentPointerView);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2393
		} else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2394
		    if (currentPointerView  == __rootWinSpezial) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2395
			//ShowWindow(__rootWinSpezial, SW_HIDE);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2396
			SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0,SWP_NOREDRAW|SWP_NOSENDCHANGING|SWP_NOCOPYBITS
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2397
				       |SWP_HIDEWINDOW| SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE/*| SWP_NOZORDER|SWP_NOOWNERZORDER*/);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2398
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2399
		    currentPointerView = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2400
		    currentCapture = CAPTURE_NONE;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2401
		    CPRINTF(("threadReleaseCapture\n"));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2402
		    ReleaseCapture();
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2403
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2404
		if (msg.lParam) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2405
		    CPRINTF(("threadSetCursor %x\n",msg.lParam));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2406
		    SetCursor((HCURSOR)msg.lParam);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2407
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2408
		continue;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2409
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2410
	    case WM_THREADCREATEWINDOW:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2411
		TH_DPRINTF(("C %d\n", th_calls));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2412
#if 0
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2413
		if (_thread_winStyleBits & WS_POPUP) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2414
		    //_thread_parentHandle = GetActiveWindow();
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2415
		}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2416
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2417
		_thread_newWinHandle = CreateWindowEx(
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2418
					    _thread_winStyleBitsEx,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2419
					    _thread_className,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2420
					    _thread_windowName,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2421
					    _thread_winStyleBits,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2422
					    _thread_x, _thread_y,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2423
					    _thread_dx,_thread_dy,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2424
					    _thread_parentHandle,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2425
					    NULL,           /* menu */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2426
					    (HANDLE) __getHInstance(),
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  2427
					    (localWindowInfo *)(msg.lParam) 
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  2428
					    /* _thread_local */);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2429
		SetEvent(hCreateEvent);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2430
		continue;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2431
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2432
	    case WM_KEYDOWN:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2433
	    case WM_KEYUP:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2434
	    case WM_SYSKEYDOWN:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2435
	    case WM_SYSKEYUP:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2436
#ifdef xxDEBUG
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2437
		if ((msg.wParam == 0x11) && (msg.message == WM_KEYDOWN)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2438
		    /* CTRL-C */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2439
		    if (c_count++ > 3)  /* for debugging */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2440
		       exit(1);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2441
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2442
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2443
		DPRINTF(("keymsg %x\n",msg.wParam));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2444
		if (
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2445
		       ((msg.wParam >= '0') && (msg.wParam <= 'Z'))
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2446
		    || ((msg.wParam >= VK_MULTIPLY) && (msg.wParam <= VK_DIVIDE))
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2447
		    || (msg.wParam == 0x20)
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2448
		    || (msg.wParam == 0x14)
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2449
		    /*|| (msg.wParam == 0x10)*/
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2450
		    || (msg.wParam >= 0xB0)
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2451
		   )
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2452
		{
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2453
		    /*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2454
		     * translate to a WM_CHAR message
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2455
		     */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2456
		    if (TranslateMessage(&msg))
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2457
			continue;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2458
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2459
		break;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2460
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2461
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2462
	/*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2463
	 * common ...
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2464
	 */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2465
	evRootX = msg.pt.x;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2466
	evRootY = msg.pt.y;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2467
	lastMSGTime = msg.time;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2468
	DispatchMessage(&msg);   /* Dispatches message to window */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2469
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2470
    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2471
}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2472
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2473
LONG APIENTRY
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2474
MainWndProc(HWND hWnd,UINT message,UINT wParam,LONG lParam)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2475
{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2476
    int wantDefault = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2477
    int retVal;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2478
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2479
    TH_DPRINTF(("TMW %d\n",message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2480
    retVal = winEventProcessing(hWnd, message, wParam, lParam, &wantDefault);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2481
    if (wantDefault) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2482
	DDPRINTF((">>DefWindowProc\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2483
	retVal = DefWindowProc(hWnd, message, wParam, lParam);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2484
	DDPRINTF(("<<DefWindowProc\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2485
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2486
    return retVal;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2487
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2488
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2489
static int CALLBACK
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2490
EnumFPTypeFaceProc( lplf, lptm, dwType, lpData )
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2491
	LOGFONT*        lplf;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2492
	TEXTMETRIC*     lptm;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2493
	DWORD           dwType;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2494
	LPARAM          lpData;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2495
{
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2496
	OBJ t;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2497
	OBJ* refToList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2498
	OBJ  typeFaceList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2499
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2500
	if (lplf) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2501
	    refToList = (OBJ*) lpData;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2502
	    __PROTECT__(*refToList);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2503
	    t = __MKSTRING( lplf->lfFaceName );
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2504
	    __UNPROTECT__(*refToList);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2505
	    typeFaceList = *refToList;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2506
	    __SSEND1( typeFaceList, @symbol(add:), 0, t );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2507
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2508
	return 1;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2509
}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2510
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2511
static int CALLBACK
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2512
EnumFontsProc( lplf, lptm, dwType, lpData )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2513
	LOGFONT*      lplf;     /* address of logical-font data */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2514
	TEXTMETRIC*   lptm;     /* address of physical font data */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2515
	DWORD         dwType;   /* font type */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2516
	LPARAM        lpData;   /* address of application supplied data */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2517
{
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2518
	OBJ newArray, t;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2519
	OBJ *refToList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2520
	OBJ list;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2521
	char *s;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2522
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2523
	DPRINTF(("EnumFontProc\n\n\n\n"));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2524
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2525
	if( lplf ) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2526
	    refToList = (OBJ*) lpData;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2527
	    __PROTECT__(*refToList);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2528
	    DPRINTF((" lfHeight          %d\n", lplf->lfHeight ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2529
	    DPRINTF((" lfWidth           %d\n", lplf->lfWidth  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2530
	    DPRINTF((" lfEscapement      %d\n", lplf->lfEscapement  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2531
	    DPRINTF((" lfOrientation     %d\n", lplf->lfOrientation  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2532
	    DPRINTF((" lfWeight          %d\n", lplf->lfWeight  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2533
	    DPRINTF((" lfItalic          %d\n", lplf->lfItalic  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2534
	    DPRINTF((" lfUnderline       %d\n", lplf->lfUnderline  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2535
	    DPRINTF((" lfStrikeOut       %d\n", lplf->lfStrikeOut  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2536
	    DPRINTF((" lfCharSet         %d\n", lplf->lfCharSet  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2537
	    DPRINTF((" lfOutPrecision    %d\n", lplf->lfOutPrecision  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2538
	    DPRINTF((" lfClipPrecision   %d\n", lplf->lfClipPrecision  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2539
	    DPRINTF((" lfQuality         %d\n", lplf->lfQuality  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2540
	    DPRINTF((" lfPitchAndFamily  %d\n", lplf->lfPitchAndFamily  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2541
	    DPRINTF((" lfFaceName        %s\n\n", lplf->lfFaceName  ));
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2542
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2543
	    newArray = __ARRAY_NEW_INT(16);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2544
	    __UNPROTECT__(*refToList);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2545
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2546
	    if ( dwType & TRUETYPE_FONTTYPE )
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2547
		__ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(0);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2548
	    else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2549
		//__ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(MulDiv(__logPixelSY,lplf->lfHeight, 72));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2550
		__ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(lplf->lfHeight);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2551
	    }
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2552
	    __ArrayInstPtr(newArray)->a_element[1] = __MKSMALLINT(lplf->lfWidth);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2553
	    __ArrayInstPtr(newArray)->a_element[2] = __MKSMALLINT(lplf->lfEscapement);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2554
	    __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
  2555
	    switch (lplf->lfWeight) {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2556
		case FW_NORMAL:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2557
		    s = "normal";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2558
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2559
		case FW_BOLD:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2560
		    s = "bold";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2561
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2562
		case FW_MEDIUM:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2563
		    s = "medium";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2564
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2565
		case FW_LIGHT:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2566
		    s = "demi";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2567
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2568
		default:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2569
		    s = "other";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2570
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2571
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2572
	    __PROTECT__(*refToList);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2573
	    __PROTECT__(newArray);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2574
	    t = __MKSTRING(s);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2575
	    __UNPROTECT__(newArray);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2576
	    __UNPROTECT__(*refToList);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2577
	    __ArrayInstPtr(newArray)->a_element[4] = t; __STORE(newArray, t);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2578
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2579
	    if( lplf->lfItalic == TRUE ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2580
		if( lplf->lfUnderline == TRUE ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2581
		    if( lplf->lfStrikeOut == TRUE ) {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2582
			s = "italic-underline-strikeOut";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2583
		    } else {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2584
			s = "italic-underline";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2585
		    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2586
		} else {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2587
		    if( lplf->lfStrikeOut == TRUE ) {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2588
			s = "italic-strikeOut";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2589
		    } else {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2590
			s = "italic";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2591
		    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2592
		}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2593
	    } else {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2594
		if( lplf->lfUnderline == TRUE ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2595
		    if( lplf->lfStrikeOut == TRUE ) {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2596
			s = "underline-strikeOut";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2597
		    } else {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2598
			s = "underline";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2599
		    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2600
		} else {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2601
		    if( lplf->lfStrikeOut == TRUE ) {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2602
			s = "strikeOut";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2603
		    } else {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2604
			s = "normal";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2605
		    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2606
		}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2607
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2608
	    __PROTECT__(*refToList);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2609
	    __PROTECT__(newArray);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2610
	    t = __MKSTRING(s);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2611
	    __UNPROTECT__(newArray);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2612
	    __UNPROTECT__(*refToList);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2613
	    __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
  2614
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2615
	    __ArrayInstPtr(newArray)->a_element[5] = __MKSMALLINT(lplf->lfItalic);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2616
	    __ArrayInstPtr(newArray)->a_element[6] = __MKSMALLINT(lplf->lfUnderline);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2617
	    __ArrayInstPtr(newArray)->a_element[7] = __MKSMALLINT(lplf->lfStrikeOut);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2618
	    __ArrayInstPtr(newArray)->a_element[8] = __MKSMALLINT(lplf->lfCharSet);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2619
	    __ArrayInstPtr(newArray)->a_element[9] = __MKSMALLINT(lplf->lfOutPrecision);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2620
	    __ArrayInstPtr(newArray)->a_element[10] = __MKSMALLINT(lplf->lfClipPrecision);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2621
	    __ArrayInstPtr(newArray)->a_element[11] = __MKSMALLINT(lplf->lfQuality);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2622
	    __ArrayInstPtr(newArray)->a_element[12] = __MKSMALLINT(lplf->lfPitchAndFamily);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2623
	    /* ... */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2624
	    __PROTECT__(*refToList);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2625
	    __PROTECT__(newArray);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2626
	    t = __MKSTRING(lplf->lfFaceName);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2627
	    __UNPROTECT__(newArray);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2628
	    __UNPROTECT__(*refToList);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2629
	    __ArrayInstPtr(newArray)->a_element[13] = t; __STORE(newArray, t);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2630
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2631
	    switch (lplf->lfCharSet) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2632
		case ANSI_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2633
		    s = "ansi";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2634
		    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2635
		case DEFAULT_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2636
		    s = "default";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2637
		case SYMBOL_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2638
		    s = "symbol";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2639
		case SHIFTJIS_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2640
		    s = "sjis";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2641
		case GB2312_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2642
		    s = "gb";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2643
		case HANGEUL_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2644
		    s = "hangeul";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2645
		case CHINESEBIG5_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2646
		    s = "big5";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2647
		case OEM_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2648
		    s = "oem";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2649
		    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2650
# ifdef JOHAB_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2651
		case JOHAB_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2652
		    s = "johab";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2653
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2654
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2655
# ifdef HEBREW_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2656
		case HEBREW_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2657
		    s = "hebrew";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2658
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2659
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2660
# ifdef GREEK_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2661
		case GREEK_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2662
		    s = "greek";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2663
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2664
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2665
# ifdef RUSSIAN_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2666
		case RUSSIAN_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2667
		    s = "russian";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2668
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2669
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2670
# ifdef MAC_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2671
		case MAC_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2672
		    s = "mac";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2673
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2674
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2675
		default:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2676
		    s = "unknown";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2677
		    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2678
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2679
	    __PROTECT__(*refToList);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2680
	    __PROTECT__(newArray);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2681
	    t = __MKSTRING(s);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2682
	    __UNPROTECT__(newArray);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2683
	    __UNPROTECT__(*refToList);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2684
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2685
	    __ArrayInstPtr(newArray)->a_element[14] = t; __STORE(newArray, t);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2686
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2687
	    list = *refToList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2688
	    __SSEND1(list, @symbol(add:), 0, newArray);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2689
	}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2690
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2691
	DPRINTF((" dwType            %d\n", dwType ));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2692
	return 1;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2693
}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2694
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2695
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2696
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2697
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2698
!WinWorkstation class methodsFor:'documentation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2699
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2700
copyright
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2701
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2702
COPYRIGHT (c) 1996 by Claus Gittinger
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2703
	      All Rights Reserved
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2704
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2705
 This software is furnished under a license and may be used
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2706
 only in accordance with the terms of that license and with the
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2707
 inclusion of the above copyright notice.   This software may not
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2708
 be provided or otherwise made available to, or used by, any
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2709
 other person.  No title to or ownership of the software is
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2710
 hereby transferred.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2711
"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2712
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2713
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2714
documentation
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2715
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2716
    See more documentation in my superclass, DeviceWorkstation.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2717
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2718
    [author:]
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2719
	Claus Gittinger (initial port)
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2720
	Manfred Dierolf (many, many changes & fixes, multithreading etc.)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2721
"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2722
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2723
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2724
!WinWorkstation class methodsFor:'initialization'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2725
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2726
activateOnClick:aBoolean
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2727
    "set/clear the activateOnClick behavior.
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2728
     If on, a click into a window raises and activates
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2729
     the window.
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2730
     Windows users typically enable this;
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2731
     users which are used to the X-Window system typically prefer
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2732
     it disabled.
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2733
     Returns the previous setting."
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2734
%{
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2735
    OBJ rslt = activateOnClick ? true : false;
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2736
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2737
    if (aBoolean == true) {
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2738
       activateOnClick = 1;
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2739
    } else {
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2740
       if (aBoolean == false) {
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2741
	   activateOnClick = 0;
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2742
       }
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2743
    }
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2744
    RETURN (rslt);
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2745
%}
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2746
    "
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2747
     WinWorkstation activateOnClick:true
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2748
     WinWorkstation activateOnClick:false
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2749
    "
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2750
!
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  2751
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2752
initialize
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2753
    |nButtons swap|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2754
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2755
    super initialize.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2756
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2757
    self initializeStandardColorNames.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2758
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2759
    NativeWindows := false.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2760
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2761
    BeepFrequency := 440.       "/ Hertz
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2762
    BeepDuration := 200.        "/ millis
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2763
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2764
    ButtonTranslation := #(1 2 2).
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2765
2602
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2766
"/    nButtons := self getSystemMetrics:#mouseButtons.
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2767
"/    swap := self getSystemMetrics:#swapButton.
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2768
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2769
"/    nButtons == 0 ifTrue:[
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2770
"/        'WinWorkstation [warning]: mouse-less operation may not work' infoPrintCR.
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2771
"/    ] ifFalse:[
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2772
"/        nButtons == 2 ifTrue:[
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2773
"/            ButtonTranslation := #(1 2).
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2774
"/        ].
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2775
"/        swap ifTrue:[
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2776
"/            ButtonTranslation := ButtonTranslation copy reverse
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2777
"/        ]
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2778
"/    ].
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2779
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2780
    "/ translation table from ST/X windowType symbol (system-independent)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2781
    "/ to Windows windowClass (windows-specific).
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2782
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2783
    NativeWindowClassTable := IdentityDictionary new.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2784
    NativeWindowClassTable at:#ScrollBar     put:'SCROLLBAR'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2785
    NativeWindowClassTable at:#CheckBox      put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2786
    NativeWindowClassTable at:#RadioButton   put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2787
    NativeWindowClassTable at:#Button        put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2788
    NativeWindowClassTable at:#DefaultButton put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2789
    NativeWindowClassTable at:#ComboBox      put:'COMBOBOX'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2790
    NativeWindowClassTable at:#EditField     put:'EDIT'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2791
    NativeWindowClassTable at:#ListBox       put:'LISTBOX'.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2792
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2793
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2794
initializeStandardColorNames
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2795
    "{ Pragma: +optSpace }"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2796
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2797
    "setup standard color names (X-color names)"
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2798
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2799
    StandardColorValues := Dictionary new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2800
    #(
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2801
	(240 248 255)   'alice blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2802
	(240 248 255)   'AliceBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2803
	(250 235 215)   'antique white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2804
	(250 235 215)   'AntiqueWhite'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2805
	(255 239 219)   'AntiqueWhite1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2806
	(238 223 204)   'AntiqueWhite2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2807
	(205 192 176)   'AntiqueWhite3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2808
	(139 131 120)   'AntiqueWhite4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2809
	(127 255 212)   'aquamarine'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2810
	(127 255 212)   'aquamarine1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2811
	(118 238 198)   'aquamarine2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2812
	(102 205 170)   'aquamarine3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2813
	( 69 139 116)   'aquamarine4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2814
	(240 255 255)   'azure'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2815
	(240 255 255)   'azure1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2816
	(224 238 238)   'azure2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2817
	(193 205 205)   'azure3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2818
	(131 139 139)   'azure4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2819
	(245 245 220)   'beige'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2820
	(255 228 196)   'bisque'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2821
	(255 228 196)   'bisque1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2822
	(238 213 183)   'bisque2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2823
	(205 183 158)   'bisque3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2824
	(139 125 107)   'bisque4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2825
	(  0   0   0)   'black'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2826
	(255 235 205)   'blanched almond'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2827
	(255 235 205)   'BlanchedAlmond'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2828
	(  0   0 255)   'blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2829
	(138  43 226)   'blue violet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2830
	(  0   0 255)   'blue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2831
	(  0   0 238)   'blue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2832
	(  0   0 205)   'blue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2833
	(  0   0 139)   'blue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2834
	(138  43 226)   'BlueViolet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2835
	(165  42  42)   'brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2836
	(255  64  64)   'brown1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2837
	(238  59  59)   'brown2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2838
	(205  51  51)   'brown3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2839
	(139  35  35)   'brown4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2840
	(222 184 135)   'burlywood'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2841
	(255 211 155)   'burlywood1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2842
	(238 197 145)   'burlywood2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2843
	(205 170 125)   'burlywood3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2844
	(139 115  85)   'burlywood4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2845
	( 95 158 160)   'cadet blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2846
	( 95 158 160)   'CadetBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2847
	(152 245 255)   'CadetBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2848
	(142 229 238)   'CadetBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2849
	(122 197 205)   'CadetBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2850
	( 83 134 139)   'CadetBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2851
	(127 255   0)   'chartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2852
	(127 255   0)   'chartreuse1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2853
	(118 238   0)   'chartreuse2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2854
	(102 205   0)   'chartreuse3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2855
	( 69 139   0)   'chartreuse4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2856
	(210 105  30)   'chocolate'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2857
	(255 127  36)   'chocolate1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2858
	(238 118  33)   'chocolate2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2859
	(205 102  29)   'chocolate3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2860
	(139  69  19)   'chocolate4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2861
	(255 127  80)   'coral'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2862
	(255 114  86)   'coral1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2863
	(238 106  80)   'coral2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2864
	(205  91  69)   'coral3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2865
	(139  62  47)   'coral4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2866
	(100 149 237)   'cornflower blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2867
	(100 149 237)   'CornflowerBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2868
	(255 248 220)   'cornsilk'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2869
	(255 248 220)   'cornsilk1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2870
	(238 232 205)   'cornsilk2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2871
	(205 200 177)   'cornsilk3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2872
	(139 136 120)   'cornsilk4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2873
	(  0 255 255)   'cyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2874
	(  0 255 255)   'cyan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2875
	(  0 238 238)   'cyan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2876
	(  0 205 205)   'cyan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2877
	(  0 139 139)   'cyan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2878
	(  0   0 139)   'dark blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2879
	(  0 139 139)   'dark cyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2880
	(184 134  11)   'dark goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2881
	(169 169 169)   'dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2882
	(  0 100   0)   'dark green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2883
	(169 169 169)   'dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2884
	(189 183 107)   'dark khaki'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2885
	(139   0 139)   'dark magenta'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2886
	( 85 107  47)   'dark olive green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2887
	(255 140   0)   'dark orange'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2888
	(153  50 204)   'dark orchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2889
	(139   0   0)   'dark red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2890
	(233 150 122)   'dark salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2891
	(143 188 143)   'dark sea green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2892
	( 72  61 139)   'dark slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2893
	( 47  79  79)   'dark slate gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2894
	( 47  79  79)   'dark slate grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2895
	(  0 206 209)   'dark turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2896
	(148   0 211)   'dark violet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2897
	(  0   0 139)   'DarkBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2898
	(  0 139 139)   'DarkCyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2899
	(184 134  11)   'DarkGoldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2900
	(255 185  15)   'DarkGoldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2901
	(238 173  14)   'DarkGoldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2902
	(205 149  12)   'DarkGoldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2903
	(139 101   8)   'DarkGoldenrod4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2904
	(169 169 169)   'DarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2905
	(  0 100   0)   'DarkGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2906
	(169 169 169)   'DarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2907
	(189 183 107)   'DarkKhaki'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2908
	(139   0 139)   'DarkMagenta'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2909
	( 85 107  47)   'DarkOliveGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2910
	(202 255 112)   'DarkOliveGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2911
	(188 238 104)   'DarkOliveGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2912
	(162 205  90)   'DarkOliveGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2913
	(110 139  61)   'DarkOliveGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2914
	(255 140   0)   'DarkOrange'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2915
	(255 127   0)   'DarkOrange1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2916
	(238 118   0)   'DarkOrange2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2917
	(205 102   0)   'DarkOrange3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2918
	(139  69   0)   'DarkOrange4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2919
	(153  50 204)   'DarkOrchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2920
	(191  62 255)   'DarkOrchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2921
	(178  58 238)   'DarkOrchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2922
	(154  50 205)   'DarkOrchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2923
	(104  34 139)   'DarkOrchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2924
	(139   0   0)   'DarkRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2925
	(233 150 122)   'DarkSalmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2926
	(143 188 143)   'DarkSeaGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2927
	(193 255 193)   'DarkSeaGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2928
	(180 238 180)   'DarkSeaGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2929
	(155 205 155)   'DarkSeaGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2930
	(105 139 105)   'DarkSeaGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2931
	( 72  61 139)   'DarkSlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2932
	( 47  79  79)   'DarkSlateGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2933
	(151 255 255)   'DarkSlateGray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2934
	(141 238 238)   'DarkSlateGray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2935
	(121 205 205)   'DarkSlateGray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2936
	( 82 139 139)   'DarkSlateGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2937
	( 47  79  79)   'DarkSlateGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2938
	(  0 206 209)   'DarkTurquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2939
	(148   0 211)   'DarkViolet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2940
	(255  20 147)   'deep pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2941
	(  0 191 255)   'deep sky blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2942
	(255  20 147)   'DeepPink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2943
	(255  20 147)   'DeepPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2944
	(238  18 137)   'DeepPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2945
	(205  16 118)   'DeepPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2946
	(139  10  80)   'DeepPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2947
	(  0 191 255)   'DeepSkyBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2948
	(  0 191 255)   'DeepSkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2949
	(  0 178 238)   'DeepSkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2950
	(  0 154 205)   'DeepSkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2951
	(  0 104 139)   'DeepSkyBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2952
	(105 105 105)   'dim gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2953
	(105 105 105)   'dim grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2954
	(105 105 105)   'DimGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2955
	(105 105 105)   'DimGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2956
	( 30 144 255)   'dodger blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2957
	( 30 144 255)   'DodgerBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2958
	( 30 144 255)   'DodgerBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2959
	( 28 134 238)   'DodgerBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2960
	( 24 116 205)   'DodgerBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2961
	( 16  78 139)   'DodgerBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2962
	(178  34  34)   'firebrick'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2963
	(255  48  48)   'firebrick1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2964
	(238  44  44)   'firebrick2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2965
	(205  38  38)   'firebrick3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2966
	(139  26  26)   'firebrick4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2967
	(255 250 240)   'floral white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2968
	(255 250 240)   'FloralWhite'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2969
	( 34 139  34)   'forest green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2970
	( 34 139  34)   'ForestGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2971
	(220 220 220)   'gainsboro'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2972
	(248 248 255)   'ghost white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2973
	(248 248 255)   'GhostWhite'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2974
	(255 215   0)   'gold'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2975
	(255 215   0)   'gold1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2976
	(238 201   0)   'gold2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2977
	(205 173   0)   'gold3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2978
	(139 117   0)   'gold4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2979
	(218 165  32)   'goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2980
	(255 193  37)   'goldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2981
	(238 180  34)   'goldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2982
	(205 155  29)   'goldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2983
	(139 105  20)   'goldenrod4'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2984
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2985
	(192 192 192)   'grey'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2986
	(  0   0   0)   'grey0'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2987
	(  3   3   3)   'grey1'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2988
	( 26  26  26)   'grey10'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2989
	(255 255 255)   'grey100'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2990
	( 28  28  28)   'grey11'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2991
	( 31  31  31)   'grey12'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2992
	( 33  33  33)   'grey13'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2993
	( 36  36  36)   'grey14'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2994
	( 38  38  38)   'grey15'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2995
	( 41  41  41)   'grey16'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2996
	( 43  43  43)   'grey17'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2997
	( 46  46  46)   'grey18'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2998
	( 48  48  48)   'grey19'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2999
	(  5   5   5)   'grey2'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3000
	( 51  51  51)   'grey20'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3001
	( 54  54  54)   'grey21'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3002
	( 56  56  56)   'grey22'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3003
	( 59  59  59)   'grey23'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3004
	( 61  61  61)   'grey24'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3005
	( 64  64  64)   'grey25'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3006
	( 66  66  66)   'grey26'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3007
	( 69  69  69)   'grey27'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3008
	( 71  71  71)   'grey28'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3009
	( 74  74  74)   'grey29'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3010
	(  8   8   8)   'grey3'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3011
	( 77  77  77)   'grey30'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3012
	( 79  79  79)   'grey31'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3013
	( 82  82  82)   'grey32'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3014
	( 84  84  84)   'grey33'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3015
	( 87  87  87)   'grey34'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3016
	( 89  89  89)   'grey35'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3017
	( 92  92  92)   'grey36'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3018
	( 94  94  94)   'grey37'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3019
	( 97  97  97)   'grey38'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3020
	( 99  99  99)   'grey39'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3021
	( 10  10  10)   'grey4'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3022
	(102 102 102)   'grey40'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3023
	(105 105 105)   'grey41'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3024
	(107 107 107)   'grey42'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3025
	(110 110 110)   'grey43'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3026
	(112 112 112)   'grey44'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3027
	(115 115 115)   'grey45'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3028
	(117 117 117)   'grey46'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3029
	(120 120 120)   'grey47'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3030
	(122 122 122)   'grey48'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3031
	(125 125 125)   'grey49'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3032
	( 13  13  13)   'grey5'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3033
	(127 127 127)   'grey50'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3034
	(130 130 130)   'grey51'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3035
	(133 133 133)   'grey52'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3036
	(135 135 135)   'grey53'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3037
	(138 138 138)   'grey54'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3038
	(140 140 140)   'grey55'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3039
	(143 143 143)   'grey56'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3040
	(145 145 145)   'grey57'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3041
	(148 148 148)   'grey58'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3042
	(150 150 150)   'grey59'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3043
	( 15  15  15)   'grey6'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3044
	(153 153 153)   'grey60'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3045
	(156 156 156)   'grey61'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3046
	(158 158 158)   'grey62'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3047
	(161 161 161)   'grey63'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3048
	(163 163 163)   'grey64'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3049
	(166 166 166)   'grey65'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3050
	(168 168 168)   'grey66'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3051
	(171 171 171)   'grey67'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3052
	(173 173 173)   'grey68'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3053
	(176 176 176)   'grey69'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3054
	( 18  18  18)   'grey7'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3055
	(179 179 179)   'grey70'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3056
	(181 181 181)   'grey71'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3057
	(184 184 184)   'grey72'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3058
	(186 186 186)   'grey73'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3059
	(189 189 189)   'grey74'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3060
	(191 191 191)   'grey75'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3061
	(194 194 194)   'grey76'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3062
	(196 196 196)   'grey77'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3063
	(199 199 199)   'grey78'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3064
	(201 201 201)   'grey79'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3065
	( 20  20  20)   'grey8'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3066
	(204 204 204)   'grey80'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3067
	(207 207 207)   'grey81'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3068
	(209 209 209)   'grey82'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3069
	(212 212 212)   'grey83'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3070
	(214 214 214)   'grey84'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3071
	(217 217 217)   'grey85'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3072
	(219 219 219)   'grey86'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3073
	(222 222 222)   'grey87'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3074
	(224 224 224)   'grey88'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3075
	(227 227 227)   'grey89'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3076
	( 23  23  23)   'grey9'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3077
	(229 229 229)   'grey90'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3078
	(232 232 232)   'grey91'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3079
	(235 235 235)   'grey92'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3080
	(237 237 237)   'grey93'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3081
	(240 240 240)   'grey94'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3082
	(242 242 242)   'grey95'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3083
	(245 245 245)   'grey96'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3084
	(247 247 247)   'grey97'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3085
	(250 250 250)   'grey98'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3086
	(252 252 252)   'grey99'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3087
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3088
	(192 192 192)   'gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3089
	(  0   0   0)   'gray0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3090
	(  3   3   3)   'gray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3091
	( 26  26  26)   'gray10'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3092
	(255 255 255)   'gray100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3093
	( 28  28  28)   'gray11'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3094
	( 31  31  31)   'gray12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3095
	( 33  33  33)   'gray13'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3096
	( 36  36  36)   'gray14'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3097
	( 38  38  38)   'gray15'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3098
	( 41  41  41)   'gray16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3099
	( 43  43  43)   'gray17'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3100
	( 46  46  46)   'gray18'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3101
	( 48  48  48)   'gray19'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3102
	(  5   5   5)   'gray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3103
	( 51  51  51)   'gray20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3104
	( 54  54  54)   'gray21'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3105
	( 56  56  56)   'gray22'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3106
	( 59  59  59)   'gray23'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3107
	( 61  61  61)   'gray24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3108
	( 64  64  64)   'gray25'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3109
	( 66  66  66)   'gray26'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3110
	( 69  69  69)   'gray27'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3111
	( 71  71  71)   'gray28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3112
	( 74  74  74)   'gray29'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3113
	(  8   8   8)   'gray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3114
	( 77  77  77)   'gray30'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3115
	( 79  79  79)   'gray31'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3116
	( 82  82  82)   'gray32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3117
	( 84  84  84)   'gray33'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3118
	( 87  87  87)   'gray34'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3119
	( 89  89  89)   'gray35'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3120
	( 92  92  92)   'gray36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3121
	( 94  94  94)   'gray37'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3122
	( 97  97  97)   'gray38'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3123
	( 99  99  99)   'gray39'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3124
	( 10  10  10)   'gray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3125
	(102 102 102)   'gray40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3126
	(105 105 105)   'gray41'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3127
	(107 107 107)   'gray42'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3128
	(110 110 110)   'gray43'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3129
	(112 112 112)   'gray44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3130
	(115 115 115)   'gray45'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3131
	(117 117 117)   'gray46'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3132
	(120 120 120)   'gray47'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3133
	(122 122 122)   'gray48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3134
	(125 125 125)   'gray49'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3135
	( 13  13  13)   'gray5'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3136
	(127 127 127)   'gray50'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3137
	(130 130 130)   'gray51'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3138
	(133 133 133)   'gray52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3139
	(135 135 135)   'gray53'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3140
	(138 138 138)   'gray54'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3141
	(140 140 140)   'gray55'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3142
	(143 143 143)   'gray56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3143
	(145 145 145)   'gray57'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3144
	(148 148 148)   'gray58'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3145
	(150 150 150)   'gray59'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3146
	( 15  15  15)   'gray6'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3147
	(153 153 153)   'gray60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3148
	(156 156 156)   'gray61'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3149
	(158 158 158)   'gray62'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3150
	(161 161 161)   'gray63'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3151
	(163 163 163)   'gray64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3152
	(166 166 166)   'gray65'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3153
	(168 168 168)   'gray66'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3154
	(171 171 171)   'gray67'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3155
	(173 173 173)   'gray68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3156
	(176 176 176)   'gray69'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3157
	( 18  18  18)   'gray7'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3158
	(179 179 179)   'gray70'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3159
	(181 181 181)   'gray71'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3160
	(184 184 184)   'gray72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3161
	(186 186 186)   'gray73'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3162
	(189 189 189)   'gray74'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3163
	(191 191 191)   'gray75'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3164
	(194 194 194)   'gray76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3165
	(196 196 196)   'gray77'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3166
	(199 199 199)   'gray78'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3167
	(201 201 201)   'gray79'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3168
	( 20  20  20)   'gray8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3169
	(204 204 204)   'gray80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3170
	(207 207 207)   'gray81'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3171
	(209 209 209)   'gray82'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3172
	(212 212 212)   'gray83'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3173
	(214 214 214)   'gray84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3174
	(217 217 217)   'gray85'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3175
	(219 219 219)   'gray86'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3176
	(222 222 222)   'gray87'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3177
	(224 224 224)   'gray88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3178
	(227 227 227)   'gray89'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3179
	( 23  23  23)   'gray9'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3180
	(229 229 229)   'gray90'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3181
	(232 232 232)   'gray91'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3182
	(235 235 235)   'gray92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3183
	(237 237 237)   'gray93'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3184
	(240 240 240)   'gray94'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3185
	(242 242 242)   'gray95'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3186
	(245 245 245)   'gray96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3187
	(247 247 247)   'gray97'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3188
	(250 250 250)   'gray98'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3189
	(252 252 252)   'gray99'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3190
	(  0 255   0)   'green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3191
	(173 255  47)   'green yellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3192
	(  0 255   0)   'green1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3193
	(  0 238   0)   'green2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3194
	(  0 205   0)   'green3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3195
	(  0 139   0)   'green4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3196
	(173 255  47)   'GreenYellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3197
	(240 255 240)   'honeydew'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3198
	(240 255 240)   'honeydew1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3199
	(224 238 224)   'honeydew2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3200
	(193 205 193)   'honeydew3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3201
	(131 139 131)   'honeydew4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3202
	(255 105 180)   'hot pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3203
	(255 105 180)   'HotPink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3204
	(255 110 180)   'HotPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3205
	(238 106 167)   'HotPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3206
	(205  96 144)   'HotPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3207
	(139  58  98)   'HotPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3208
	(205  92  92)   'indian red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3209
	(205  92  92)   'IndianRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3210
	(255 106 106)   'IndianRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3211
	(238  99  99)   'IndianRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3212
	(205  85  85)   'IndianRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3213
	(139  58  58)   'IndianRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3214
	(255 255 240)   'ivory'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3215
	(255 255 240)   'ivory1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3216
	(238 238 224)   'ivory2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3217
	(205 205 193)   'ivory3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3218
	(139 139 131)   'ivory4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3219
	(240 230 140)   'khaki'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3220
	(255 246 143)   'khaki1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3221
	(238 230 133)   'khaki2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3222
	(205 198 115)   'khaki3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3223
	(139 134  78)   'khaki4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3224
	(230 230 250)   'lavender'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3225
	(255 240 245)   'lavender blush'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3226
	(255 240 245)   'LavenderBlush'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3227
	(255 240 245)   'LavenderBlush1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3228
	(238 224 229)   'LavenderBlush2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3229
	(205 193 197)   'LavenderBlush3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3230
	(139 131 134)   'LavenderBlush4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3231
	(124 252   0)   'lawn green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3232
	(124 252   0)   'LawnGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3233
	(255 250 205)   'lemon chiffon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3234
	(255 250 205)   'LemonChiffon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3235
	(255 250 205)   'LemonChiffon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3236
	(238 233 191)   'LemonChiffon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3237
	(205 201 165)   'LemonChiffon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3238
	(139 137 112)   'LemonChiffon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3239
	(173 216 230)   'light blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3240
	(240 128 128)   'light coral'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3241
	(224 255 255)   'light cyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3242
	(238 221 130)   'light goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3243
	(250 250 210)   'light goldenrod yellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3244
	(211 211 211)   'light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3245
	(144 238 144)   'light green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3246
	(211 211 211)   'light grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3247
	(255 182 193)   'light pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3248
	(255 160 122)   'light salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3249
	( 32 178 170)   'light sea green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3250
	(135 206 250)   'light sky blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3251
	(132 112 255)   'light slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3252
	(119 136 153)   'light slate gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3253
	(119 136 153)   'light slate grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3254
	(176 196 222)   'light steel blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3255
	(255 255 224)   'light yellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3256
	(173 216 230)   'LightBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3257
	(191 239 255)   'LightBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3258
	(178 223 238)   'LightBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3259
	(154 192 205)   'LightBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3260
	(104 131 139)   'LightBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3261
	(240 128 128)   'LightCoral'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3262
	(224 255 255)   'LightCyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3263
	(224 255 255)   'LightCyan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3264
	(209 238 238)   'LightCyan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3265
	(180 205 205)   'LightCyan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3266
	(122 139 139)   'LightCyan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3267
	(238 221 130)   'LightGoldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3268
	(255 236 139)   'LightGoldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3269
	(238 220 130)   'LightGoldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3270
	(205 190 112)   'LightGoldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3271
	(139 129  76)   'LightGoldenrod4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3272
	(250 250 210)   'LightGoldenrodYellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3273
	(211 211 211)   'LightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3274
	(144 238 144)   'LightGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3275
	(211 211 211)   'LightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3276
	(255 182 193)   'LightPink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3277
	(255 174 185)   'LightPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3278
	(238 162 173)   'LightPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3279
	(205 140 149)   'LightPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3280
	(139  95 101)   'LightPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3281
	(255 160 122)   'LightSalmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3282
	(255 160 122)   'LightSalmon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3283
	(238 149 114)   'LightSalmon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3284
	(205 129  98)   'LightSalmon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3285
	(139  87  66)   'LightSalmon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3286
	( 32 178 170)   'LightSeaGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3287
	(135 206 250)   'LightSkyBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3288
	(176 226 255)   'LightSkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3289
	(164 211 238)   'LightSkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3290
	(141 182 205)   'LightSkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3291
	( 96 123 139)   'LightSkyBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3292
	(132 112 255)   'LightSlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3293
	(119 136 153)   'LightSlateGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3294
	(119 136 153)   'LightSlateGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3295
	(176 196 222)   'LightSteelBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3296
	(202 225 255)   'LightSteelBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3297
	(188 210 238)   'LightSteelBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3298
	(162 181 205)   'LightSteelBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3299
	(110 123 139)   'LightSteelBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3300
	(255 255 224)   'LightYellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3301
	(255 255 224)   'LightYellow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3302
	(238 238 209)   'LightYellow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3303
	(205 205 180)   'LightYellow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3304
	(139 139 122)   'LightYellow4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3305
	( 50 205  50)   'lime green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3306
	( 50 205  50)   'LimeGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3307
	(250 240 230)   'linen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3308
	(255   0 255)   'magenta'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3309
	(255   0 255)   'magenta1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3310
	(238   0 238)   'magenta2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3311
	(205   0 205)   'magenta3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3312
	(139   0 139)   'magenta4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3313
	(176  48  96)   'maroon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3314
	(255  52 179)   'maroon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3315
	(238  48 167)   'maroon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3316
	(205  41 144)   'maroon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3317
	(139  28  98)   'maroon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3318
	(102 205 170)   'medium aquamarine'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3319
	(  0   0 205)   'medium blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3320
	(186  85 211)   'medium orchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3321
	(147 112 219)   'medium purple'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3322
	( 60 179 113)   'medium sea green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3323
	(123 104 238)   'medium slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3324
	(  0 250 154)   'medium spring green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3325
	( 72 209 204)   'medium turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3326
	(199  21 133)   'medium violet red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3327
	(102 205 170)   'MediumAquamarine'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3328
	(  0   0 205)   'MediumBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3329
	(186  85 211)   'MediumOrchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3330
	(224 102 255)   'MediumOrchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3331
	(209  95 238)   'MediumOrchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3332
	(180  82 205)   'MediumOrchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3333
	(122  55 139)   'MediumOrchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3334
	(147 112 219)   'MediumPurple'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3335
	(171 130 255)   'MediumPurple1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3336
	(159 121 238)   'MediumPurple2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3337
	(137 104 205)   'MediumPurple3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3338
	( 93  71 139)   'MediumPurple4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3339
	( 60 179 113)   'MediumSeaGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3340
	(123 104 238)   'MediumSlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3341
	(  0 250 154)   'MediumSpringGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3342
	( 72 209 204)   'MediumTurquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3343
	(199  21 133)   'MediumVioletRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3344
	( 25  25 112)   'midnight blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3345
	( 25  25 112)   'MidnightBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3346
	(245 255 250)   'mint cream'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3347
	(245 255 250)   'MintCream'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3348
	(255 228 225)   'misty rose'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3349
	(255 228 225)   'MistyRose'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3350
	(255 228 225)   'MistyRose1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3351
	(238 213 210)   'MistyRose2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3352
	(205 183 181)   'MistyRose3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3353
	(139 125 123)   'MistyRose4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3354
	(255 228 181)   'moccasin'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3355
	(255 222 173)   'navajo white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3356
	(255 222 173)   'NavajoWhite'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3357
	(255 222 173)   'NavajoWhite1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3358
	(238 207 161)   'NavajoWhite2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3359
	(205 179 139)   'NavajoWhite3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3360
	(139 121  94)   'NavajoWhite4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3361
	(  0   0 128)   'navy'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3362
	(  0   0 128)   'navy blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3363
	(  0   0 128)   'NavyBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3364
	(253 245 230)   'old lace'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3365
	(253 245 230)   'OldLace'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3366
	(107 142  35)   'olive drab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3367
	(107 142  35)   'OliveDrab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3368
	(192 255  62)   'OliveDrab1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3369
	(179 238  58)   'OliveDrab2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3370
	(154 205  50)   'OliveDrab3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3371
	(105 139  34)   'OliveDrab4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3372
	(255 165   0)   'orange'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3373
	(255  69   0)   'orange red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3374
	(255 165   0)   'orange1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3375
	(238 154   0)   'orange2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3376
	(205 133   0)   'orange3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3377
	(139  90   0)   'orange4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3378
	(255  69   0)   'OrangeRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3379
	(255  69   0)   'OrangeRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3380
	(238  64   0)   'OrangeRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3381
	(205  55   0)   'OrangeRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3382
	(139  37   0)   'OrangeRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3383
	(218 112 214)   'orchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3384
	(255 131 250)   'orchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3385
	(238 122 233)   'orchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3386
	(205 105 201)   'orchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3387
	(139  71 137)   'orchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3388
	(238 232 170)   'pale goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3389
	(152 251 152)   'pale green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3390
	(175 238 238)   'pale turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3391
	(219 112 147)   'pale violet red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3392
	(238 232 170)   'PaleGoldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3393
	(152 251 152)   'PaleGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3394
	(154 255 154)   'PaleGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3395
	(144 238 144)   'PaleGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3396
	(124 205 124)   'PaleGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3397
	( 84 139  84)   'PaleGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3398
	(175 238 238)   'PaleTurquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3399
	(187 255 255)   'PaleTurquoise1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3400
	(174 238 238)   'PaleTurquoise2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3401
	(150 205 205)   'PaleTurquoise3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3402
	(102 139 139)   'PaleTurquoise4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3403
	(219 112 147)   'PaleVioletRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3404
	(255 130 171)   'PaleVioletRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3405
	(238 121 159)   'PaleVioletRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3406
	(205 104 137)   'PaleVioletRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3407
	(139  71  93)   'PaleVioletRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3408
	(255 239 213)   'papaya whip'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3409
	(255 239 213)   'PapayaWhip'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3410
	(255 218 185)   'peach puff'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3411
	(255 218 185)   'PeachPuff'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3412
	(255 218 185)   'PeachPuff1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3413
	(238 203 173)   'PeachPuff2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3414
	(205 175 149)   'PeachPuff3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3415
	(139 119 101)   'PeachPuff4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3416
	(205 133  63)   'peru'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3417
	(255 192 203)   'pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3418
	(255 181 197)   'pink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3419
	(238 169 184)   'pink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3420
	(205 145 158)   'pink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3421
	(139  99 108)   'pink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3422
	(221 160 221)   'plum'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3423
	(255 187 255)   'plum1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3424
	(238 174 238)   'plum2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3425
	(205 150 205)   'plum3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3426
	(139 102 139)   'plum4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3427
	(176 224 230)   'powder blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3428
	(176 224 230)   'PowderBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3429
	(160  32 240)   'purple'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3430
	(155  48 255)   'purple1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3431
	(145  44 238)   'purple2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3432
	(125  38 205)   'purple3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3433
	( 85  26 139)   'purple4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3434
	(255   0   0)   'red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3435
	(255   0   0)   'red1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3436
	(238   0   0)   'red2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3437
	(205   0   0)   'red3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3438
	(139   0   0)   'red4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3439
	(188 143 143)   'rosy brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3440
	(188 143 143)   'RosyBrown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3441
	(255 193 193)   'RosyBrown1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3442
	(238 180 180)   'RosyBrown2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3443
	(205 155 155)   'RosyBrown3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3444
	(139 105 105)   'RosyBrown4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3445
	( 65 105 225)   'royal blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3446
	( 65 105 225)   'RoyalBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3447
	( 72 118 255)   'RoyalBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3448
	( 67 110 238)   'RoyalBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3449
	( 58  95 205)   'RoyalBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3450
	( 39  64 139)   'RoyalBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3451
	(139  69  19)   'saddle brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3452
	(139  69  19)   'SaddleBrown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3453
	(250 128 114)   'salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3454
	(255 140 105)   'salmon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3455
	(238 130  98)   'salmon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3456
	(205 112  84)   'salmon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3457
	(139  76  57)   'salmon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3458
	(244 164  96)   'sandy brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3459
	(244 164  96)   'SandyBrown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3460
	( 255 206 137)   'scoActiveBackground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3461
	( 43  45  49)   'scoActiveForeground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3462
	( 254 222 255)   'scoActiveTopShadow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3463
	( 172 186 204)   'scoAltBackground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3464
	( 203 203 192)   'scoBackground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3465
	( 11   0 113)   'scoForeground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3466
	( 141 178 215)   'scoHighlight'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3467
	( 255 240 248)   'scoTopShadow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3468
	( 46 139  87)   'sea green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3469
	( 46 139  87)   'SeaGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3470
	( 84 255 159)   'SeaGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3471
	( 78 238 148)   'SeaGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3472
	( 67 205 128)   'SeaGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3473
	( 46 139  87)   'SeaGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3474
	(255 245 238)   'seashell'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3475
	(255 245 238)   'seashell1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3476
	(238 229 222)   'seashell2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3477
	(205 197 191)   'seashell3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3478
	(139 134 130)   'seashell4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3479
	(142 56 142)   'sgi beet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3480
	(197 193 170)   'sgi bright gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3481
	(197 193 170)   'sgi bright grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3482
	(113 198 113)   'sgi chartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3483
	( 85  85  85)   'sgi dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3484
	( 85  85  85)   'sgi dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3485
	(  0   0   0)   'sgi gray 0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3486
	(255 255 255)   'sgi gray 100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3487
	( 30  30  30)   'sgi gray 12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3488
	( 40  40  40)   'sgi gray 16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3489
	( 51  51  51)   'sgi gray 20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3490
	( 61  61  61)   'sgi gray 24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3491
	( 71  71  71)   'sgi gray 28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3492
	( 81  81  81)   'sgi gray 32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3493
	( 91  91  91)   'sgi gray 36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3494
	( 10  10  10)   'sgi gray 4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3495
	(102 102 102)   'sgi gray 40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3496
	(112 112 112)   'sgi gray 44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3497
	(122 122 122)   'sgi gray 48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3498
	(132 132 132)   'sgi gray 52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3499
	(142 142 142)   'sgi gray 56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3500
	(153 153 153)   'sgi gray 60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3501
	(163 163 163)   'sgi gray 64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3502
	(173 173 173)   'sgi gray 68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3503
	(183 183 183)   'sgi gray 72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3504
	(193 193 193)   'sgi gray 76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3505
	( 20  20  20)   'sgi gray 8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3506
	(204 204 204)   'sgi gray 80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3507
	(214 214 214)   'sgi gray 84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3508
	(224 224 224)   'sgi gray 88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3509
	(234 234 234)   'sgi gray 92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3510
	(244 244 244)   'sgi gray 96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3511
	(  0   0   0)   'sgi grey 0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3512
	(255 255 255)   'sgi grey 100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3513
	( 30  30  30)   'sgi grey 12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3514
	( 40  40  40)   'sgi grey 16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3515
	( 51  51  51)   'sgi grey 20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3516
	( 61  61  61)   'sgi grey 24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3517
	( 71  71  71)   'sgi grey 28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3518
	( 81  81  81)   'sgi grey 32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3519
	( 91  91  91)   'sgi grey 36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3520
	( 10  10  10)   'sgi grey 4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3521
	(102 102 102)   'sgi grey 40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3522
	(112 112 112)   'sgi grey 44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3523
	(122 122 122)   'sgi grey 48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3524
	(132 132 132)   'sgi grey 52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3525
	(142 142 142)   'sgi grey 56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3526
	(153 153 153)   'sgi grey 60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3527
	(163 163 163)   'sgi grey 64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3528
	(173 173 173)   'sgi grey 68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3529
	(183 183 183)   'sgi grey 72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3530
	(193 193 193)   'sgi grey 76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3531
	( 20  20  20)   'sgi grey 8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3532
	(204 204 204)   'sgi grey 80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3533
	(214 214 214)   'sgi grey 84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3534
	(224 224 224)   'sgi grey 88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3535
	(234 234 234)   'sgi grey 92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3536
	(244 244 244)   'sgi grey 96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3537
	(125 158 192)   'sgi light blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3538
	(170 170 170)   'sgi light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3539
	(170 170 170)   'sgi light grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3540
	(132 132 132)   'sgi medium gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3541
	(132 132 132)   'sgi medium grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3542
	(142 142  56)   'sgi olive drab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3543
	(198 113 113)   'sgi salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3544
	(113 113 198)   'sgi slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3545
	( 56 142 142)   'sgi teal'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3546
	( 40  40  40)   'sgi very dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3547
	( 40  40  40)   'sgi very dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3548
	(214 214 214)   'sgi very light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3549
	(214 214 214)   'sgi very light grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3550
	(142 56 142)   'SGIBeet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3551
	(197 193 170)   'SGIBrightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3552
	(197 193 170)   'SGIBrightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3553
	(113 198 113)   'SGIChartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3554
	( 85  85  85)   'SGIDarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3555
	( 85  85  85)   'SGIDarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3556
	(  0   0   0)   'SGIGray0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3557
	(255 255 255)   'SGIGray100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3558
	( 30  30  30)   'SGIGray12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3559
	( 40  40  40)   'SGIGray16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3560
	( 51  51  51)   'SGIGray20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3561
	( 61  61  61)   'SGIGray24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3562
	( 71  71  71)   'SGIGray28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3563
	( 81  81  81)   'SGIGray32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3564
	( 91  91  91)   'SGIGray36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3565
	( 10  10  10)   'SGIGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3566
	(102 102 102)   'SGIGray40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3567
	(112 112 112)   'SGIGray44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3568
	(122 122 122)   'SGIGray48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3569
	(132 132 132)   'SGIGray52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3570
	(142 142 142)   'SGIGray56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3571
	(153 153 153)   'SGIGray60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3572
	(163 163 163)   'SGIGray64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3573
	(173 173 173)   'SGIGray68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3574
	(183 183 183)   'SGIGray72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3575
	(193 193 193)   'SGIGray76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3576
	( 20  20  20)   'SGIGray8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3577
	(204 204 204)   'SGIGray80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3578
	(214 214 214)   'SGIGray84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3579
	(224 224 224)   'SGIGray88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3580
	(234 234 234)   'SGIGray92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3581
	(244 244 244)   'SGIGray96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3582
	(  0   0   0)   'SGIGrey0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3583
	(255 255 255)   'SGIGrey100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3584
	( 30  30  30)   'SGIGrey12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3585
	( 40  40  40)   'SGIGrey16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3586
	( 51  51  51)   'SGIGrey20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3587
	( 61  61  61)   'SGIGrey24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3588
	( 71  71  71)   'SGIGrey28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3589
	( 81  81  81)   'SGIGrey32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3590
	( 91  91  91)   'SGIGrey36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3591
	( 10  10  10)   'SGIGrey4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3592
	(102 102 102)   'SGIGrey40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3593
	(112 112 112)   'SGIGrey44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3594
	(122 122 122)   'SGIGrey48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3595
	(132 132 132)   'SGIGrey52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3596
	(142 142 142)   'SGIGrey56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3597
	(153 153 153)   'SGIGrey60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3598
	(163 163 163)   'SGIGrey64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3599
	(173 173 173)   'SGIGrey68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3600
	(183 183 183)   'SGIGrey72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3601
	(193 193 193)   'SGIGrey76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3602
	( 20  20  20)   'SGIGrey8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3603
	(204 204 204)   'SGIGrey80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3604
	(214 214 214)   'SGIGrey84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3605
	(224 224 224)   'SGIGrey88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3606
	(234 234 234)   'SGIGrey92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3607
	(244 244 244)   'SGIGrey96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3608
	(125 158 192)   'SGILightBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3609
	(170 170 170)   'SGILightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3610
	(170 170 170)   'SGILightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3611
	(132 132 132)   'SGIMediumGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3612
	(132 132 132)   'SGIMediumGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3613
	(142 142  56)   'SGIOliveDrab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3614
	(198 113 113)   'SGISalmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3615
	(113 113 198)   'SGISlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3616
	( 56 142 142)   'SGITeal'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3617
	( 40  40  40)   'SGIVeryDarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3618
	( 40  40  40)   'SGIVeryDarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3619
	(214 214 214)   'SGIVeryLightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3620
	(214 214 214)   'SGIVeryLightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3621
	(160  82  45)   'sienna'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3622
	(255 130  71)   'sienna1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3623
	(238 121  66)   'sienna2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3624
	(205 104  57)   'sienna3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3625
	(139  71  38)   'sienna4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3626
	(135 206 235)   'sky blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3627
	(135 206 235)   'SkyBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3628
	(135 206 255)   'SkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3629
	(126 192 238)   'SkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3630
	(108 166 205)   'SkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3631
	( 74 112 139)   'SkyBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3632
	(106  90 205)   'slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3633
	(112 128 144)   'slate gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3634
	(112 128 144)   'slate grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3635
	(106  90 205)   'SlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3636
	(131 111 255)   'SlateBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3637
	(122 103 238)   'SlateBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3638
	(105  89 205)   'SlateBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3639
	( 71  60 139)   'SlateBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3640
	(112 128 144)   'SlateGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3641
	(198 226 255)   'SlateGray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3642
	(185 211 238)   'SlateGray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3643
	(159 182 205)   'SlateGray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3644
	(108 123 139)   'SlateGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3645
	(112 128 144)   'SlateGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3646
	(255 250 250)   'snow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3647
	(255 250 250)   'snow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3648
	(238 233 233)   'snow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3649
	(205 201 201)   'snow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3650
	(139 137 137)   'snow4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3651
	(  0 255 127)   'spring green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3652
	(  0 255 127)   'SpringGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3653
	(  0 255 127)   'SpringGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3654
	(  0 238 118)   'SpringGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3655
	(  0 205 102)   'SpringGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3656
	(  0 139  69)   'SpringGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3657
	( 70 130 180)   'steel blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3658
	( 70 130 180)   'SteelBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3659
	( 99 184 255)   'SteelBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3660
	( 92 172 238)   'SteelBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3661
	( 79 148 205)   'SteelBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3662
	( 54 100 139)   'SteelBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3663
	(210 180 140)   'tan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3664
	(255 165  79)   'tan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3665
	(238 154  73)   'tan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3666
	(205 133  63)   'tan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3667
	(139  90  43)   'tan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3668
	(216 191 216)   'thistle'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3669
	(255 225 255)   'thistle1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3670
	(238 210 238)   'thistle2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3671
	(205 181 205)   'thistle3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3672
	(139 123 139)   'thistle4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3673
	(255  99  71)   'tomato'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3674
	(255  99  71)   'tomato1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3675
	(238  92  66)   'tomato2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3676
	(205  79  57)   'tomato3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3677
	(139  54  38)   'tomato4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3678
	( 64 224 208)   'turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3679
	(  0 245 255)   'turquoise1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3680
	(  0 229 238)   'turquoise2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3681
	(  0 197 205)   'turquoise3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3682
	(  0 134 139)   'turquoise4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3683
	(238 130 238)   'violet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3684
	(208  32 144)   'violet red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3685
	(208  32 144)   'VioletRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3686
	(255  62 150)   'VioletRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3687
	(238  58 140)   'VioletRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3688
	(205  50 120)   'VioletRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3689
	(139  34  82)   'VioletRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3690
	(245 222 179)   'wheat'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3691
	(255 231 186)   'wheat1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3692
	(238 216 174)   'wheat2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3693
	(205 186 150)   'wheat3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3694
	(139 126 102)   'wheat4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3695
	(255 255 255)   'white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3696
	(245 245 245)   'white smoke'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3697
	(245 245 245)   'WhiteSmoke'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3698
	(255 255   0)   'yellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3699
	(154 205  50)   'yellow green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3700
	(255 255   0)   'yellow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3701
	(238 238   0)   'yellow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3702
	(205 205   0)   'yellow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3703
	(139 139   0)   'yellow4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3704
	(154 205  50)   'YellowGreen'   
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3705
    ) pairWiseDo:[ :value :name |
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3706
	StandardColorValues at:name put:value
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3707
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3708
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3709
     WinWorkstation initializeStandardColorNames
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3710
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3711
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3712
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3713
nativeWindows:aBoolean
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3714
    "enable / disable use of native windows"
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3715
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3716
    NativeWindows := aBoolean
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3717
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3718
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3719
!WinWorkstation class methodsFor:'debugging'!
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3720
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  3721
bitmapHandleCounts
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  3722
%{  /* NOCONTEXT */
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  3723
    RETURN ( __MKSMALLINT(__cnt_bitmap));
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  3724
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  3725
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  3726
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  3727
bmpDcHandleCounts
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  3728
%{  /* NOCONTEXT */
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  3729
    RETURN ( __MKSMALLINT(__cnt_bmpdc));
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  3730
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  3731
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  3732
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3733
debug:aBoolean
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3734
    "enable/disable debug prints - this will vanish"
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3735
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3736
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3737
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3738
    __debug__ = (aBoolean == true) ? 1 : 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3739
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3740
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3741
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  3742
gcDataHandleCounts
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  3743
%{  /* NOCONTEXT */
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  3744
    RETURN ( __MKSMALLINT(__cnt_gcData));
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  3745
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  3746
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  3747
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  3748
printHandleCounts
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3749
   "show prim values"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3750
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  3751
   ('WINWORKSTATION: pW=', self windowHandleCounts printString,
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  3752
    'pB=',self bitmapHandleCounts printString,
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  3753
    'pGc=',self gcDataHandleCounts printString,
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  3754
    'pbmpdc=',self bmpDcHandleCounts printString) errorPrintNL
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  3755
!
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  3756
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  3757
windowHandleCounts
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3758
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3759
    RETURN ( __MKSMALLINT(__cnt_createWindows));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3760
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3761
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3762
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3763
!WinWorkstation class methodsFor:'queries'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3764
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3765
platformName
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3766
    "ST-80 compatibility.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3767
     Return a string describing the display systems platform."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3768
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3769
    ^ 'WIN32'  
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3770
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3771
    "Modified: 26.5.1996 / 15:32:46 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3772
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3773
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3774
!WinWorkstation methodsFor:'accessing & queries'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3775
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3776
anyButtonMotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3777
    "return the state-mask for any button in motion events' state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3778
     This is the devices mask."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3779
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3780
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3781
    RETURN ( __MKSMALLINT(Button1MotionMask | Button2MotionMask | Button3MotionMask));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3782
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3783
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3784
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3785
blackpixel
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3786
    "return the colornumber of black"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3787
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3788
    ^ blackpixel
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3789
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3790
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3791
button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3792
    "return the state-mask for button1 in motion events' state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3793
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3794
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3795
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3796
    RETURN (__MKSMALLINT(Button1MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3797
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3798
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3799
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3800
     Display button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3801
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3802
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3803
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3804
button2MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3805
    "return the state-mask for button2 in motion events' state-field
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3806
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3807
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3808
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3809
    RETURN (__MKSMALLINT(Button2MotionMask)); 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3810
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3811
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3812
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3813
button3MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3814
    "return the state-mask for button3 in motion events' state-field
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3815
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3816
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3817
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3818
    RETURN (__MKSMALLINT(Button3MotionMask)); 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3819
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3820
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3821
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3822
buttonMotionMask:aButton
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3823
    "return the state-mask for button1 in motion events state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3824
     This is the devices mask."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3825
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3826
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3827
    if (aButton == __MKSMALLINT(1)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3828
	RETURN (__MKSMALLINT(Button1MotionMask));    
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3829
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3830
    if (aButton == __MKSMALLINT(2)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3831
	RETURN (__MKSMALLINT(Button2MotionMask));    
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3832
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3833
    if (aButton == __MKSMALLINT(3)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3834
	RETURN (__MKSMALLINT(Button3MotionMask));    
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3835
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3836
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3837
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3838
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3839
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3840
controlMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3841
    "return the state-mask for the CTRL modified in motion events' state-field."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3842
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3843
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3844
    RETURN (__MKSMALLINT(ControlMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3845
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3846
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3847
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3848
defaultEventMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3849
    "return a mask to enable some events by default."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3850
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3851
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3852
    RETURN (__MKSMALLINT( ExposureMask | StructureNotifyMask |
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3853
			 KeyPressMask | KeyReleaseMask |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3854
			 EnterWindowMask | LeaveWindowMask |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3855
			 ButtonPressMask | ButtonMotionMask | ButtonReleaseMask ));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3856
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3857
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3858
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3859
displayFileDescriptor
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3860
    "return the displays fileNumber for select, if any"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3861
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3862
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3863
   /* RETURN (nil);*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3864
   RETURN ( __MKEXTERNALADDRESS(hInputEvent));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3865
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3866
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3867
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3868
displayName
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3869
    "return the display-connections display name.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3870
     For Windows, a dummy name is returned"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3871
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3872
    ^ 'local'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3873
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3874
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3875
getSystemColor:aKey
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3876
    "retrieve a windows system color.
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3877
     The styleSheet/View classes may use this to setup default colors"
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3878
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3879
    |rgb|
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3880
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3881
    rgb := self primGetSystemColor:aKey.
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3882
    rgb notNil ifTrue:[
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3883
	^ Color
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3884
	    redByte:((rgb bitShift:-16) bitAnd:16rFF)
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3885
	    greenByte:((rgb bitShift:-8) bitAnd:16rFF)
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3886
	    blueByte:(rgb bitAnd:16rFF)
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3887
    ].
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3888
    ^ nil
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3889
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3890
    "
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3891
     Display getSystemColor:#COLOR_WINDOW
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3892
     Display getSystemColor:#COLOR_HIGHLIGHT
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3893
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3894
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3895
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3896
getSystemMetrics:aNumberOrSymbol
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3897
    "get a system metrics value; the argument is a #define-like symbol
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3898
     as described in the windows API;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3899
     However, to allow for future values to be retrieved, also allow an integer
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3900
     which must be the define-value."
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3901
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3902
%{  /* NOCONTEXT */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3903
    int info = 0;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3904
    int isBool = 0;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3905
    int arg;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3906
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3907
    if (__isSmallInteger(aNumberOrSymbol)) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3908
	arg = __intVal(aNumberOrSymbol);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3909
    } else if ((aNumberOrSymbol == @symbol(swapButton)) || (aNumberOrSymbol == @symbol(SM_SWAPBUTTON))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3910
	arg = SM_SWAPBUTTON;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3911
	isBool = 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3912
    } else if ((aNumberOrSymbol == @symbol(mouseButtons)) || (aNumberOrSymbol == @symbol(SM_CMOUSEBUTTONS))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3913
	arg = SM_CMOUSEBUTTONS;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3914
    } else if ((aNumberOrSymbol == @symbol(iconWidth)) || (aNumberOrSymbol == @symbol(SM_CXICON))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3915
	arg = SM_CXICON;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3916
    } else if ((aNumberOrSymbol == @symbol(iconHeight)) || (aNumberOrSymbol == @symbol(SM_CYICON))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3917
	arg = SM_CYICON;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3918
    } else if ((aNumberOrSymbol == @symbol(cursorWidth)) || (aNumberOrSymbol == @symbol(SM_CXCURSOR))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3919
	arg = SM_CXCURSOR;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3920
    } else if ((aNumberOrSymbol == @symbol(cursorHeight)) || (aNumberOrSymbol == @symbol(SM_CYCURSOR))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3921
	arg = SM_CYCURSOR;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3922
    } else if ((aNumberOrSymbol == @symbol(captionHeight)) || (aNumberOrSymbol == @symbol(SM_CYCAPTION))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3923
	arg = SM_CYCAPTION;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3924
    } else if ((aNumberOrSymbol == @symbol(resizeFrameWidth)) || (aNumberOrSymbol == @symbol(SM_CXFRAME))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3925
	arg = SM_CXFRAME;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3926
    } else if ((aNumberOrSymbol == @symbol(resizeFrameHeight)) || (aNumberOrSymbol == @symbol(SM_CYFRAME))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3927
	arg = SM_CYFRAME;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3928
    } else if ((aNumberOrSymbol == @symbol(borderFrameWidth)) || (aNumberOrSymbol == @symbol(SM_CXBORDER))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3929
	arg = SM_CXBORDER;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3930
    } else if ((aNumberOrSymbol == @symbol(borderFrameHeight)) || (aNumberOrSymbol == @symbol(SM_CYBORDER))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3931
	arg = SM_CYBORDER;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3932
    } else if ((aNumberOrSymbol == @symbol(fullScreenWindowWidth)) || (aNumberOrSymbol == @symbol(SM_CXFULLSCREEN))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3933
	arg = SM_CXFULLSCREEN;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3934
    } else if ((aNumberOrSymbol == @symbol(fullScreenWindowHeight)) || (aNumberOrSymbol == @symbol(SM_CYFULLSCREEN))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3935
	arg = SM_CYFULLSCREEN;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3936
    } else if ((aNumberOrSymbol == @symbol(vScrollbarWidth)) || (aNumberOrSymbol == @symbol(SM_CXVSCROLL))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3937
	arg = SM_CXVSCROLL;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3938
    } else if ((aNumberOrSymbol == @symbol(hScrollbarHeight)) || (aNumberOrSymbol == @symbol(SM_CYHSCROLL))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3939
	arg = SM_CYHSCROLL;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3940
    } else if ((aNumberOrSymbol == @symbol(vThumbHeight)) || (aNumberOrSymbol == @symbol(SM_CYVTHUMB))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3941
	arg = SM_CYVTHUMB;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3942
    } else if ((aNumberOrSymbol == @symbol(hThumbWidth)) || (aNumberOrSymbol == @symbol(SM_CXHTHUMB))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3943
	arg = SM_CXHTHUMB;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3944
    } else {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3945
	RETURN (nil);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3946
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3947
    info = GetSystemMetrics(arg);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3948
    if (isBool) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3949
	RETURN (info ? true : false);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3950
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3951
    RETURN (__MKSMALLINT(info));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3952
%}
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3953
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3954
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3955
primGetSystemColor:aKey
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3956
%{  /* xxLIMITEDSTACK (WIN95 only) */
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3957
    int p;
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3958
    int rgb, r, g, b;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3959
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3960
    if (aKey == @symbol(COLOR_WINDOW)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3961
      p = COLOR_WINDOW;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3962
    } else if (aKey == @symbol(COLOR_WINDOWTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3963
      p = COLOR_WINDOWTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3964
    } else if (aKey == @symbol(COLOR_MENU)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3965
      p = COLOR_MENU;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3966
    } else if (aKey == @symbol(COLOR_MENUTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3967
      p = COLOR_MENUTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3968
    } else if (aKey == @symbol(COLOR_BTNFACE)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3969
      p = COLOR_BTNFACE;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3970
    } else if (aKey == @symbol(COLOR_BTNSHADOW)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3971
      p = COLOR_BTNSHADOW;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3972
    } else if (aKey == @symbol(COLOR_BTNTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3973
      p = COLOR_BTNTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3974
    } else if (aKey == @symbol(COLOR_GRAYTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3975
      p = COLOR_GRAYTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3976
    } else if (aKey == @symbol(COLOR_HIGHLIGHT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3977
      p = COLOR_HIGHLIGHT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3978
    } else if (aKey == @symbol(COLOR_HIGHLIGHTTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3979
      p = COLOR_HIGHLIGHTTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3980
    } else if (aKey == @symbol(COLOR_MENU)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3981
      p = COLOR_MENU;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3982
    } else if (aKey == @symbol(COLOR_MENUTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3983
      p = COLOR_MENUTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3984
    } else if (aKey == @symbol(COLOR_SCROLLBAR)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3985
      p = COLOR_SCROLLBAR;
2239
f535b1178597 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  3986
#ifdef COLOR_SHADOW
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3987
    } else if (aKey == @symbol(COLOR_SHADOW)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3988
      p = COLOR_SHADOW;
2239
f535b1178597 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  3989
#endif
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3990
    } else {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3991
      RETURN (nil);
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3992
    }
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3993
    rgb = GetSysColor(p);
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3994
    /* win uses BGR order */
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3995
    r = rgb & 0xFF;
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3996
    g = (rgb >> 8) & 0xFF;
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3997
    b = (rgb >> 16) & 0xFF;
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3998
    rgb = (((r << 8) | g) << 8) | b;
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3999
    RETURN (__MKSMALLINT(rgb));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4000
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4001
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4002
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4003
primTranslatePointX:x y:y from:windowId1 to:windowId2
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4004
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4005
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4006
    HWND w1, w2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4007
    POINT point;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4008
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4009
    if (__isExternalAddress(windowId1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4010
     && __isExternalAddress(windowId2)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4011
     && __bothSmallInteger(x, y)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4012
	w1 = _HWNDVal(windowId1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4013
	w2 = _HWNDVal(windowId2);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4014
	point.x = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4015
	point.y = __intVal(y);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4016
	DPRINTF(("TransPoint %x %d/%d ->",w1,point.x,point.y));
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4017
	if (ClientToScreen(w1,&point) == FALSE) {
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4018
	    RETURN (nil);
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4019
	}
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4020
	if (ScreenToClient(w2,&point) == FALSE) {
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4021
	    RETURN (nil);
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4022
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4023
	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
  4024
	RETURN (__MKPOINT_INT(point.x, point.y));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4025
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4026
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4027
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4028
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4029
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4030
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4031
primViewIdFromPoint:aPoint in:windowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4032
    "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
  4033
     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
  4034
     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
  4035
     - 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
  4036
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4037
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4038
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4039
    OBJ xp, yp;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4040
    int xpos, ypos;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4041
    HWND child_return;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4042
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4043
    if (ISCONNECTED
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4044
     && __isExternalAddress(windowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4045
     && __isPoint(aPoint))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4046
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4047
	xp = _point_X(aPoint);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4048
	yp = _point_Y(aPoint);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4049
	if (__bothSmallInteger(xp, yp))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4050
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4051
	    POINT p;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4052
	    HWND hWnd = _HWNDVal(windowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4053
	    p.x = __intVal(xp);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4054
	    p.y = __intVal(yp);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4055
	    ScreenToClient(hWnd, &p);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4056
	    child_return = ChildWindowFromPointEx(hWnd,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4057
	    /*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
  4058
	    if ((child_return) && (child_return != hWnd))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4059
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4060
		RETURN ( __MKEXTERNALADDRESS(child_return) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4061
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4062
	    RETURN ( nil );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4063
	}
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
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4066
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4067
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4068
protocolVersion
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4069
    "return the displays protocol version.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4070
     For Windows, a dummy number is returned"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4071
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4072
    ^ '1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4073
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4074
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4075
     Display protocolVersion
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4076
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4077
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4078
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4079
serverVendor
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4080
    "return the server vendor string. 
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4081
     For Windows, a dummy name is returned"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4082
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4083
    ^ 'microsoft'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4084
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4085
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4086
     Display serverVendor
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4087
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4088
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4089
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4090
shiftMask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4091
    "return the state-mask for the SHIFT modified in motion events' state-field."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4092
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4093
%{  /* NOCONTEXT */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4094
    RETURN (__MKSMALLINT(ShiftMask));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4095
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4096
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4097
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4098
translatePoint:aPoint from:windowId1 to:windowId2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4099
    "given a point in window1, return the coordinate in window2.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4100
     This expects a device coordinate (relative to the first views origin)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4101
     in aPoint and returns a device coordinate relative to the 2nd views origin.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4102
     - use to xlate points from a window to rootwindow"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4103
2276
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4104
    |x1 y1 x2 y2|
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4105
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4106
    x1 := x2 := aPoint x truncated.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4107
    y1 := y2 := aPoint y truncated.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4108
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4109
%{
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4110
    HWND w1, w2;
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4111
    POINT point;
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4112
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4113
    if (__isExternalAddress(windowId1)
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4114
     && __isExternalAddress(windowId2)
2279
30a35be06995 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2276
diff changeset
  4115
     && __bothSmallInteger(x1, y1)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  4116
	w1 = _HWNDVal(windowId1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  4117
	w2 = _HWNDVal(windowId2);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  4118
	point.x = __intVal(x1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  4119
	point.y = __intVal(y1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  4120
	DPRINTF(("TransPoint %x %d/%d ->",w1,point.x,point.y));
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4121
	if (ClientToScreen(w1,&point) == FALSE) {
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4122
	    RETURN (nil);
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4123
	}
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4124
	if (ScreenToClient(w2,&point) == FALSE) {
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4125
	    RETURN (nil);
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4126
	}
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  4127
	DPRINTF((" %x %d/%d\n",w2,point.x,point.y));
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  4128
	x2 = __MKSMALLINT(point.x);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  4129
	y2 = __MKSMALLINT(point.y);
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4130
    } else {
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4131
	RETURN (nil);
2276
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4132
    }
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4133
%}.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4134
    ^ (x2 @ y2)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4135
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4136
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4137
vendorRelease
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4138
    "return the display-servers vendor release 
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4139
     - should normally not be of any interest, 
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4140
     but may be usefule for special cases.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4141
     (to avoid bugs in certain implementations / releases)"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4142
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4143
    ^ 1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4144
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4145
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4146
     Display vendorRelease
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4147
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4148
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4149
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4150
viewIdFromPoint:aPoint in:windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4151
    "given a point in rootWindow, return the viewId of the subview of windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4152
     hit by this coordinate. Return nil if no view was hit.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4153
     The returned id may be the id of a non ST view.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4154
     - used to find the window to drop objects after a cross-view drag."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4155
     
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4156
    windowId notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4157
	aPoint isPoint ifTrue:[
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4158
	    "/(aPoint x > 30000) ifTrue:[self halt.].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4159
	    "/(aPoint y > 30000) ifTrue:[self halt.].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4160
	    "/aPoint printString errorPrintCR.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4161
	    ^ self primViewIdFromPoint:aPoint asPoint truncated in:windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4162
	]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4163
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4164
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4165
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4166
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4167
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4168
whitepixel
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4169
    "return the colornumber of white"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4170
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4171
    ^ whitepixel
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4172
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4173
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4174
!WinWorkstation methodsFor:'accessing display capabilities'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4175
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4176
captionHeight
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4177
    "return the height in pixels of any caption (title-bar) in
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4178
     standard topWindows."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4179
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4180
    ^ self getSystemMetrics:#captionHeight
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4181
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4182
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4183
iconSizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4184
    "Get the preferred/supported icon sizes."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4185
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4186
    |d w h|
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4187
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4188
    w := self getSystemMetrics:#iconWidth.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4189
    h := self getSystemMetrics:#iconHeight.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4190
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4191
    d := IdentityDictionary new.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4192
    d at:#minWidth put:w.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4193
    d at:#maxWidth put:h.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4194
    d at:#widthStep put:1.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4195
    d at:#minHeight put:w.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4196
    d at:#maxHeight put:h.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4197
    d at:#heightStep put:1.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4198
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4199
    ^ OrderedCollection with:d
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4200
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4201
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4202
     Display iconSizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4203
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4204
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4205
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4206
preferredIconSize
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4207
    "Get the preferrered icon size. 
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4208
     Here, workaround windows (bug?) which returns 32@32
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4209
     although, 20@20 is much nicer"
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4210
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4211
    ^ 20@20
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4212
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4213
    "
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4214
     Display preferredIconSize  
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4215
    "
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4216
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4217
    "Modified: / 28.9.1998 / 13:49:54 / cg"
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4218
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4219
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4220
scrollsAsynchronous
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4221
    "return true, if this display asynchronously sends expose events after a
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4222
     scroll operation. False otherwise. Asynchronous expose events are an X
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4223
     speciality, which affects a few methods outside of the display class (sorry)"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4224
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4225
    ^ true "/ false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4226
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4227
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4228
supportedImageFormats
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4229
    "return an array with supported image formats; each array entry
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4230
     is another array, consisting of depth and bitsPerPixel values."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4231
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4232
    |info|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4233
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4234
    info := IdentityDictionary new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4235
    info at:#depth put:depth.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4236
    info at:#bitsPerPixel put:depth.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4237
    info at:#padding put:32.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4238
    ^ Array with:info
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  4239
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  4240
    "
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  4241
     Disply supportedImageFormats
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  4242
    "
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  4243
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  4244
    "Modified: / 10.9.1998 / 23:14:05 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4245
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4246
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4247
supportsDeepIcons
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4248
    "return true, if this device supports deepicons."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4249
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4250
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4251
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4252
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4253
supportsIconViews
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4254
    "return true, if this device supports views as icons."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4255
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4256
    ^ false "/ true
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4257
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4258
    "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4259
     Display supportsIconViews
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4260
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4261
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4262
    "Modified: 10.6.1996 / 20:11:48 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4263
    "Created: 10.6.1996 / 21:08:18 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4264
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4265
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  4266
supportsMaskedDrawing
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  4267
    "return true, if the device allows pixmaps to be used
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  4268
     as paint color. 
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  4269
     Sorry - win95 does not support it (only for 8x8 masks)."
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  4270
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  4271
    ^ isWin95 not
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  4272
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  4273
    "Created: / 11.9.1998 / 23:18:34 / cg"
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  4274
!
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  4275
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4276
usableExtent
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4277
    "return the usable extent of the display (in pixels).
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4278
     Normally, the same as extent, but may be smaller, in
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4279
     case some menu space is taken up by the window manager (windows)"
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4280
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4281
    ^ (self getSystemMetrics:#fullScreenWindowWidth)
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4282
      @
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4283
      (self getSystemMetrics:#fullScreenWindowHeight)
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4284
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4285
    "
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4286
     Display usableExtent
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4287
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4288
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4289
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4290
!WinWorkstation methodsFor:'bitmap/window creation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4291
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4292
addMenuItemWithLabel:aString toWindowID:aWindowId
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4293
    "not yet finished"
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4294
%{
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4295
#ifdef NOT_YET_IMPLEMENTED
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4296
    if (__isExternalAddress(aWindowId)) {
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4297
	HWND hWin = _HWNDVal(aWindowId);
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4298
	HMENU hMenu;
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4299
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4300
	hMenu = GetMenu(hWin);
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4301
	if (hMenu) {
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4302
        
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4303
	}
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4304
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4305
#endif
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4306
%}
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4307
!
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4308
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4309
createBitmapFromArray:anArray width:w height:h
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4310
    |bitmapId|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4311
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4312
    bitmapId := self primCreateBitmapFromArray:anArray width:w height:h.
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4313
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4314
    bitmapId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4315
	'WINWORKSTATION: cannot create bitmap' errorPrintCR.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4316
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4317
    ^ bitmapId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4318
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4319
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4320
createBitmapWidth:w height:h
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4321
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4322
%{  /* xxLIMITEDSTACK (WIN95 only) */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4323
    HANDLE newBitmapHandle;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4324
    int b_width, b_height;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4325
/*    printf("CreateBitmap B/W\n");*/
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4326
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4327
    if (__bothSmallInteger(w, h)) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4328
	b_width = __intVal(w);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4329
	b_height = __intVal(h);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4330
	newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, NULL);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4331
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4332
	if (newBitmapHandle)
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4333
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4334
#ifdef COUNT_BMP_RESOURCES
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4335
	    __cnt_bitmap++;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4336
	   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
  4337
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4338
	  RETURN ( __MKOBJ(newBitmapHandle));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4339
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4340
	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4341
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4342
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4343
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4344
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4345
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4346
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4347
createPixmapWidth:w height:h depth:d
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4348
    "allocate a pixmap on the Xserver, the contents is undefined
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4349
     (i.e. random). Return a bitmap id or nil"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4350
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4351
%{  /* xxLIMITEDSTACK (WIN95 only) */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4352
    HANDLE newBitmapHandle;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4353
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4354
    /*printf("CreateBitmap Color\n");*/
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4355
    if (__bothSmallInteger(w, h) && __isSmallInteger(d) && ISCONNECTED) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4356
	if (__intVal(d) == 1) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4357
	    newBitmapHandle = CreateBitmap(__intVal(w), __intVal(h) , 1, 1, NULL);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4358
	} else {
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  4359
#if 0
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4360
	    if (__intVal(d) != __depth) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4361
		printf("invalid depth\n");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4362
		RETURN (nil);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4363
	    } 
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4364
#endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4365
	    newBitmapHandle = CreateCompatibleBitmap(__rootDC,__intVal(w), __intVal(h) );
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4366
	}
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4367
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4368
	if (newBitmapHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4369
#ifdef COUNT_BMP_RESOURCES
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4370
	    __cnt_bitmap++;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4371
	    RES_BMP_PRINTF(("CreatePixmap %x %d\n",newBitmapHandle,__cnt_bitmap));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4372
#endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4373
	    RETURN ( __MKOBJ(newBitmapHandle));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4374
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4375
	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4376
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4377
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4378
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4379
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4380
1467
9629ce710c53 added type argument to createWindowFor - prepare for native window support (windows)
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  4381
createWindowFor:aView type:typeSymbol
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4382
		 origin:origin
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4383
		 extent:extent
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4384
		 minExtent:minExt
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4385
		 maxExtent:maxExt
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4386
		 borderWidth:bWidth
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4387
		 subViewOf:wsuperView
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4388
		 style:wStyle
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4389
		 inputOnly:winputOnly
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4390
		 label:wlabel
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4391
		 owner:wowner
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4392
		 icon:wicon
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4393
		 iconMask:wiconMask
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4394
		 iconView:wiconView
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4395
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4396
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4397
    |xpos ypos wwidth wheight minWidth minHeight maxWidth maxHeight
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4398
     wsuperViewId wiconId wiconMaskId windowId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4399
     weventMask wiconHeight
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4400
     wiconWidth windowType windowClass moreArgs|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4401
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4402
    "/ bColorId wiconViewId bitGravity vBgColor vBgForm deepForm
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4403
    "/  preferredVisual preferredDepth  viewGravity wcursorId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4404
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4405
    displayId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4406
	self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4407
	^ nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4408
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4409
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4410
    origin notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4411
	xpos := origin x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4412
	ypos := origin y.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4413
    ] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4414
	xpos := ypos := 0.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4415
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4416
    extent notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4417
	wwidth := extent x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4418
	wheight := extent y.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4419
    ] ifFalse:[
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4420
	wwidth := 100.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4421
	wheight := 40.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4422
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4423
    minExt notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4424
	minWidth := minExt x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4425
	minHeight := minExt y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4426
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4427
    maxExt notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4428
	maxWidth := maxExt x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4429
	maxHeight := maxExt y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4430
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4431
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4432
    wsuperView notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4433
	wsuperViewId := wsuperView id
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4434
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4435
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4436
    wicon notNil ifTrue:[
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4437
	wiconId := wicon id.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4438
	wiconHeight := wicon height.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4439
	wiconWidth  := wicon width.
1418
d21112d621a1 prepared for iconMasks
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  4440
	wiconMask notNil ifTrue:[
d21112d621a1 prepared for iconMasks
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  4441
	    wiconMaskId := wiconMask id
d21112d621a1 prepared for iconMasks
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  4442
	]
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4443
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4444
"/    wiconView notNil ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4445
"/        wiconViewId := wiconView id
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4446
"/    ].
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4447
    weventMask := aView eventMask.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4448
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4449
    NativeWindows ifTrue:[
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4450
	windowType := aView nativeWindowType.
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4451
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4452
	"/ if it is already a string, take it as it is;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4453
	"/ otherwise, it must be a symbol and is used
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4454
	"/ as a key into the nativeClass translation map.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4455
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4456
	windowType isString ifTrue:[
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4457
	    windowClass := windowType
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4458
	] ifFalse:[
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4459
	    windowClass := NativeWindowClassTable at:windowType ifAbsent:nil
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4460
	]
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4461
    ].
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4462
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4463
    moreArgs := Array new:20.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4464
    moreArgs at:1 put:xpos.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4465
    moreArgs at:2 put:ypos.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4466
    moreArgs at:3 put:wwidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4467
    moreArgs at:4 put:wheight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4468
    moreArgs at:5 put:minWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4469
    moreArgs at:6 put:minHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4470
    moreArgs at:7 put:maxWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4471
    moreArgs at:8 put:maxHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4472
    moreArgs at:9 put:wsuperViewId.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4473
    moreArgs at:10 put:nil. "/ wcursorId.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4474
    moreArgs at:11 put:wiconId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4475
    moreArgs at:12 put:wiconMaskId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4476
    moreArgs at:13 put:wiconWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4477
    moreArgs at:14 put:wiconHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4478
    moreArgs at:15 put:windowType.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4479
    moreArgs at:16 put:windowClass.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4480
    moreArgs at:17 put:weventMask.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4481
    moreArgs at:18 put:(aView className asString).
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4482
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4483
    [
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4484
      windowId := self
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4485
		  primCreateWindowFor:aView
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4486
		  type:typeSymbol
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4487
		  borderWidth:bWidth
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4488
		  subViewOf:wsuperView
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4489
		  style:wStyle
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4490
		  inputOnly:winputOnly
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4491
		  label:wlabel
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4492
		  owner:wowner
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4493
		  icon:wicon
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4494
		  iconMask:wiconMask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4495
		  moreArgs:moreArgs.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4496
      aView setId:windowId.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4497
    ] valueUninterruptably.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4498
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4499
    windowId notNil ifTrue:[self addKnownView:aView withId:windowId].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4500
    ^ windowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4501
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4502
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4503
destroyGC:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4504
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4505
    if (__isExternalAddress(aGCId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4506
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4507
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  4508
	if (gcData == NULL) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  4509
	    fprintf(stderr, "oops - destroying GC twice\n");
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  4510
	    RETURN(self);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  4511
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  4512
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4513
#ifdef COUNT_RESOURCES
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4514
	 __cnt_gcData--;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4515
	RESPRINTF(("DestroyGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4516
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4517
#ifdef COUNT_BMP_RESOURCES
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4518
	if (gcData->hBitmap) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4519
	    __cnt_bmpdc--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4520
	    RES_BMP_PRINTF(("free BmpDC %d\n",__cnt_bmpdc));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4521
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4522
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4523
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4524
#ifdef CACHE_LAST_DC
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4525
	if (lastGcData == gcData) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4526
	    _releaseDC(lastGcData);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4527
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4528
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  4529
	__ExternalAddressInstPtr(aGCId)->e_address = NULL;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4530
	free(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4531
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4532
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4533
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4534
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4535
destroyPixmap:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4536
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4537
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4538
    if (__isExternalAddress(aDrawableId) && ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4539
	HANDLE bitmapHandle = _HANDLEVal(aDrawableId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4540
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4541
	if (bitmapHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4542
#ifdef COUNT_BMP_RESOURCES
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4543
	    __cnt_bitmap--;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4544
	    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
  4545
#endif
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  4546
	    if( _DeleteObject(bitmapHandle) ) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4547
		DPRINTF(("Bitmap deleted!\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4548
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4549
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4550
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4551
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4552
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4553
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4554
destroyView:aView withId:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4555
    self primDestroyView:aView withId:aWindowId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4556
    self removeKnownView:aView withId:aWindowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4557
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4558
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4559
gcFor:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4560
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4561
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4562
    HWND hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4563
    struct gcData *gcData;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4564
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4565
    if (__isExternalAddress(aDrawableId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4566
	hWnd = _HWNDVal(aDrawableId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4567
	gcData = newGcData();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4568
	if (! gcData) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4569
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4570
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  4571
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4572
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4573
	__cnt_gcData++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4574
	RESPRINTF(("CreateGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4575
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4576
	gcData->hWnd = hWnd;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4577
	gcData->_hDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4578
	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
  4579
	RETURN ( __MKOBJ(gcData) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4580
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4581
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4582
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4583
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4584
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4585
gcForBitmap:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4586
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4587
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4588
    struct gcData *gcData;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4589
    BITMAP bitmap;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4590
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4591
    if (__isExternalAddress(aDrawableId)) {  /* HBITMAP */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4592
	HBITMAP hBitmap = _HBITMAPVAL(aDrawableId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4593
	HDC hDC;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4594
	gcData = newGcData();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4595
	if (! gcData) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4596
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4597
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  4598
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4599
#ifdef COUNT_BMP_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4600
	__cnt_bmpdc++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4601
	RES_BMP_PRINTF(("CreateBmpDC %d\n",__cnt_bmpdc));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4602
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4603
	if (GetObject(hBitmap,sizeof(bitmap),&bitmap)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4604
	    DPRINTF(("bitmap info:%d\n",bitmap.bmBitsPixel));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4605
	} else {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4606
	    DPRINTF(("noinfo returned\n"));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4607
	}
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  4608
	gcData->hBitmap = hBitmap;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4609
	gcData->bitmapColorBitCount = bitmap.bmBitsPixel;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4610
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4611
	__cnt_gcData++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4612
	RESPRINTF(("CreateGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4613
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4614
	RETURN ( __MKOBJ(gcData) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4615
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4616
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4617
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4618
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4619
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4620
primCreateBitmapFromArray:anArray width:w height:h
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4621
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4622
%{  /* xxLIMITEDSTACK */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4623
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4624
    HBITMAP newBitmapHandle;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4625
    int b_width, b_height, bytesPerRowST, bytesPerRowWN, padding;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4626
    int row, col;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4627
    unsigned char *cp, *bPits;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4628
    unsigned char *b_bits = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4629
    int index;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4630
    OBJ num;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4631
    unsigned char *allocatedBits = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4632
    unsigned char fastBits[10000];
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
    if (! ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4635
	RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4636
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4637
*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4638
    if (__bothSmallInteger(w, h) && _isNonNilObject(anArray))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4639
    {
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4640
	OBJ cls = __qClass(anArray);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4641
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4642
	b_width = __intVal(w);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4643
	b_height = __intVal(h);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4644
	bytesPerRowST = (b_width + 7) / 8;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4645
	bytesPerRowWN = ((b_width + 15) / 16) * 2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4646
	padding = bytesPerRowWN - bytesPerRowST;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4647
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4648
	if ((padding == 0) && (cls == @global(ByteArray))) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4649
	    b_bits = __ByteArrayInstPtr(anArray)->ba_element;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4650
	    cp = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4651
	} else {
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4652
	    int nBytes = b_height * bytesPerRowWN;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4653
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4654
	    if (nBytes < sizeof(fastBits)) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4655
		cp = b_bits = fastBits;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4656
	    } else {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4657
		cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4658
		if (! cp) goto fail;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4659
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4660
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4661
	if (cp) {
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4662
	    if (cls == @global(Array)) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4663
		OBJ *op;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4664
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4665
		index = 1;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4666
		op = &(__ArrayInstPtr(anArray)->a_element[index - 1]);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4667
		for (row = b_height; row; row--) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4668
		    for (col = bytesPerRowST; col; col--) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4669
			num = *op++;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4670
			if (! __isSmallInteger(num))
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4671
			    goto fail;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4672
			*cp++ = __intVal(num);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4673
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4674
		    cp += padding;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4675
		}
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4676
	    } else if (cls == @global(ByteArray)) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4677
		unsigned char *pBits;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4678
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4679
		pBits = __ByteArrayInstPtr(anArray)->ba_element;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4680
		for (row = b_height; row; row--) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4681
		    for (col = bytesPerRowST; col; col--) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4682
			*cp++ = ( *pBits++ /*^ 0xFF*/ );
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4683
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4684
		    cp += padding;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4685
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4686
	    } else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4687
		goto fail;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4688
	    }
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4689
	}
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4690
	DPRINTF(("create bitmap ...\n"));
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4691
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4692
	newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, b_bits );
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4693
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4694
	if( newBitmapHandle ) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4695
#ifdef COUNT_BMP_RESOURCES
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4696
	    __cnt_bitmap++;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4697
	    RES_BMP_PRINTF(("CreateBitmap %x %d\n",newBitmapHandle,__cnt_bitmap));
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4698
#endif
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4699
	    DPRINTF(("returning bitmap ...\n"));
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4700
	    if (allocatedBits) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4701
		free(allocatedBits);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4702
	    }
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  4703
	    RETURN ( __MKOBJ(newBitmapHandle));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4704
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4705
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4706
fail: ;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4707
    PRINTF(("create bitmap FAILED!!!\n"));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4708
    if (allocatedBits) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4709
	PRINTF(("freeing up bitmap bits ...\n"));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4710
	free(allocatedBits);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4711
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4712
    DPRINTF(("returning nil ...\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4713
    RETURN ( nil );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4714
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4715
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4716
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4717
primCreateWindowFor:aView type:aSymbol
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4718
	  borderWidth:bWidth subViewOf:wsuperView
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4719
	  style:wStyle inputOnly:winputOnly
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4720
	  label:wlabel owner:wowner
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4721
	  icon:wicon iconMask:wiconMask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4722
	  moreArgs:moreArgs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4723
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4724
%{  /* xxLIMITEDSTACK */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4725
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4726
    WNDCLASS wc;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4727
    long bg, bd, bw;
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  4728
    int winStyleBits, winEXStyleBits;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4729
    int w, h, x, y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4730
    int min_width, min_height;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4731
    int max_width, max_height;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4732
    OBJ eventMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4733
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4734
    HANDLE parentHandle;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4735
    OBJ xpos, ypos, wwidth, wheight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4736
    OBJ minWidth, minHeight, maxWidth, maxHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4737
    OBJ wsuperViewId, wcursorId, wiconId, wiconMaskId;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4738
    OBJ wiconWidth, wiconHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4739
    OBJ windowType, windowClass, windowId;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4740
    OBJ stClassName;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4741
    int isTopWindow = 0;
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  4742
    localWindowInfo *li;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4743
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4744
    unsigned char* cp;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4745
    HBITMAP        xBitMap, maskBitmap;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4746
    HICON          xIcon = (HICON)0;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4747
    ICONINFO       iconInfo;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4748
    char *className;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4749
    unsigned char fastBits[10000];
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4750
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4751
    xpos = __ArrayInstPtr(moreArgs)->a_element[0];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4752
    ypos = __ArrayInstPtr(moreArgs)->a_element[1];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4753
    wwidth = __ArrayInstPtr(moreArgs)->a_element[2];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4754
    wheight = __ArrayInstPtr(moreArgs)->a_element[3];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4755
    minWidth = __ArrayInstPtr(moreArgs)->a_element[4];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4756
    minHeight = __ArrayInstPtr(moreArgs)->a_element[5];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4757
    maxWidth = __ArrayInstPtr(moreArgs)->a_element[6];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4758
    maxHeight = __ArrayInstPtr(moreArgs)->a_element[7];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4759
    wsuperViewId = __ArrayInstPtr(moreArgs)->a_element[8];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4760
    wcursorId = __ArrayInstPtr(moreArgs)->a_element[9];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4761
    wiconId = __ArrayInstPtr(moreArgs)->a_element[10];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4762
    wiconMaskId = __ArrayInstPtr(moreArgs)->a_element[11];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4763
    wiconWidth = __ArrayInstPtr(moreArgs)->a_element[12];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4764
    wiconHeight = __ArrayInstPtr(moreArgs)->a_element[13];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4765
    windowType = __ArrayInstPtr(moreArgs)->a_element[14];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4766
    windowClass = __ArrayInstPtr(moreArgs)->a_element[15];
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4767
    eventMask = __ArrayInstPtr(moreArgs)->a_element[16];
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4768
    stClassName = __ArrayInstPtr(moreArgs)->a_element[17];
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4769
    bg = WhitePixel;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4770
    bd = BlackPixel;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4771
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4772
    /* get bitmap for icon */
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4773
    if ( __isExternalAddress(wiconId) ) {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4774
	xBitMap = _HBITMAPVAL( wiconId );
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4775
	if ( xBitMap != 0 ) {
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  4776
	    BITMAP bm;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  4777
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  4778
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  4779
		int d = bm.bmPlanes * bm.bmBitsPixel;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  4780
		BYTE *ep;
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4781
		int height, width;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4782
		int nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4783
		unsigned char *allocatedBits = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4784
		int privateMask = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4785
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4786
		if ( __isExternalAddress(wiconMaskId) ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4787
		    maskBitmap = _HBITMAPVAL( wiconMaskId );
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4788
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4789
		    if (wiconMaskId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4790
			PRINTF(("WinWorkstat [warning]: wiconMaskId is not an external address\n"));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4791
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4792
		    maskBitmap = 0;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4793
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4794
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4795
		/*
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4796
		 * if there is no mask, generate one
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4797
		 */
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4798
		if (maskBitmap == 0) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4799
		    DPRINTF(("Bitmap w:%d h:%d p:%d d:%d\n",bm.bmWidth,bm.bmHeight,bm.bmPlanes,bm.bmBitsPixel));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4800
		    height = __intVal( wiconHeight );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4801
		    width  = __intVal( wiconWidth  );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4802
		    nBytes = ( width + 15 ) / 8;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4803
		    nBytes = height * nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4804
		    if (nBytes < sizeof(fastBits)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4805
			ep = fastBits;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4806
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4807
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4808
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4809
		    if ( ep == 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4810
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4811
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4812
			memset(ep, 0, nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4813
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4814
			if ( maskBitmap == NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4815
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4816
			} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4817
			    privateMask = 1;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4818
			}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4819
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4820
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4821
		if ( maskBitmap != NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4822
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4823
		    iconInfo.fIcon = TRUE;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4824
		    iconInfo.hbmMask  = maskBitmap;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4825
		    iconInfo.hbmColor = xBitMap;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4826
		    xIcon = CreateIconIndirect( &iconInfo );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4827
		    if (privateMask) {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  4828
			_DeleteObject( maskBitmap );
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  4829
		    }
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  4830
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4831
		    PRINTF(( "WinWorkstat [warning]: no mask for icon !\n" ));
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  4832
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4833
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4834
		if (allocatedBits) {
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  4835
		    free(allocatedBits);
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4836
		}
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  4837
	    }
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4838
	} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4839
	    DPRINTF(("WinWorkstat [warning]: xBitMap is zero \n" ));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4840
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4841
    } else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4842
	if (wiconId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  4843
	    PRINTF(("WinWorkstat [warning]: wiconId is not an external address\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4844
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4845
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4846
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4847
    if (__bothSmallInteger(wwidth, wheight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4848
	w = __intVal(wwidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4849
	h = __intVal(wheight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4850
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4851
	w = h = 100;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4852
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4853
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4854
    if (__bothSmallInteger(xpos, ypos)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4855
	x = __intVal(xpos);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4856
	y = __intVal(ypos);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4857
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4858
	x = y = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4859
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4860
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4861
    if (__bothSmallInteger(minWidth, minHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4862
	min_width = __intVal(minWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4863
	min_height = __intVal(minHeight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4864
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4865
	min_width = min_height = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4866
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4867
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4868
    if (__bothSmallInteger(maxWidth, maxHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4869
	max_width = __intVal(maxWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4870
	max_height = __intVal(maxHeight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4871
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4872
	max_width = max_height = 10000;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4873
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4874
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  4875
    winStyleBits = winEXStyleBits = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4876
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4877
    if (__isSmallInteger(bWidth)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4878
	bw = __intVal(bWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4879
	if (bw) {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4880
	    winStyleBits |= WS_BORDER;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4881
	    bw = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4882
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4883
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4884
	bw = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4885
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4886
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4887
    className = app_name;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4888
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4889
#ifdef LATER
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4890
    if (__isString(windowClass)) {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4891
	className = __stringVal(windowClass);
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4892
    }
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4893
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4894
    if (__isString(windowClass)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4895
	if (__isInteger(wStyle)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4896
	    winStyleBits |= __longIntVal(wStyle);
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4897
	} else {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4898
	    if (windowType == @symbol(RadioButton)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4899
		winStyleBits |= BS_RADIOBUTTON;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4900
	    } else if (windowType == @symbol(CheckBox)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4901
		winStyleBits |= BS_CHECKBOX;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4902
	    } else if (windowType == @symbol(HorizontalScrollbar)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4903
		winStyleBits |= SBS_HORZ;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4904
	    } else if (windowType == @symbol(VerticalScrollBar)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4905
		winStyleBits |= SBS_VERT;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4906
	    }
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4907
	}
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4908
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4909
#endif /* LATER */
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4910
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4911
    if (__isExternalAddress(wsuperViewId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4912
	/*
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4913
	 * a child window
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4914
	 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4915
	parentHandle = _HANDLEVal(wsuperViewId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4916
	winStyleBits |= WS_CHILD;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4917
	if (winputOnly != true) {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4918
	    winStyleBits |= (WS_CLIPSIBLINGS|WS_CLIPCHILDREN);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4919
	    /*winStyleBits |= WS_CLIPCHILDREN;*/
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4920
	    DPRINTF(("parent handle=%x\n", parentHandle));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4921
	} else {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4922
	    winEXStyleBits |= WS_EX_TRANSPARENT;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4923
	    DPRINTF(("inputview parent handle=%x\n", parentHandle));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4924
	}
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4925
    } else {
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4926
	/*
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4927
	 * a top window (regular / popUp or dialog)
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4928
	 */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4929
	char buf[300];
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4930
	char *stName;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4931
	static winCount;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4932
#   ifdef __BORLANDC__
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4933
	struct timeb timebuffer;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4934
	ftime(&timebuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4935
#   else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4936
	struct _timeb timebuffer;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4937
	_ftime(&timebuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4938
#   endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4939
	if (__isString(stClassName)) {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4940
	    stName = __stringVal(stClassName);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4941
	} else {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4942
	    stName = app_name;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4943
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4944
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4945
	sprintf(buf,"S%d.%d%s",HIWORD(timebuffer.time),++winCount,stName);
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4946
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4947
	parentHandle = NULL;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4948
	isTopWindow = 1;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4949
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4950
#ifdef TOPWINDOWCLASS
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4951
	DPRINTF(("topview - registerClass:%s\n",buf));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4952
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4953
	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
  4954
	wc.lpfnWndProc = (WNDPROC) MainWndProc;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4955
	wc.cbClsExtra = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4956
	wc.cbWndExtra = N_WINDOW_PRIVATE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4957
	wc.hInstance = (HANDLE) __getHInstance();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4958
	if (xIcon) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4959
	    wc.hIcon   = xIcon;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4960
	    /* 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
  4961
	} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4962
	    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
  4963
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4964
	wc.hCursor = 0 /* LoadCursor(NULL, IDC_ARROW) */;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4965
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4966
	wc.hbrBackground = 0; /*CreateSolidBrush (bg);*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4967
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4968
	wc.lpszMenuName =  NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4969
	wc.lpszClassName = buf;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4970
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4971
	if (!RegisterClass(&wc)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4972
	    PRINTF(("RegisterClass failed\n"));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4973
	    RETURN( nil );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4974
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4975
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4976
	className = buf;
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4977
#endif
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4978
	if (wStyle == @symbol(popUp)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4979
	    winStyleBits |= WS_POPUP;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  4980
	    winStyleBits |= WS_DISABLED;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4981
	    winEXStyleBits |= WS_EX_TOOLWINDOW;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  4982
	    CPRINTF(("Create popUpWindow\n"));
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4983
	} else if (wStyle == @symbol(dialog)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4984
/*
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4985
	    winStyleBits |= WS_OVERLAPPED | WS_CAPTION | WS_THICKFRAME;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4986
*/
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4987
	    winStyleBits |= WS_OVERLAPPED | WS_CAPTION | DS_MODALFRAME | WS_SYSMENU;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  4988
	    winStyleBits |= WS_POPUP;
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4989
	    winStyleBits |= DS_NOIDLEMSG;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  4990
	    //winEXStyleBits |= WS_EX_TOOLWINDOW;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4991
	    if ((min_width || min_height)
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4992
	     && (min_width == max_width)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4993
	     && (min_height == max_height)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4994
		winStyleBits &= ~WS_THICKFRAME;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4995
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4996
	} else {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4997
	    //winStyleBits |= WS_OVERLAPPEDWINDOW;
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4998
	    winStyleBits |= WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |WS_MAXIMIZEBOX | WS_SIZEBOX;
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4999
	    //winEXStyleBits |= WS_EX_CLIENTEDGE;
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  5000
	    winEXStyleBits |= WS_EX_WINDOWEDGE;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  5001
	    //winEXStyleBits |= WS_EX_ACCEPTFILES;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5002
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5003
	winStyleBits |= WS_CLIPCHILDREN;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5004
    }
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5005
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5006
    rec.left = x;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5007
    rec.top = y;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5008
    rec.right = x + w;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5009
    rec.bottom = y+ h;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5010
    _thread_winStyleBitsEx = WS_EX_LEFT | WS_EX_NOPARENTNOTIFY | winEXStyleBits;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5011
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5012
#ifdef ADJUSTWINDOW
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5013
    AdjustWindowRectEx(&rec,winStyleBits,0,_thread_winStyleBitsEx);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5014
    w = rec.right - rec.left;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5015
    h = rec.bottom - rec.top;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5016
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5017
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5018
    DPRINTF(("create%s pos==%d/%d size=%d/%d bw=%d parent %x class='%s'...\n",
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5019
		((wStyle == @symbol(popUp)) ? " popUp" : ""), x, y, w, h, bw,parentHandle, className));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5020
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5021
    _thread_newWinHandle = NULL;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5022
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5023
    /* allocate localMemory for Window */
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5024
    li = (localWindowInfo*) malloc(sizeof(localWindowInfo));
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5025
    if (! li) {
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5026
	fprintf(stderr, "WinWorkstation: malloc failed in CreateWindow\n");
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5027
    } else {
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5028
	memset(li,0,sizeof(*li));
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5029
	if (isTopWindow) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5030
	    if (rec.left < 0) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5031
		rec.left = 0;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5032
		rec.right = w;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5033
	    }
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5034
	    if (rec.top < 0) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5035
		rec.top = 0;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5036
		rec.bottom = h;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5037
	    }
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5038
	    li->flag = LI_TOPWIN;
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5039
	} else {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5040
	    if (bw) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5041
		// adjust for border
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5042
		rec.left++;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5043
		rec.top++;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5044
	    }
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5045
	}
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5046
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5047
	if (winputOnly == true)
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5048
	    li->flag |= LI_INPUTWIN;
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5049
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5050
	_thread_className = className;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5051
	_thread_winStyleBits = winStyleBits;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5052
	_thread_parentHandle = parentHandle;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5053
	_thread_x = rec.left;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5054
	_thread_y = rec.top;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5055
	_thread_dx = rec.right - rec.left;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5056
	_thread_dy = rec.bottom - rec.top;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5057
	rec.left = 0;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5058
	rec.top = 0;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5059
	rec.right = min_width;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5060
	rec.bottom = min_height;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5061
#ifdef ADJUSTWINDOW
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5062
	AdjustWindowRectEx(&rec,winStyleBits,0,_thread_winStyleBitsEx);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5063
#endif
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5064
	li->minWidth = rec.right - rec.left;
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5065
	li->minHeight = rec.bottom - rec.top;
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5066
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5067
	rec.left = 0;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5068
	rec.top = 0;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5069
	rec.right = max_width;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5070
	rec.bottom = max_height;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5071
#ifdef ADJUSTWINDOW
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5072
	AdjustWindowRectEx(&rec,winStyleBits,0,_thread_winStyleBitsEx);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5073
#endif
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5074
	li->maxWidth = rec.right - rec.left;
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5075
	li->maxHeight = rec.bottom - rec.top;
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5076
	li->bgBrush = 0; /*GetStockObject(HOLLOW_BRUSH);*/
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5077
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5078
	if (__isSmallInteger(eventMask))
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5079
	    li->eventMask = __intVal(eventMask);
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5080
	else
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5081
	    li->eventMask = 0xffffffff;
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5082
	DPRINTF(("eventMask is %x\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5083
#ifdef DEBUGMASK1
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5084
	printMask(li->eventMask);
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5085
#endif
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5086
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5087
	li->bw = bw;
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5088
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5089
	_thread_newWinHandle = 0;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5090
	_thread_windowName = 0;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5091
	if (isTopWindow) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5092
	    if (__isString(wlabel) || __isSymbol(wlabel)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5093
		_thread_windowName = (char *) __stringVal(wlabel);
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5094
		DPRINTF(("title = %s\n", _thread_windowName));
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5095
	    }
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5096
	}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5097
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5098
/*
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5099
	_thread_local = li;
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5100
*/
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5101
	PostThreadMessage(_dispatchThreadId, WM_THREADCREATEWINDOW, 0, (INT)li);
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5102
	{
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5103
	    DWORD dwWaitResult;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5104
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5105
	    /* Request ownership of mutex. */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5106
	    dwWaitResult = WaitForSingleObject(
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5107
				hCreateEvent,   /* handle of mutex */
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5108
				15000L);        /* time-out interval */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5109
	    if (dwWaitResult != WAIT_OBJECT_0) {
2491
be54b494a252 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2464
diff changeset
  5110
		fprintf(stderr, "WinWorkstation [error]: oops timeout in CreateWindow\n");
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5111
	    }
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5112
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5113
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5114
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5115
    DPRINTF(("handle = %x\n", _thread_newWinHandle));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5116
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5117
    if (! _thread_newWinHandle) {
2491
be54b494a252 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2464
diff changeset
  5118
	fprintf(stderr, "WinWorkstation [error]: CreateWindow failed\n");
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5119
	RETURN ( nil );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5120
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5121
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5122
    windowId = __MKOBJ(_thread_newWinHandle);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5123
    SetWindowPos(_thread_newWinHandle, HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5124
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  5125
#ifndef TOPWINDOWCLASS
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5126
    if (xIcon) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5127
	SendMessage(_thread_newWinHandle, WM_SETICON, ICON_SMALL, (LPARAM)xIcon);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5128
	SendMessage(_thread_newWinHandle, WM_SETICON, ICON_BIG, (LPARAM)xIcon);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5129
    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  5130
#endif      
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5131
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5132
    DPRINTF(("done - create\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5133
    RETURN (windowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5134
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5135
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5136
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5137
primDestroyView:aView withId:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5138
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5139
%{  /* xxLIMITEDSTACK (WIN95 only) */
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5140
    HICON yIcon;
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5141
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5142
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5143
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5144
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5145
	if (win && IsWindow(win)) {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  5146
#ifndef TOPWINDOWCLASS
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5147
	   yIcon = (HICON)GetClassLong(_thread_newWinHandle,GCL_HICON);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5148
	   SetClassLong(_thread_newWinHandle,GCL_HICON,(DWORD)0);
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5149
	   /* It has to be checked whether this can be deleted!!!!! */
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5150
	   if( yIcon ) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5151
		if( DestroyIcon( yIcon ) )
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5152
		    DPRINTF(( "Old icon deleted\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5153
	   }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  5154
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5155
	   /*printf("post WM_THREADDESTROYWINDOW\n");*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5156
	   PostMessage(win,WM_THREADDESTROYWINDOW,0,0);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5157
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5158
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5159
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5160
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5161
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5162
rootWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5163
    "return the id of the root window.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5164
     This is the window you see as background,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5165
     however, it may or may not be the real physical root window,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5166
     since some window managers install a virtual root window on top
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5167
     of the real one. If this is the case, that views id is returned here."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5168
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5169
    ^ rootWin
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5170
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5171
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5172
!WinWorkstation methodsFor:'color stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5173
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5174
colorRed:redVal green:greenVal blue:blueVal
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5175
    "allocate a color with rgb values (0..100) - return the color index (i.e. colorID).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5176
     This method is obsoleted by #colorScaledRed:scaledGreen:scaledBlue:"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5177
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5178
    |r g b|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5179
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5180
    r := self percentToDeviceColorValue:redVal.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5181
    g := self percentToDeviceColorValue:greenVal.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5182
    b := self percentToDeviceColorValue:blueVal.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5183
    ^ self colorScaledRed:r scaledGreen:g scaledBlue:b
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5184
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5185
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5186
colorScaledRed:r scaledGreen:g scaledBlue:b
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5187
    "allocate a color with rgb values (0..16rFFFF) - return the color index
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5188
     (i.e. colorID)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5189
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5190
    int id, ir, ig, ib;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5191
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5192
    if (__bothSmallInteger(r, g) && __isSmallInteger(b)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5193
	id = RGB2st(__intVal(r),__intVal(g),__intVal(b));
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5194
	DDPRINTF(("alloc color %d/%d/%d -> %x\n", ir, ig, ib, id));
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5195
	RETURN ( __MKSMALLINT(id) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5196
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5197
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5198
    self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5199
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5200
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5201
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5202
freeColor:colorIndex
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5203
    "free a display color when its no longer needed"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5204
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5205
    'free color' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5206
    ^ self
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5207
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5208
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5209
getRGBFrom:index into:aBlock
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5210
    "get rgb components (0..100) of color in map at:index,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5211
     and evaluate the 3-arg block, aBlock with them"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5212
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5213
    |val|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5214
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5215
    self getScaledRGBFrom:index into:[:r :g :b |
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5216
	val := aBlock
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5217
		value:(r * 100.0 / 16rFFFF)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5218
		value:(g * 100.0 / 16rFFFF)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5219
		value:(b * 100.0 / 16rFFFF)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5220
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5221
    'get RGB' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5222
    ^ val
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5223
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5224
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5225
getRGBFromName:colorName into:aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5226
    "get rgb components (0..100) of color named colorName,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5227
     and evaluate the 3-arg block, aBlock with them"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5228
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5229
    |val|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5230
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5231
    self getScaledRGBFromName:colorName into:[:r :g :b |
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5232
	r isNil ifTrue:[^nil].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5233
	val := aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5234
		value:(r * 100.0 / 16rFFFF)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5235
		value:(g * 100.0 / 16rFFFF)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5236
		value:(b * 100.0 / 16rFFFF)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5237
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5238
    ^val
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5239
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5240
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5241
getScaledRGBFrom:index into:aBlock
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5242
    "get rgb components (0 .. 16rFFFF) of color in map at:index,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5243
     and evaluate the 3-arg block, aBlock with them"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5244
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5245
    |r g b|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5246
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5247
    int id = __intVal(index);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5248
    int iR, iG, iB;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5249
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5250
    id = st2RGB(id,0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5251
    iR = id & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5252
    iG = (id >> 8) & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5253
    iB = (id >> 16) & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5254
    iR = (iR << 8) | iR;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5255
    iG = (iG << 8) | iG;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5256
    iB = (iB << 8) | iB;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5257
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5258
    r = __MKSMALLINT(iR);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5259
    g = __MKSMALLINT(iG);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5260
    b = __MKSMALLINT(iB);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5261
    /*printf("get color %x -> %x/%x/%x\n",id, iR, iG, iB);*/
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5262
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5263
    ^ aBlock value:r value:g value:b
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5264
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5265
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5266
getScaledRGBFromName:colorName into:aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5267
    "get scaled rgb components (0..16rFFFF) of color named colorName,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5268
     and evaluate the 3-arg block, aBlock with them"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5269
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5270
    |triple r g b found|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5271
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5272
    r := g := b := 0.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5273
    found := false.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5274
    (colorName startsWith:$#) ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5275
	"/ color in r/g/b hex notation
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5276
	r := Integer readFrom:(colorName copyFrom:2 to:3) radix:16.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5277
	g := Integer readFrom:(colorName copyFrom:4 to:5) radix:16.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5278
	b := Integer readFrom:(colorName copyFrom:6 to:7) radix:16.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5279
	found := true.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5280
    ] ifFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5281
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5282
	triple := StandardColorValues at:colorName asString ifAbsent:nil.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5283
	triple isNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5284
	    triple := StandardColorValues at:colorName asString asLowercase ifAbsent:nil.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5285
	].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5286
	triple notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5287
	    r := triple at:1.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5288
	    g := triple at:2.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5289
	    b := triple at:3.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5290
	    found := true.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5291
	].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5292
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5293
    found ifFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5294
	('WinWorkstation: unknown color: ' , colorName) infoPrintCR.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5295
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5296
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5297
    ^ aBlock value:((r * 256) + r) value:((g * 256) + g) value:((b * 256) + b)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5298
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5299
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5300
listOfAvailableColors
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5301
    "return a list of all available colornames.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5302
     This should not be used, since colornames are very
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5303
     display-specific (here X-specific)."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5304
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5305
    |aStream list line index colorName|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5306
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5307
    aStream := FileStream readonlyFileNamed:'/usr/lib/X11/rgb.txt'.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5308
    aStream isNil ifTrue:[^ nil].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5309
    list := OrderedCollection new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5310
    [aStream atEnd] whileFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5311
	line := aStream nextLine.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5312
	line notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5313
	    "skip the r/g/b numbers"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5314
	    index := 1.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5315
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5316
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5317
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5318
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5319
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5320
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5321
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5322
	    colorName := line copyFrom:index.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5323
	    ((colorName occurrencesOf:(Character space)) == 0) ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5324
		list add:colorName
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5325
	    ]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5326
	]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5327
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5328
    aStream close.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5329
    ^ list sort
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5330
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5331
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5332
     Screen current listOfAvailableColors
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5333
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5334
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5335
    "Modified: 11.9.1996 / 15:26:28 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5336
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5337
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5338
percentToDeviceColorValue:aPercentage
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5339
    "given a color-component value in percent (0..100), return the corresponding
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5340
     WIN-component value (0..16rFFFF) as an integer"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5341
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5342
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5343
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5344
    if (__isSmallInteger(aPercentage)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5345
	RETURN ( __MKSMALLINT(0xFFFF * __intVal(aPercentage) / 100) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5346
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5347
    if (__isFloat(aPercentage)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5348
	RETURN ( __MKSMALLINT(0xFFFF * (int)(__floatVal(aPercentage)) / 100) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5349
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5350
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5351
    ^ (16rFFFF * aPercentage / 100) rounded
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5352
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5353
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5354
setColor:index scaledRed:sred scaledGreen:sgreen scaledBlue:sblue
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5355
    "change a palette index.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5356
     This is not yet supported in the Windows Device 
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5357
     - we assume and depend upon transparent 24bit trueColor mode."
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5358
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5359
     'WinWorkstation [info]: #setColor:scaledRed:scaledGreen:scaledBlue: ignored' infoPrintCR.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5360
     ^ self.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5361
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5362
    "Created: 30.1.1998 / 09:27:48 / md"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5363
    "Modified: 30.1.1998 / 09:30:22 / md"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5364
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5365
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5366
!WinWorkstation methodsFor:'cursor stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5367
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5368
builtInCursorShapes
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5369
    "return a collection of standard cursor names.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5370
     Those are built into Windows and need not be created as
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5371
     user cursors.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5372
     (actually, there are more than those below ...)"
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5373
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5374
    "/ if you add something here, also add to #shapeNumberFromCursor ...
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5375
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5376
    ^ #(
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5377
	#upLeftArrow            "/ IDC_ARROW
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5378
	#upDownArrow            "/ IDC_SIZENS
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5379
	#leftRightArrow         "/ IDC_SIZEWE
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5380
	#text                   "/ IDC_IBEAM
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5381
	#wait                   "/ IDC_WAIT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5382
	#execute                "/ IDC_APPSTARTING
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5383
	#crossHair              "/ IDC_CROSS
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5384
	#fourWay                "/ IDC_SIZEALL
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5385
	#upRightHand            "/ IDC_ARROW
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5386
	#noDrop                 "/ IDC_NO
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5387
       )
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5388
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5389
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5390
createCursorShape:aShape
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5391
    "create a cursor given a shape-symbol"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5392
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5393
    |number|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5394
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5395
    number := self shapeNumberFromSymbol:aShape.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5396
    ^ self primCreateCursorShapeNr:number
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5397
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5398
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5399
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
  5400
    "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
  5401
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5402
    |padding bpl bplPadded srcOffs dstOffs
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5403
     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
  5404
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  5405
    cW := self getSystemMetrics:#cursorWidth.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  5406
    cH := self getSystemMetrics:#cursorHeight.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  5407
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5408
    "/ ('cursorWidth ',cW printString,'cursorHeight ',cH printString) infoPrintCR.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5409
    src := sourceBytes.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5410
    mask := maskBytes.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5411
    padding := self cursorBitmapPadding.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5412
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5413
    "/ repadding and/or resizing required ?
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5414
    bpl := sourceBytes size / h.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5415
    bplPadded := (cW + padding - 1) // padding * 2.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5416
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5417
    bpl ~~ bplPadded ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5418
	 "/     'repad cursor bits' infoPrintCR.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5419
	srcPadded := ByteArray new:(bplPadded * cH).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5420
	nB := bpl min: bplPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5421
	nR := cH min: h.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5422
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5423
	dstOffs := srcOffs := 1.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5424
	1 to:nR do:[:row |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5425
	    srcPadded
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5426
		replaceFrom:dstOffs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5427
		to:(dstOffs+nB-1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5428
		with:src
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5429
		startingAt:srcOffs.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5430
	    dstOffs := dstOffs + bplPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5431
	    srcOffs := srcOffs + bpl.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5432
	].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5433
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5434
	maskPadded := ByteArray new:(bplPadded * cH).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5435
	dstOffs := srcOffs := 1.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5436
	1 to:nR do:[:row |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5437
	    maskPadded
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5438
		replaceFrom:dstOffs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5439
		to:(dstOffs+nB-1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5440
		with:mask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5441
		startingAt:srcOffs.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5442
	    dstOffs := dstOffs + bplPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5443
	    srcOffs := srcOffs + bpl.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5444
	].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5445
	src := srcPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5446
	mask := maskPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5447
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5448
    ].
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5449
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5450
    src invert.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5451
    1 to:src size do:[:index |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5452
	src byteAt:index put:((src byteAt:index) bitAnd:(mask byteAt:index)).
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5453
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5454
    mask invert.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5455
    cursor := self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5456
	primCreateCursorSourceBits:src
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5457
	maskBits:mask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5458
	hotX:hx hotY:hy
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5459
	width:cW height:cH.
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5460
    cursor notNil ifTrue:[^ cursor ].
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5461
    'WinWorkstation [warning]: could not create bitmap cursor' infoPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5462
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5463
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5464
cursorBitmapPadding
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5465
    ^ 16 "/ windows requires short-padded rows
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5466
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5467
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5468
destroyCursor:aCursorId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5469
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5470
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5471
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5472
    if (ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5473
	if (__isExternalAddress(aCursorId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5474
	    HCURSOR curs = _HCURSORVal(aCursorId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5475
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5476
	    if (curs) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5477
#ifdef KEEP_STD_CURSORS
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5478
		if ((curs != H_C_ARROW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5479
		 && (curs != H_C_CROSS)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5480
		 && (curs != H_C_IBEAM)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5481
		 && (curs != H_C_ICON)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5482
		 && (curs != H_C_NO)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5483
		 && (curs != H_C_SIZE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5484
		 && (curs != H_C_SIZEALL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5485
		 && (curs != H_C_SIZENESW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5486
		 && (curs != H_C_SIZENS)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5487
		 && (curs != H_C_SIZENWSE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5488
		 && (curs != H_C_UPARROW)
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5489
		 && (curs != H_C_APPSTARTING)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5490
		 && (curs != H_C_WAIT)) 
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5491
#endif /* KEEP_STD_CURSORS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5492
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5493
		    DestroyCursor(curs);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5494
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5495
	    __cnt_cur--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5496
	    RESPRINTF(("DestroyCursor %d\n",__cnt_cur));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5497
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5498
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5499
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5500
	    RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5501
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5502
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5503
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5504
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5505
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5506
needDeviceFormsForCursor
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5507
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5508
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5509
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5510
primCreateCursorShapeNr:number
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5511
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5512
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5513
    HCURSOR newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5514
    LPCTSTR cId;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5515
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5516
    if (__isSmallInteger(number)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5517
	cId = (LPCTSTR)(__intVal(number));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5518
	newCursor = LoadCursor(NULL, cId);
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5519
	if (newCursor) {
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  5520
#ifdef KEEP_STD_CURSORS
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5521
	    if (cId == IDC_ARROW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5522
		H_C_ARROW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5523
	    else if (cId == IDC_CROSS)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5524
		H_C_CROSS = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5525
	    else if (cId == IDC_IBEAM)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5526
		H_C_IBEAM = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5527
	    else if (cId == IDC_ICON)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5528
		H_C_ICON = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5529
	    else if (cId == IDC_NO)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5530
		H_C_NO = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5531
	    else if (cId == IDC_SIZE)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5532
		H_C_SIZE = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5533
	    else if (cId == IDC_SIZEALL)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5534
		H_C_SIZEALL = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5535
	    else if (cId == IDC_SIZENESW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5536
		H_C_SIZENESW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5537
	    else if (cId == IDC_SIZENS)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5538
		H_C_SIZENS = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5539
	    else if (cId == IDC_SIZENWSE)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5540
		H_C_SIZENWSE = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5541
	    else if (cId == IDC_UPARROW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5542
		H_C_UPARROW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5543
	    else if (cId == IDC_WAIT)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5544
		H_C_WAIT = newCursor;
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5545
	    else if (cId == IDC_APPSTARTING)
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5546
		H_C_APPSTARTING = newCursor;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5547
#endif /* KEEP_STD_CURSORS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5548
	    RETURN ( __MKOBJ(newCursor) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5549
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5550
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5551
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5552
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5553
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5554
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5555
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
  5556
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5557
%{  /* xxLIMITEDSTACK (WIN95) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5558
    HCURSOR newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5559
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5560
    if (__isByteArray(src)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5561
     && __isByteArray(mask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5562
     && __bothSmallInteger(hx, hy)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5563
     && __bothSmallInteger(w, h)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5564
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5565
	newCursor = CreateCursor((HANDLE) __getHInstance(),
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5566
				 __intVal(hx), __intVal(hy),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5567
				 __intVal(w), __intVal(h),
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5568
				 __ByteArrayInstPtr(mask)->ba_element,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5569
				 __ByteArrayInstPtr(src)->ba_element);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5570
	if (newCursor) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5571
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5572
	    __cnt_cur++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5573
	    RESPRINTF(("CreateCursor %d\n",__cnt_cur));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5574
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5575
	    RETURN ( __MKOBJ(newCursor));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5576
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5577
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5578
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5579
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5580
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5581
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5582
shapeNumberFromSymbol:shape
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5583
    "given a shape-symbol, return the corresponding cursor-number,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5584
     or nil if no such standard cursor exists."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5585
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5586
    "this is pure Win-knowlegde - but you may easily add more"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5587
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5588
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5589
    if (shape == @symbol(upRightHand)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5590
	RETURN ( __MKSMALLINT( (INT)IDC_ARROW));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5591
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5592
    if (shape == @symbol(upLeftArrow)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5593
	RETURN ( __MKSMALLINT( (INT)IDC_ARROW));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5594
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5595
    if (shape == @symbol(upDownArrow)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5596
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENS));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5597
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5598
    if (shape == @symbol(leftRightArrow)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5599
	RETURN ( __MKSMALLINT( (INT)IDC_SIZEWE));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5600
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5601
    if (shape == @symbol(text)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5602
	RETURN ( __MKSMALLINT( (INT)IDC_IBEAM));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5603
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5604
    if (shape == @symbol(wait)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5605
	RETURN ( __MKSMALLINT( (INT)IDC_WAIT));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5606
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5607
    if (shape == @symbol(crossHair)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5608
	RETURN ( __MKSMALLINT( (INT)IDC_CROSS));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5609
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5610
    if (shape == @symbol(fourWay)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5611
	RETURN ( __MKSMALLINT( (INT)IDC_SIZEALL));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5612
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5613
    if (shape == @symbol(execute)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5614
	RETURN ( __MKSMALLINT( (INT)IDC_APPSTARTING));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5615
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5616
    if (shape == @symbol(noDrop)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5617
	RETURN ( __MKSMALLINT( (INT)IDC_NO));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5618
    }
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5619
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5620
    if (shape == @symbol(IDC_UPARROW)) {
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5621
	RETURN ( __MKSMALLINT( (INT)IDC_UPARROW));
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5622
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5623
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5624
    if (shape == @symbol(IDC_SIZE)) {
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5625
	RETURN ( __MKSMALLINT( (INT)IDC_SIZE));
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5626
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5627
    if (shape == @symbol(IDC_SIZENWSE)) {
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5628
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENWSE));
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5629
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5630
    if (shape == @symbol(IDC_SIZENESW)) {
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5631
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENESW));
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5632
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5633
    if (shape == @symbol(IDC_NO)) {
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5634
	RETURN ( __MKSMALLINT( (INT)IDC_NO));
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5635
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5636
#ifdef IDC_HELP
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5637
    if (shape == @symbol(IDC_HELP)) {
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5638
	RETURN ( __MKSMALLINT( (INT)IDC_HELP));
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5639
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  5640
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5641
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5642
"/    ('WINWORKSTATION: invalid cursorShape:' , shape printString) infoPrintNL.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5643
    ^  nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5644
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5645
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5646
!WinWorkstation methodsFor:'drawing'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5647
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5648
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
  5649
		width:w height:h
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5650
    "do a bit-blt; copy bits from the rectangle defined by
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5651
     srcX/srcY and w/h from the sourceId drawable to the rectangle
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5652
     below dstX/dstY in the destId drawable. Trigger an error if any
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5653
     argument is not integer."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5654
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5655
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5656
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5657
    struct gcData *dstGcData = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5658
    struct gcData *srcGcData = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5659
    HDC srcDC = (HDC)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5660
    HDC dstDC = (HDC)0;
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5661
    int dstGcOwnerThreadID;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5662
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5663
    if (__isExternalAddress(srcGCId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5664
	srcGcData = _GCDATA(srcGCId);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5665
    } else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5666
	goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5667
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5668
    if (__isExternalAddress(dstGCId)) {
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5669
	dstGcData = _GCDATA(dstGCId);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5670
    } else {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5671
	goto fail;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5672
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5673
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5674
    if (__bothSmallInteger(w, h)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5675
     && __bothSmallInteger(srcX, srcY)
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5676
     && __bothSmallInteger(dstX, dstY)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5677
	int fun = BITBLT_COPY;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5678
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5679
	if (srcGcData && dstGcData) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5680
	    fun = dstGcData->bitbltrop2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5681
#if 0
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5682
	    switch (fun) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5683
	      case BITBLT_COPY:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5684
		printf("BITBLT_COPY\n");
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5685
		break;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5686
	      case BITBLT_COPYINVERTED:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5687
		printf("BITBLT_COPYINVERTED\n");
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5688
		break;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5689
	      case BITBLT_XOR:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5690
		printf("BITBLT_XOR\n");
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5691
		break;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5692
	      case BITBLT_AND:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5693
		printf("BITBLT_AND\n");
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5694
		break;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5695
	      case BITBLT_OR:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5696
		printf("BITBLT_OR\n");
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5697
		break;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5698
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5699
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5700
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5701
	    if (srcGcData->hWnd 
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5702
	     && ((srcGcData->hWnd == dstGcData->hWnd)
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5703
	     && (fun == BITBLT_COPY))) {
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5704
		RECT rec,upd;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5705
		RECT invRec;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5706
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5707
#ifdef CACHE_LAST_DC
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5708
		if (lastGcData) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5709
		    _releaseDC(lastGcData);     
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5710
		}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5711
#endif
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5712
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5713
		rec.left = __intVal(srcX);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5714
		rec.top = __intVal(srcY);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5715
		rec.right = rec.left + __intVal(w);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5716
		rec.bottom = rec.top + __intVal(h);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5717
		DPRINTF(("dst and src is HWND %x fun == BITBLT_COPY  --> scrolling %d %d\n",srcGcData->hWnd,__intVal(dstX) - __intVal(srcX),__intVal(dstY) - __intVal(srcY)));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5718
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5719
		ScrollWindowEx(srcGcData->hWnd,
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5720
			    __intVal(dstX) - __intVal(srcX),
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5721
			    __intVal(dstY) - __intVal(srcY),
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5722
			    &rec, 0,
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5723
			    0 /* rgnUpd */, &invRec, SW_ERASE | SW_INVALIDATE);
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5724
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5725
		enqEvent(ENQ_AT_FRONT, ExposureMask,srcGcData->hWnd, __WM_NOGEXPOSE, 0, 0, 0, 0, 0);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5726
#if 0
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5727
		if ((invRec.right >= invRec.left)
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5728
		 && (invRec.bottom >= invRec.top)) {
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5729
		    enqEvent(ENQ_AT_FRONT, ExposureMask,srcGcData->hWnd, __WM_GEXPOSE, 0, invRec.left, invRec.top, invRec.right-invRec.left, invRec.bottom-invRec.top);
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5730
		}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5731
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5732
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5733
#if 0
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5734
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5735
#ifdef DO_GEXPOSE
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5736
		UpdateWindow(srcGcData->hWnd);
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5737
#endif
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5738
		ScrollWindow(srcGcData->hWnd,
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5739
			    __intVal(dstX) - __intVal(srcX),
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5740
			    __intVal(dstY) - __intVal(srcY),
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5741
			    &rec, 0);
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5742
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5743
#ifdef DO_GEXPOSE
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5744
# ifdef OLD
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5745
		UpdateWindow(srcGcData->hWnd);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5746
		if (GetWindow_eventMask(srcGcData->hWnd) & ExposureMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5747
		    enqEvent(ENQ_AT_END, ExposureMask,srcGcData->hWnd, __WM_NOGEXPOSE, 0, 0, 0, 0, 0);
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5748
# else
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5749
		/* notice the reverse order ... */
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5750
		if (GetWindow_eventMask(srcGcData->hWnd) & ExposureMask)
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5751
		    enqEvent(ENQ_AT_FRONT, ExposureMask,srcGcData->hWnd, __WM_NOGEXPOSE, 0, 0, 0, 0, 0);
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5752
		if (GetUpdateRect(srcGcData->hWnd, &upd, FALSE)) {
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5753
		    if ((upd.right >= upd.left)
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5754
		     && (upd.bottom >= upd.top)) {
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5755
			if (GetWindow_eventMask(srcGcData->hWnd) & ExposureMask) {
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5756
			    enqEvent(ENQ_AT_FRONT, ExposureMask,srcGcData->hWnd, __WM_GEXPOSE, 0, upd.left, upd.top, upd.right-upd.left+1, upd.bottom-upd.top+1);
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5757
			}
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5758
		    }
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5759
		}
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5760
# endif
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5761
#else
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5762
		UpdateWindow(srcGcData->hWnd);
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5763
#endif
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5764
#endif /* 0 */
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  5765
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5766
		RETURN ( self );
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5767
	    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5768
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5769
#if 0
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5770
	    if (srcGcData->hWnd) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5771
		/*printf("src is HWND %x\n",srcGcData->hWnd);*/
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5772
	    }
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5773
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5774
	    fun = dstGcData->bitbltrop2;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5775
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5776
	    if ((srcGcData == dstGcData)
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5777
	     && (fun == BITBLT_COPY)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5778
		RECT rec, uprec;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5779
		int _srcX, _srcY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5780
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5781
		rec.left = _srcX = __intVal(srcX);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5782
		rec.top = _srcY = __intVal(srcY);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5783
		rec.right = rec.left + __intVal(w);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5784
		rec.bottom = rec.top + __intVal(h);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5785
		srcDC = _getDC(srcGcData);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5786
		DPRINTF(("dst and src is DC %x fun == BITBLT_COPY  --> scrolling %d %d\n",srcDC,__intVal(dstX) - __intVal(srcX),__intVal(dstY) - __intVal(srcY)));
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5787
		ScrollDC(srcDC,__intVal(dstX)-_srcX, __intVal(dstY)-_srcY, &rec, 0, 0, &uprec);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5788
#ifndef CACHE_LAST_DC
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5789
		_releaseDC(srcGcData);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5790
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5791
		RETURN ( self );
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5792
	    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5793
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5794
#ifdef CACHE_LAST_DC
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5795
/* mhmh - this should not be needed */
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5796
	    if (lastGcData) {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5797
		_releaseDC(lastGcData);     
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5798
	    }
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5799
#endif
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5800
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5801
	    dstDC = _getDC(dstGcData);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5802
#ifdef CACHE_LAST_DC
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5803
	    dstGcOwnerThreadID = lastGcOwnerThreadID;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5804
	    lastGcData = 0;  /* kludge - to avoid release in getDC below ... */
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5805
#endif
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5806
	    if (dstGcData == srcGcData) {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5807
		srcDC = dstDC;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5808
	    } else {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5809
		srcDC = _getDC(srcGcData);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5810
	    }
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5811
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  5812
	    DDPRINTF(("bitblt src f:%x b:%x",GetTextColor(srcDC),GetBkColor(srcDC)));
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  5813
	    DDPRINTF(("dst f:%x b:%x\n",GetTextColor(dstDC),GetBkColor(dstDC)));
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5814
	    if (BitBlt(dstDC,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5815
		 __intVal(dstX), __intVal(dstY),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5816
		 __intVal(w), __intVal(h),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5817
		 srcDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5818
		 __intVal(srcX), __intVal(srcY),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5819
		 fun)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5820
	       == 0
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5821
	      ) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5822
		fprintf(stderr, "WinWorkstation [info]: ERROR in BitBlt\n");
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5823
	    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5824
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5825
	    if (srcGcData != dstGcData) {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5826
		_releaseDC(srcGcData);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5827
	    }
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5828
#ifdef xxCACHE_LAST_DC
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5829
/* mhmh - this should not be needed */
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5830
	    lastGcData = dstGcData;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5831
	    lastGcOwnerThreadID = dstGcOwnerThreadID;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5832
#else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5833
	    _releaseDC(dstGcData);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5834
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5835
	    RETURN ( self );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5836
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5837
    }
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  5838
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5839
 fail: ;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5840
%}.
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5841
    self primitiveFailed.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5842
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5843
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5844
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5845
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
  5846
		width:w height:h
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5847
    "do a bit-blt, but only copy the low-bit plane;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5848
     copy bits from the rectangle defined by
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5849
     srcX/srcY and w/h from the sourceId drawable to the rectangle
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5850
     below dstX/dstY in the destId drawable. Trigger an error if any
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5851
     argument is not integer."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5852
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5853
    ^ self
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5854
	copyFromId:sourceId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5855
		 x:srcX y:srcY gc:srcDCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5856
		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
  5857
	     width:w height:h
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5858
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5859
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5860
displayArcX:x y:y width:width height:height from:startAngle angle:angle in:aDrawableId with:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5861
    "draw an arc. If any of x,y, w or h is not an integer, an error is triggered.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5862
     The angles may be floats or integer - they are given in degrees."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5863
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5864
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5865
    int __x, __y, w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5866
    float angle1, angle2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5867
    double f;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5868
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5869
    if (__isSmallInteger(startAngle))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5870
	angle1 = (float)(__intVal(startAngle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5871
    else if (__isFloat(startAngle)) {
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5872
	angle1 = (float) __floatVal(startAngle);
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5873
    } else if (__isShortFloat(startAngle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  5874
	angle1 = __shortFloatVal(startAngle);
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5875
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5876
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5877
    if (__isSmallInteger(angle))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5878
	angle2 = (float)(__intVal(angle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5879
    else if (__isFloat(angle)) {
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5880
	angle2 = (float) __floatVal(angle);
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5881
    } else if (__isShortFloat(angle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  5882
	angle2 = __shortFloatVal(angle);
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5883
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5884
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5885
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5886
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5887
     && __bothSmallInteger(x, y)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5888
     && __bothSmallInteger(width, height)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5889
     {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5890
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5891
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5892
	POINT p;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5893
	HPEN hPen;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5894
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5895
	w = __intVal(width);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5896
	h = __intVal(height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5897
	__x = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5898
	__y = __intVal(y);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5899
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5900
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5901
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5902
	if (!(hPen = GcDataGetPen(hDC, gcData))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5903
	    DPRINTF(("displayArc: no pen\n"));
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  5904
	} else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5905
	    double xB, yB, xE, yE, xR, yR;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5906
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5907
	    xR = w / 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5908
	    yR = h / 2;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5909
	    if (angle2 - angle1 >= 360) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5910
		xB = xE = __x + xR + 0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5911
		yB = yE = __y /*+ yR + 0.5*/;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5912
	    } else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5913
		double sin(), cos();
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5914
		float rad1, rad2;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5915
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5916
		if (angle1 <= 180)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5917
		  angle1 = 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5918
		else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5919
		  angle1 = 360 + 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5920
		angle2 = angle1 - angle2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5921
		/* sigh - compute the intersections ... */
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5922
		rad1 = (angle1 * 3.14159265359) / 180.0;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5923
		rad2 = (angle2 * 3.14159265359) / 180.0;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5924
		xB = cos(rad1) * xR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5925
		yB = sin(rad1) * yR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5926
		xE = cos(rad2) * xR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5927
		yE = sin(rad2) * yR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5928
		xB = __x + xR - xB + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5929
		yB = __y + yR - yB + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5930
		xE = __x + xR - xE + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  5931
		yE = __y + yR - yE + 0.5;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5932
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5933
	    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
  5934
	    Arc(hDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5935
		__x, __y,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5936
		__x + w, __y + h,
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5937
		(int)xB, (int)yB,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5938
		(int)xE, (int)yE);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5939
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  5940
	    GcDataReleasePen(hDC, gcData);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  5941
	}
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  5942
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5943
	_releaseDC(gcData);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  5944
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5945
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5946
    }
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5947
    bad: ;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5948
%}.
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5949
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5950
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5951
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5952
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
  5953
    "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
  5954
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5955
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5956
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5957
     /*&& __isExternalAddress(aDrawableId)*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5958
     && __bothSmallInteger(x0, y0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5959
     && __bothSmallInteger(x1, y1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5960
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5961
	int __x1 = __intVal(x1), __y1 = __intVal(y1);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5962
	HPEN hPen;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5963
	HDC hDC = _getDC(gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5964
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5965
/*      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
  5966
		    __intVal(x0), __intVal(y0),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5967
		    __x1, __y1,_HWNDVal(aDrawableId)));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5968
*/
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5969
	if (!(hPen = GcDataGetPen(hDC, gcData))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5970
	    DPRINTF(("displayLine: no pen\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5971
	} else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5972
	    MoveToEx(hDC, __intVal(x0), __intVal(y0), NULL);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5973
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5974
	    LineTo(hDC, __x1, __y1);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5975
	    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5976
	     * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5977
	     */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5978
	    LineTo(hDC, __x1+1, __y1);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  5979
	    GcDataReleasePen(hDC, gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5980
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5981
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5982
	_releaseDC(gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5983
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5984
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5985
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5986
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5987
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5988
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5989
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
  5990
    "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
  5991
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5992
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5993
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5994
     && __isExternalAddress(aDrawableId)
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5995
     && __bothSmallInteger(px, py)) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5996
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5997
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5998
	POINT p;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5999
	HPEN hPen;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6000
	int __x = __intVal(px), __y = __intVal(py);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6001
	int savedLStyle = gcData->lStyle;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6002
	int savedLWidth = gcData->lineWidth;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6003
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6004
	/*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6005
	 * a point is a point - no matter what lineWidth we have set before
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6006
	 */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6007
	if ((gcData->lStyle != PS_SOLID)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6008
	 || (gcData->lineWidth != 0)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6009
	    FLUSH_CACHED_DC(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6010
	    gcData->lStyle = PS_SOLID;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6011
	    gcData->lineWidth = 0;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6012
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6013
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6014
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6015
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6016
	if (!(hPen = GcDataGetPen(hDC,gcData))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6017
	    DPRINTF(("displayPoint: no pen\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6018
	} else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6019
	    MoveToEx(hDC, __x, __y, NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6020
	    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6021
	     * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6022
	     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6023
	    LineTo(hDC, __x+1, __y);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6024
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6025
	    GcDataReleasePen(hDC, gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6026
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6027
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6028
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6029
	_releaseDC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6030
#endif
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6031
	if ((gcData->lStyle != savedLStyle)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6032
	 || (gcData->lineWidth != savedLWidth)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6033
	    FLUSH_CACHED_DC(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6034
	    gcData->lStyle = savedLStyle;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6035
	    gcData->lineWidth = savedLWidth;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6036
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6037
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6038
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6039
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6040
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6041
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6042
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6043
displayPolygon:aPolygon in:aDrawableId with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6044
    "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
  6045
     which define the polygon.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6046
     If any coordinate is not integer, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6047
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6048
    |numberOfPoints|
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6049
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6050
    numberOfPoints := aPolygon size.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6051
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6052
%{
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6053
    OBJ point, px, py;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6054
    int i, num;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6055
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6056
    if (__isExternalAddress(aGCId)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6057
     && __isExternalAddress(aDrawableId)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6058
     && __isSmallInteger(numberOfPoints)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6059
	struct gcData *gcData = _GCDATA(aGCId);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6060
	HDC hDC = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6061
	POINT p;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6062
	HPEN hPen;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6063
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6064
	num = __intVal(numberOfPoints);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6065
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6066
	for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6067
	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6068
	    if (! __isPoint(point)) goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6069
	    px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6070
	    py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6071
	    if (! __bothSmallInteger(px, py)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6072
		goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6073
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6074
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6075
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6076
	hDC = _getDC(gcData);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6077
	if (!(hPen = GcDataGetPen(hDC,gcData))) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6078
	    DPRINTF(("displayPolygon: no pen\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6079
	} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6080
	    for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6081
		point = __AT_(aPolygon, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6082
		px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6083
		py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6084
		p.x = __intVal(px);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6085
		p.y = __intVal(py);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6086
		if (i == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6087
		    MoveToEx(hDC, p.x, p.y, NULL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6088
		} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6089
		    if (i == (num-1)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6090
			PolylineTo(hDC, &p, 1);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6091
		    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6092
			LineTo(hDC, p.x, p.y);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6093
			/*
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6094
			 * end-point ...
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6095
			 */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6096
			LineTo(hDC, p.x+1, p.y);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6097
		    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6098
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6099
	    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6100
	    GcDataReleasePen(hDC, gcData);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6101
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6102
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6103
#ifndef CACHE_LAST_DC
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6104
	_releaseDC(gcData);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6105
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6106
	RETURN ( self );
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6107
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6108
fail: ;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6109
%}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6110
!
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6111
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6112
displayPolylines:aPolyline in:aDrawableId with:aGCId
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6113
    "draw a polyline, the argument aPolyline is a collection of individual points,
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6114
     which define the lines (p1/p2 pairs); must be even in size.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6115
     If any coordinate is not integer, an error is triggered."
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6116
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6117
    |numberOfPoints|
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6118
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6119
    numberOfPoints := aPolyline size.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6120
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6121
%{
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6122
    OBJ point, px, py;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6123
    int i, num;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6124
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6125
    if (__isExternalAddress(aGCId)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6126
     && __isExternalAddress(aDrawableId)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6127
     && __isSmallInteger(numberOfPoints)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6128
	struct gcData *gcData = _GCDATA(aGCId);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6129
	HDC hDC = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6130
	POINT p;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6131
	HPEN hPen;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6132
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6133
	num = __intVal(numberOfPoints);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6134
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6135
	for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6136
	    point = __AT_(aPolyline, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6137
	    if (! __isPoint(point)) goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6138
	    px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6139
	    py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6140
	    if (! __bothSmallInteger(px, py)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6141
		goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6142
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6143
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6144
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6145
	hDC = _getDC(gcData);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6146
	if (!(hPen = GcDataGetPen(hDC,gcData))) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6147
	    DPRINTF(("displayPolygon: no pen\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6148
	} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6149
	    for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6150
		point = __AT_(aPolyline, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6151
		px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6152
		py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6153
		p.x = __intVal(px);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6154
		p.y = __intVal(py);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6155
		if ((i & 1) == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6156
		    MoveToEx(hDC, p.x, p.y, NULL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6157
		} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6158
		    LineTo(hDC, p.x, p.y);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6159
		    /*
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6160
		     * end-point ...
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6161
		     */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6162
		    LineTo(hDC, p.x+1, p.y);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6163
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6164
	    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6165
	    GcDataReleasePen(hDC, gcData);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6166
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6167
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6168
#ifndef CACHE_LAST_DC
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6169
	_releaseDC(gcData);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6170
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6171
	RETURN ( self );
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6172
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6173
fail: ;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6174
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6175
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6176
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6177
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
  6178
    "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
  6179
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6180
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6181
    int w, h;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6182
    int xL, yT;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6183
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6184
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6185
     && __bothSmallInteger(x, y)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6186
     && __bothSmallInteger(width, height)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6187
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6188
	HDC hDC = _getDC(gcData);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6189
	HPEN hPen;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6190
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6191
	xL = __intVal(x);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6192
	yT = __intVal(y);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6193
	w = __intVal(width);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6194
	h = __intVal(height);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6195
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6196
	DPRINTF(("displayRectangle: %d/%d -> %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6197
			xL, yT, w, h));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6198
	/*
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6199
	 * need this check here: some X-servers simply dump core with bad args
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6200
	 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6201
	if ((w >= 0) && (h >= 0)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6202
	    if (!(hPen = GcDataGetPen(hDC,gcData))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6203
		DPRINTF(("displayRect: no pen\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6204
	    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6205
		MoveToEx(hDC, xL, yT, NULL);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6206
		LineTo(hDC, xL+w-1, yT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6207
		LineTo(hDC, xL+w-1, yT+h-1);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6208
		LineTo(hDC, xL, yT+h-1);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6209
		LineTo(hDC, xL, yT);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6210
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6211
		GcDataReleasePen(hDC, gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6212
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6213
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6214
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6215
	_releaseDC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6216
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6217
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6218
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6219
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6220
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6221
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6222
displayString:aString from:index1 to:index2 x:x y:y in:aDrawableId with:aGCId opaque:opaque
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6223
    "draw a sub-string - if opaque is false, draw foreground only; otherwise, draw both
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6224
     foreground and background characters.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6225
     If the coordinates are not integers, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6226
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6227
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6228
    unsigned char *cp;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6229
    OBJ cls;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6230
    int  i1, i2, l, n;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6231
#   define NLOCALBUFFER 200
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6232
    short xlatebuffer[NLOCALBUFFER];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6233
    int nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6234
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6235
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6236
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6237
     && __isNonNilObject(aString)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6238
     && __bothSmallInteger(index1, index2)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6239
     && __bothSmallInteger(x, y)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6240
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6241
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6242
	int pX, pY;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6243
	HDC hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6244
	HFONT hOldFont;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6245
	pX = __intVal(x);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6246
	pY = __intVal(y);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6247
	pY -= gcData->fontAscent;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6248
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6249
	cls = __qClass(aString);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6250
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6251
	i1 = __intVal(index1) - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6252
	if (i1 >= 0) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6253
	    i2 = __intVal(index2) - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6254
	    if (i2 < i1) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6255
		goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6256
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6257
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6258
	    cp = _stringVal(aString);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6259
	    l = i2 - i1 + 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6260
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6261
	    if ((cls == @global(String)) || (cls == @global(Symbol))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6262
		n = _stringSize(aString);
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6263
		if (i2 < n) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6264
		    cp += i1;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  6265
		    DDPRINTF(("string1: %s pos=%d/%d l=%d hDC=%x hWnd=%x\n", cp, pX, pY,l,hDC,_HWNDVal(aDrawableId)));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6266
		    if (opaque == true) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6267
			SetBkMode(hDC, OPAQUE);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6268
		    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6269
			SetBkMode(hDC, TRANSPARENT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6270
		    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6271
		    hOldFont = SelectObject(hDC, gcData->hFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6272
		    SetTextColor(hDC, gcData->fgColor);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6273
		    SetBkColor(hDC, gcData->bgColor);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6274
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6275
		    if (!TextOut(hDC, pX, pY, (char *)cp, l)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6276
		       PRINTF(("Textout failed. %d\n",GetLastError()));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6277
		    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6278
		    SelectObject(hDC, hOldFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6279
		    goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6280
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6281
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6282
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6283
	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6284
	    cp += nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6285
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6286
	    if (__isBytes(aString)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6287
		n = __byteArraySize(aString) - nInstBytes - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6288
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6289
		if (i2 < n) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6290
		    cp += i1;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  6291
		    DDPRINTF(("string: %s pos=%d/%d\n", cp, pX, pY));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6292
		    if (opaque == true) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6293
			SetBkMode(hDC, OPAQUE);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6294
		    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6295
			SetBkMode(hDC, TRANSPARENT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6296
		    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6297
		    hOldFont = SelectObject(hDC, gcData->hFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6298
		    SetTextColor(hDC, gcData->fgColor);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6299
		    SetBkColor(hDC, gcData->bgColor);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6300
		    TextOut(hDC, pX, pY, (char *)cp, l);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6301
		    SelectObject(hDC, hOldFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6302
		    goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6303
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6304
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6305
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6306
#ifdef NOTDEF 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6307
	    /* TWOBYTESTRINGS */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6308
	    if (__isWords(aString)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6309
		n = (__byteArraySize(aString) - nInstBytes) / 2;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6310
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6311
		if (i2 < n) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6312
		    union {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6313
			char b[2];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6314
			unsigned short s;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6315
		    } u;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6316
		    int i;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6317
		    XChar2b *cp2 = (XChar2b *)0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6318
		    int mustFree = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6319
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6320
		    cp += (i1 * 2);
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6321
# if 0
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6322
		    /*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6323
		     * ST/X TwoByteStrings store the asciiValue in native byteOrder;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6324
		     * X expects them MSB first
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6325
		     * convert as required
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6326
		     */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6327
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6328
		    u.s = 0x1234;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6329
		    if (u.b[0] != 0x12) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6330
			if (l <= NLOCALBUFFER) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6331
			    cp2 = xlatebuffer;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6332
			} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6333
			    cp2 = (XChar2b *)(malloc(l * 2));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6334
			    mustFree = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6335
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6336
			for (i=0; i<l; i++) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6337
			    cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6338
			    cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6339
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6340
			cp = (char *) cp2;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6341
		    }
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6342
# endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6343
		    if (opaque == true)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6344
			XDrawImageString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6345
		    else
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6346
			XDrawString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6347
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6348
		    if (mustFree) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6349
			free(cp2);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6350
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6351
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6352
		    goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6353
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6354
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6355
#endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6356
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6357
ret:   
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6358
	_releaseDC(gcData); 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6359
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6360
#undef NLOCALBUFFER
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6361
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6362
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6363
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6364
drawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6365
			  width:imageWidth height:imageHeight
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6366
			      x:srcx y:srcy
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6367
			   into:aDrawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6368
			      x:dstx y:dsty
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6369
			  width:w height:h
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6370
			   with:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6371
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6372
    "draw a bitImage which has depth id, width iw and height ih into
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6373
     the drawable. draw a region of w/h pixels from srcx/srcy to dstx/dsty.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6374
     Individual source pixels have bitsPerPixel bits, allowing to draw
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6375
     depth and pixel-units to be different.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6376
     It has to be checked elsewhere, that the server can do it with the given
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6377
     depth - otherwise, primitive failure will be signalled.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6378
     Also it is assumed, that the colormap is setup correctly and the
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6379
     colors are allocated - otherwise the colors may be wrong."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6380
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6381
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6382
     sorry; I had to separate it into 2 methods, since XPutImage needs
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6383
     an unlimited stack, and thus cannot send primitiveFailed
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6384
    "
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6385
    (self primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6386
					width:imageWidth height:imageHeight
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6387
					     x:srcx y:srcy
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6388
					  into:aDrawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6389
					     x:dstx y:dsty
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6390
					 width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6391
					  with:aGCId)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6392
    ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6393
	"
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6394
	 also happens, if a segmentation violation occurs in the
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6395
	 XPutImage ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6396
	"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6397
	self primitiveFailed
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6398
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6399
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6400
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6401
fillArcX:x y:y width:width height:height from:startAngle angle:angle
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6402
	       in:aDrawableId with:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6403
    "fill an arc. If any coordinate is not integer, an error is triggered.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6404
     The angles may be floats or integer - they are given in degrees."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6405
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6406
%{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6407
    int __x, __y, w, h;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6408
    float angle1, angle2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6409
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6410
    if (__isSmallInteger(startAngle))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6411
	angle1 = (float)(__intVal(startAngle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6412
    else if (__isFloat(startAngle)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6413
	angle1 = __floatVal(startAngle);
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6414
    } else if (__isShortFloat(startAngle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  6415
	angle1 = __shortFloatVal(startAngle);
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6416
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6417
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6418
    if (__isSmallInteger(angle))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6419
	angle2 = (float)(__intVal(angle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6420
    else if (__isFloat(angle)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6421
	angle2 = __floatVal(angle);
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6422
    } else if (__isShortFloat(angle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  6423
	angle2 = __shortFloatVal(angle);
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6424
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6425
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6426
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6427
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6428
     && __bothSmallInteger(x, y)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6429
     && __bothSmallInteger(width, height)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6430
     {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6431
	struct gcData *gcData = _GCDATA(aGCId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6432
	HDC hDC;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6433
	HBRUSH hBrush;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6434
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6435
	w = __intVal(width);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6436
	h = __intVal(height);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6437
	__x = __intVal(x);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6438
	__y = __intVal(y);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6439
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6440
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6441
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6442
	if (!(hBrush = GcDataGetBrush(hDC,gcData))) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6443
	    DPRINTF(("fillArc: no brush\n"));
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6444
	} else {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6445
	  HBRUSH hSaveBrush = SelectObject(hDC, hBrush);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6446
	  HPEN hPen = 0;
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6447
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6448
	  if (__isWinNT) {
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6449
	      if (!(hPen = GcDataGetPen(hDC,gcData))) {
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  6450
		  DPRINTF(("displayArc: no pen\n"));
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  6451
		  goto failpen;
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6452
	      }
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6453
	  } else {
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6454
	      SelectObject(hDC, GetStockObject(NULL_PEN));
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6455
	      w++;
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6456
	      h++;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6457
	  }
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6458
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6459
	  {
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6460
	      double xB, yB, xE, yE, xR, yR;
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6461
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6462
	      xR = w / 2;
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6463
	      yR = h / 2;
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6464
	      if (angle2 - angle1 >= 360) {
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6465
		  xB = xE = __x + xR + 0.5;
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6466
		  yB = yE = __y /*+ yR + 0.5*/;
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6467
	      } else {
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6468
		  double sin(), cos();
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6469
		  float rad1, rad2;
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6470
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6471
		  if (angle1 <= 180)
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6472
		      angle1 = 180 - angle1;
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6473
		  else
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6474
		      angle1 = 360 + 180 - angle1;
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6475
		  angle2 = angle1 - angle2;
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6476
		  /* sigh - compute the intersections ... */
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6477
		  rad1 = (angle1 * 3.14159265359) / 180.0;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6478
		  rad2 = (angle2 * 3.14159265359) / 180.0;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6479
		  xB = cos(rad1) * xR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6480
		  yB = sin(rad1) * yR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6481
		  xE = cos(rad2) * xR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6482
		  yE = sin(rad2) * yR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6483
		  xB = __x + xR - xB + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6484
		  yB = __y + yR - yB + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6485
		  xE = __x + xR - xE + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6486
		  yE = __y + yR - yE + 0.5;
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6487
	      }
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6488
	      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));
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6489
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6490
	      Pie(hDC,
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6491
		  __x, __y,
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6492
		  __x + w, __y + h,
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6493
		  (int)xB, (int)yB,
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6494
		  (int)xE, (int)yE);
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6495
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6496
	      if (hPen) {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6497
		  GcDataReleasePen(hDC, gcData);
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6498
	      }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6499
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6500
failpen:
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6501
	  SelectObject(hDC,hSaveBrush);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6502
	  _DeleteObject(hBrush); gcData->hBrush = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6503
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6504
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6505
	_releaseDC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6506
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6507
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6508
    }
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6509
    bad: ;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6510
%}.
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6511
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6512
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6513
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6514
fillPolygon:aPolygon in:aDrawableId with:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6515
    "fill a polygon given by its points.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6516
     If any coordinate is not integer, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6517
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6518
    |numberOfPoints|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6519
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6520
    numberOfPoints := aPolygon size.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6521
    self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6522
	primFillPolygon:aPolygon n:numberOfPoints 
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6523
	in:aDrawableId with:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6524
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6525
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6526
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
  6527
    "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
  6528
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6529
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6530
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6531
    int w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6532
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6533
     && __isExternalAddress(aDrawableId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6534
     && __bothSmallInteger(x, y)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6535
     && __bothSmallInteger(width, height)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6536
	w = __intVal(width);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6537
	h = __intVal(height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6538
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6539
	if ((w >= 0) && (h >= 0)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6540
	    struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6541
	    HDC hDC;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6542
	    HBRUSH hBrush;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6543
	    RECT rct;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6544
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6545
	    hDC = _getDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6546
	    hBrush = GcDataGetBrush(hDC,gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6547
	    if (! hBrush) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6548
		PRINTF(("fillRectangle: no brush\n"));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6549
	    } else {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6550
		HBRUSH hSaveBrush;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6551
		HPEN hSavePen;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6552
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6553
		rct.left = __intVal(x);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6554
		rct.top = __intVal(y);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6555
		rct.right = rct.left + w + 1;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6556
		rct.bottom = rct.top + h + 1;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6557
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6558
		DDPRINTF(("fillRectangle:%d.%d -> %d.%d\n",rct.left,rct.top,rct.right,rct.bottom));
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6559
		hSaveBrush = SelectObject(hDC, hBrush);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6560
		hSavePen = SelectObject(hDC, GetStockObject(NULL_PEN));
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6561
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6562
		Rectangle(hDC, rct.left, rct.top, rct.right, rct.bottom);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6563
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6564
		SelectObject(hDC, hSaveBrush);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6565
		_DeleteObject(hBrush); gcData->hBrush = 0;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6566
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6567
		SelectObject(hDC, hSavePen);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6568
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6569
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6570
	    _releaseDC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6571
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6572
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6573
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6574
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6575
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6576
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6577
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6578
primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6579
			      width:imageWidth height:imageHeight
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6580
				  x:srcx y:srcy
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6581
			       into:aDrawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6582
				  x:dstx y:dsty
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6583
			      width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6584
			       with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6585
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6586
    "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
  6587
     (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
  6588
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6589
%{  /* xxLIMITEDSTACK */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6590
    unsigned char fastBits[10000];
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6591
    unsigned char *b_bits = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6592
    unsigned char *allocatedBits = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6593
    struct gcData *gcData = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6594
    HDC hDC = (HDC)0;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6595
    unsigned char *__imageBits = 0;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6596
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6597
    if (__isByteArray(imageBits)) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6598
	__imageBits = __ByteArrayInstPtr(imageBits)->ba_element;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6599
    } else if (__isExternalBytes(imageBits)) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6600
	__imageBits = (unsigned char *)(__externalBytesAddress(imageBits));
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6601
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6602
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6603
    if (ISCONNECTED
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6604
     && __isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6605
     && __isExternalAddress(aDrawableId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6606
     && __bothSmallInteger(srcx, srcy)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6607
     && __bothSmallInteger(dstx, dsty)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6608
     && __bothSmallInteger(w, h)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6609
     && __bothSmallInteger(imageWidth, imageHeight)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6610
     && __bothSmallInteger(imageDepth, bitsPerPixel)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6611
     && __isSmallInteger(padd)
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6612
     && __imageBits)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6613
     {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6614
	struct
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6615
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6616
	  BITMAPINFOHEADER bmiHeader;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6617
	  DWORD r;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6618
	  DWORD g;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6619
	  DWORD b;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6620
	} bitmap;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6621
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6622
	gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6623
	if (! gcData )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6624
	    goto fail;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6625
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6626
	DDPRINTF(("hDC = %x\n", hDC));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6627
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6628
	if (__intVal(padd) != WIN32PADDING) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6629
	    int row, col;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6630
	    unsigned char *cp;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6631
	    unsigned char *pBits;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6632
	    int b_width, b_height, bytesPerRowST, bytesPerRowWN, padding, nBytes;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6633
	    int bi = __intVal(bitsPerPixel);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6634
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6635
	    b_width = __intVal(w);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6636
	    b_height = __intVal(h);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6637
	    bytesPerRowST = (b_width * bi + (__intVal(padd)-1)) / __intVal(padd);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6638
	    bytesPerRowWN = (b_width * bi + (WIN32PADDING-1)) / WIN32PADDING * (WIN32PADDING/8);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6639
	    padding = bytesPerRowWN - bytesPerRowST;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6640
	    nBytes = b_height * bytesPerRowWN;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6641
	    /*printf("padd %d bs %d bw %d p %d\n",__intVal(padd),bytesPerRowST,bytesPerRowWN,padding);*/
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6642
	    if (padding) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6643
		if (nBytes < sizeof(fastBits)) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6644
		    cp = b_bits = fastBits;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6645
		} else {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6646
		    cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6647
		}
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6648
		if (cp) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6649
		    pBits = __imageBits;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6650
		    for (row = b_height; row; row--) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6651
			for (col = bytesPerRowST; col; col--) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6652
			    *cp++ = *pBits++;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6653
			}
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6654
			cp += padding;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6655
		    }
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6656
		} else
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6657
		    goto fail;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6658
	    }
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6659
	}
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6660
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6661
	if (b_bits == 0) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6662
	    b_bits = __imageBits;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6663
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6664
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6665
	bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6666
	bitmap.bmiHeader.biPlanes = 1;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6667
	if (__intVal(imageDepth) == 24) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6668
	    /*bitmap.bmiHeader.biCompression = BI_BITFIELDS;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6669
	    bitmap.r = 0xff0000;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6670
	    bitmap.g = 0x00ff00;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6671
	    bitmap.b = 0x0000ff;*/
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6672
	    bitmap.bmiHeader.biCompression = BI_RGB;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6673
	} else if (__intVal(imageDepth) == 16) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6674
	    /*bitmap.bmiHeader.biCompression = BI_RGB;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6675
	    bitmap.bmiHeader.biCompression = BI_BITFIELDS;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6676
	    bitmap.b = 0x001f;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6677
	    bitmap.g = 0x07e0;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6678
	    bitmap.r = 0xf800;*/
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6679
	    bitmap.b = 0;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6680
	    bitmap.g = 0;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6681
	    bitmap.r = 0;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6682
	    bitmap.bmiHeader.biCompression = BI_RGB;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6683
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6684
	bitmap.bmiHeader.biSizeImage = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6685
	bitmap.bmiHeader.biXPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6686
	bitmap.bmiHeader.biYPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6687
	bitmap.bmiHeader.biClrUsed = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6688
	bitmap.bmiHeader.biClrImportant = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6689
	bitmap.bmiHeader.biWidth = __intVal(imageWidth);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6690
	bitmap.bmiHeader.biHeight = -(__intVal(imageHeight));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6691
	bitmap.bmiHeader.biBitCount = __intVal(bitsPerPixel);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6692
	/*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
  6693
	SetDIBitsToDevice(hDC,__intVal(dstx),__intVal(dsty),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6694
			      __intVal(w), __intVal(h),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6695
			      __intVal(srcx), __intVal(srcy),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6696
			      0,__intVal(h),
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6697
			      (void *)b_bits,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6698
			      (BITMAPINFO*)&bitmap,DIB_RGB_COLORS);
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6699
	if (allocatedBits) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6700
	    free(allocatedBits);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6701
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6702
	_releaseDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6703
	RETURN ( true );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6704
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6705
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6706
fail: ;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6707
    PRINTF(("create temp bitmap FAILED!!!\n"));
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6708
    if (allocatedBits) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6709
	PRINTF(("freeing up temp bitmap bits ...\n"));
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  6710
	free(allocatedBits);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6711
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6712
    if (gcData && hDC) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6713
	_releaseDC(gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6714
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6715
%}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6716
.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6717
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6718
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6719
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6720
primFillPolygon:aPolygon n:numberOfPoints in:aDrawableId with:aGCId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6721
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6722
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6723
    OBJ point, px, py;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6724
    int i, num;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6725
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6726
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6727
     && __isExternalAddress(aDrawableId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6728
     && __isSmallInteger(numberOfPoints)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6729
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6730
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6731
	POINT p;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6732
	HBRUSH hBrush;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6733
        
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6734
	num = __intVal(numberOfPoints);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6735
	if (num < 3) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6736
	    RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6737
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6738
	for (i=0; i<num; i++) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6739
	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6740
	    if (! __isPoint(point)) goto fail;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6741
	    px = _point_X(point);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6742
	    py = _point_Y(point);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6743
	    if (! __bothSmallInteger(px, py))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6744
		goto fail;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6745
	}
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6746
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6747
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6748
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6749
	if (!(hBrush = GcDataGetBrush(hDC,gcData))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6750
	    DPRINTF(("fillPolygon: no brush\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6751
	} else {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6752
	    HBRUSH hSaveBrush = SelectObject(hDC, hBrush);
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6753
	    BeginPath(hDC);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6754
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6755
	    for (i=0; i<num; i++) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6756
		point = __AT_(aPolygon, __MKSMALLINT(i+1));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6757
		px = _point_X(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6758
		py = _point_Y(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6759
		if (i == 0) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6760
		    MoveToEx(hDC, __intVal(px), __intVal(py), NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6761
		} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6762
		    if (i == (num-1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6763
			p.x = __intVal(px);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6764
			p.y = __intVal(py);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6765
			PolylineTo(hDC, &p, 1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6766
		    } else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6767
			LineTo(hDC, __intVal(px), __intVal(py));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6768
		    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6769
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6770
	    }
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6771
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6772
	    EndPath(hDC);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6773
	    FillPath(hDC);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6774
	    SelectObject(hDC,hSaveBrush);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6775
	    _DeleteObject(hBrush); gcData->hBrush = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6776
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6777
	_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6778
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6779
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6780
fail: ;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6781
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6782
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6783
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6784
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6785
!WinWorkstation methodsFor:'event forwarding'!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6786
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6787
activate:aBoolean view:aView
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6788
    "some view was activated/deactivated.
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6789
     For compatibility we send a focus-event to that topView"
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6790
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6791
    aBoolean ifFalse:[
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6792
	activeView := nil.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6793
	self focusOutView:aView.
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6794
    ] ifTrue:[
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6795
	activeView := aView.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6796
	self focusInView:aView.
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6797
    ].
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6798
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6799
    "Created: / 28.4.1999 / 14:51:51 / cg"
2599
9c0749ee47ed #activate:view: via sensor
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  6800
    "Modified: / 28.4.1999 / 15:07:09 / cg"
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6801
!
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6802
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6803
displayChange
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6804
    "the display metrics/settings have changed.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6805
     This is a speciality of windows.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6806
     TODO: Tell the viewStyle to update itself,
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6807
	   and tell all views to reinit their style.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6808
     For now,this is ignored, except for updating my metrics."
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6809
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6810
    self initializeVariableScreenProperties.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6811
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6812
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6813
fontChange
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6814
    "the system fonts (users preferences) have changed.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6815
     This is a speciality of windows.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6816
     TODO: Tell the viewStyle to update itself,
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6817
	   and tell all views to reinit their style.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6818
     For now,this is ignored."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6819
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6820
    IgnoreFontChanges ~~ true ifTrue:[
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6821
	'WinWorkstation [info]: fontChange ignored for now.' infoPrintCR
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6822
    ]
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6823
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6824
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6825
queryEndSession
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6826
    "system is about to be shut down.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6827
     This is a speciality of windows.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6828
     TODO: Tell all views to close themself.
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6829
     For now, this is ignored."
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6830
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6831
    'WinWorkstation [info]: queryEndSession ignored for now.' infoPrintCR.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6832
    ^ true
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6833
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6834
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  6835
systemColorChange:aWindow
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6836
    "the system colors (users preferences) have changed.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6837
     This is a speciality of windows.
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6838
     Tell the viewStyle to update itself,
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6839
     and tell all view to reinit its style."
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  6840
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  6841
"/    'WinWorkstation [info]: systemColorChange for ' infoPrint.
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  6842
"/    aWindow printCR.
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  6843
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6844
    IgnoreSysColorChanges ~~ true ifTrue:[
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6845
	"/ TODO: this should go through the sensor ...
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6846
	"/ ...and handled as an event by the views thread.
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6847
	View updateAllStyleCaches.
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6848
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6849
	aWindow withAllSubViewsDo:[:aView |
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6850
	    aView reinitStyle
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6851
	]
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  6852
    ]
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  6853
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  6854
    "Modified: / 10.9.1998 / 21:53:34 / cg"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6855
! !
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6856
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6857
!WinWorkstation methodsFor:'event handling'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6858
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6859
XXconfigEventProcessedFor:aWindowId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6860
%{
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6861
    if (__isExternalAddress(aWindowId)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6862
	HWND hWnd = _HWNDVal(aWindowId);
2000
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
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6865
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6866
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6867
dispatchEventFor:aViewIdOrNil withMask:eventMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6868
    "central event handling method:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6869
     get next event and send appropriate message to the sensor or view.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6870
     If the argument aViewIdOrNil is nil, events for any view are processed,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6871
     otherwise only events for the view with given id are processed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6872
     If the argument aMask is nonNil, only events for this eventMask are
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6873
     handled.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6874
     WARNING: this may block to wait for an event - you better check for a
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6875
	      pending event before calling this."
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6876
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6877
    (self getEventFor:aViewIdOrNil withMask:eventMask) ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6878
	AbortSignal handle:[:ex |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6879
	    ex return
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6880
	] do:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6881
	    self dispatchLastEvent.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6882
	]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6883
    ].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6884
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6885
    "Modified: 19.8.1997 / 17:10:42 / cg"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6886
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6887
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6888
dispatchExposeEventFor:aViewIdOrNil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6889
    "get next expose event and send appropriate message to the sensor or view.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6890
     If the argument aViewIdOrNil is nil, events for any view are processed,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6891
     otherwise only events for the view with given id are processed."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6892
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6893
    self dispatchEventFor:aViewIdOrNil withMask:(self eventMaskFor:#expose)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6894
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6895
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6896
dispatchLastEvent
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6897
    |theView symS arg butt sibling windowID siblingID propertyID selectionID targetID requestorID
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6898
     eventType|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6899
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6900
%{  /* xxSTACK: 8000 */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6901
    struct queuedEvent *ev = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6902
    struct queuedEvent _ev_buf;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6903
    struct inlineCache *ipS;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6904
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6905
    static struct inlineCache vid = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6906
    static struct inlineCache conf = _ILC5;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6907
    static struct inlineCache skp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6908
    static struct inlineCache skr = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6909
    static struct inlineCache exp = _ILC5;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6910
    static struct inlineCache gexpS = _ILC6;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6911
    static struct inlineCache nexpS = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6912
    static struct inlineCache clr = _ILC5;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6913
    static struct inlineCache bp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6914
    static struct inlineCache br = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6915
    static struct inlineCache bmp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6916
    static struct inlineCache bsp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6917
    static struct inlineCache mot = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6918
    static struct inlineCache unmap = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6919
    static struct inlineCache map = _ILC1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6920
    static struct inlineCache termS = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6921
    static struct inlineCache destr = _ILC1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6922
    static struct inlineCache setCurs = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6923
    static struct inlineCache focOut = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6924
    static struct inlineCache focIn = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6925
    static struct inlineCache act = _ILC2;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6926
    static struct inlineCache pe = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6927
    static struct inlineCache pl = _ILC2;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6928
    static struct inlineCache vis = _ILC1;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  6929
    static struct inlineCache sysClrChg = _ILC1;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6930
    static struct inlineCache fontChg = _ILC0;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6931
    static struct inlineCache qEndSess = _ILC0;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6932
    static struct inlineCache powerDown = _ILC0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6933
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6934
    int x, y, w, h;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6935
    int keyCode, modifiers, isDoubleClick = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6936
    int isDown = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6937
    int state;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6938
    OBJ upDown;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6939
    OBJ eB;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6940
    char nameBuffer[100];
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6941
    HWND hWnd = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6942
    DDPRINTF(("dispatchLast\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6943
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6944
    eB = __INST(eventBuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6945
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6946
    if (__isByteArray(eB)) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6947
	ev = (struct queuedEvent *)(__ByteArrayInstPtr(eB)->ba_element);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6948
    } else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6949
	fprintf(stderr, "WinWorkstation [error]: no eventBuffer\n");
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6950
	RETURN (false);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6951
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6952
    if (ev) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6953
	_ev_buf = *ev;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6954
	ev = &_ev_buf;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6955
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6956
    hWnd = ev->ev_hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6957
    if (!(hWnd /*&& IsWindow(hWnd)*/)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6958
	DPRINTF(("wrong hWnd in event in dispatchLastEvent\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6959
	RETURN (false);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6960
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6961
    {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6962
	OBJ t;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6963
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6964
	/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6965
	 * 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
  6966
	 * avoid creation & lookup then.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6967
	 */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6968
#if 1
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6969
	if ((t = __INST(lastId)) != nil) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6970
	    if (__isExternalAddress(t)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6971
		if (_HWNDVal(t) == hWnd) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6972
		    theView = __INST(lastView);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6973
		    if (__isNonNilObject(theView)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6974
			if (__qClass(theView) == nil) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6975
			    theView = nil;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6976
			}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6977
		    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6978
		}
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
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6981
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6982
	if (theView == nil) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6983
	    windowID = __MKOBJ(ev->ev_hWnd);
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6984
	    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
  6985
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6986
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6987
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6988
    if (theView == nil) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6989
	DPRINTF(("nil view [hWnd=%x] in dispatchEvent\n", ev->ev_hWnd));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6990
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6991
	RETURN (false);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6992
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6993
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6994
    switch (ev->ev_message) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6995
	    case WM_WINDOWPOSCHANGED:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6996
		{
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  6997
		    RECT rct;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  6998
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  6999
		    DPRINTF((">>> WM_WINDOWPOSCHANGED -> configureX:y:width:height:view:\n"));
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7000
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7001
		    x = ev->ev_x;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7002
		    y = ev->ev_y;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7003
		    w = ev->ev_w;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7004
		    h = ev->ev_h;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7005
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7006
		    /*printf(">>> WM_WINDOWPOSCHANGED -> configureX:%d y:%d width:%d height: %d\n",x,y,w,h);*/
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7007
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7008
		    (*conf.ilc_func)(self,
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7009
				 @symbol(configureX:y:width:height:view:),
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7010
				 nil, &conf,
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7011
				 __MKSMALLINT(x),
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7012
				 __MKSMALLINT(y),
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7013
				 __MKSMALLINT(w),
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7014
				 __MKSMALLINT(h),
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7015
				 theView);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7016
		}
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7017
		break;
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7018
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7019
	    case WM_DROPFILES:
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7020
		{
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7021
		  int i;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7022
		  char buf[MAXPATH];
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7023
		  HDROP hDrop = (HDROP)ev->ev_wParam;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7024
		  int count = DragQueryFile(hDrop,0xffffffff,0,0);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7025
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7026
		  PRINTF((">>> WM_DROPFILES %d Files\n",count));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7027
		  for (i = 0;i < count;i++) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7028
		      DragQueryFile(hDrop,i,buf,sizeof(buf));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7029
		      PRINTF(("Filename:%s\n",buf));
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7030
		  }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7031
		  DragFinish(hDrop);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7032
		}
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7033
		break;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7034
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7035
	    case WM_SHOWWINDOW:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7036
		if (ev->ev_wParam == TRUE) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7037
		    DPRINTF((">>> WM_SHOWWINDOW -> mappedView:\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7038
		    arg = @symbol(unobscured);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7039
		    (*vis.ilc_func)(theView, @symbol(visibilityChange:), nil, &vis, arg);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7040
		    (*map.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7041
				     @symbol(mappedView:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7042
				     nil, &map, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7043
		} else {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7044
		    DPRINTF((">>> WM_SHOWWINDOW -> unMappedView:\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7045
		    arg = @symbol(fullyObscured);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7046
		    (*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
  7047
		    (*unmap.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7048
				       @symbol(unmappedView:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7049
				       nil, &unmap, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7050
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7051
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7052
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7053
	    case WM_CLOSE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7054
		    (*termS.ilc_func)(self,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7055
				      @symbol(terminateView:), nil, &termS, theView);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7056
		    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7057
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7058
	    case WM_DESTROY:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7059
		DPRINTF((">>> WM_DESTROY -> destroyedView\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7060
		(*destr.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7061
				   @symbol(destroyedView:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7062
				   nil, &destr, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7063
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7064
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7065
	    case WM_ACTIVATE:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7066
		DPRINTF((">>> WM_ACTIVATE h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7067
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7068
		switch (LOWORD(ev->ev_wParam)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7069
		    case WA_INACTIVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7070
			(*act.ilc_func)(self,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7071
					@symbol(activate:view:),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7072
					nil,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7073
					&act,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7074
					false,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7075
					theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7076
			break;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7077
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7078
		    case WA_ACTIVE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7079
		    case WA_CLICKACTIVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7080
			(*act.ilc_func)(self,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7081
					@symbol(activate:view:),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7082
					nil,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7083
					&act,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7084
					true,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7085
					theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7086
			break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7087
		    default:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7088
			break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7089
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7090
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7091
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7092
	    case WM_MOUSEACTIVATE:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7093
		DPRINTF((">>> WM_MOUSEACTIVATE h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7094
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7095
		(*focIn.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7096
				   @symbol(focusInView:),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7097
				   nil,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7098
				   &focIn,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7099
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7100
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7101
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7102
	    case WM_SETFOCUS:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7103
		DPRINTF((">>> WM_SETFOCUS h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7104
		(*focIn.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7105
				   @symbol(focusInView:),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7106
				   nil,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7107
				   &focIn,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7108
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7109
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7110
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7111
	    case WM_KILLFOCUS:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7112
		DPRINTF((">>> WM_KILLFOCUS h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7113
		(*focOut.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7114
				   @symbol(focusOutView:),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7115
				   nil,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7116
				   &focOut,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7117
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7118
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7119
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7120
	    case __WM_GEXPOSE:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7121
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7122
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7123
		w = ev->ev_w;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7124
		h = ev->ev_h;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7125
		(*gexpS.ilc_func)(self,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7126
			 @symbol(graphicsExposeX:y:width:height:final:view:), nil, &gexpS,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7127
			 __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7128
			 __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7129
			 __MKSMALLINT(w),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7130
			 __MKSMALLINT(h),
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7131
			 true,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7132
			 theView);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7133
		break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7134
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7135
	    case __WM_NOGEXPOSE:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7136
		 (*nexpS.ilc_func)(self,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7137
			 @symbol(noExposeView:), nil, &nexpS,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7138
			 theView);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7139
		break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7140
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7141
	    case WM_PAINT:
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  7142
		x = ev->ev_x;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  7143
		y = ev->ev_y;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  7144
		w = ev->ev_w;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  7145
		h = ev->ev_h;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  7146
#ifdef LATE_PAINT
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  7147
		{
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7148
		    RECT rec;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7149
		    HDC dc = (HDC)GetDC(ev->ev_hWnd);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7150
		    HBRUSH br = CreateSolidBrush(st2RGB(GetWindow_bgBrush(ev->ev_hWnd),0));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7151
		    if (br) {
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  7152
			rec.left = x;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  7153
			rec.top = y;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  7154
			rec.right = x + w - 1;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  7155
			rec.bottom = y + h - 1;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7156
			// printf("erase %d %d %d %d\n",rec.left,rec.top,rec.right,rec.bottom);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7157
			SelectClipRgn(dc,0);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7158
			FillRect(dc, &rec, br);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  7159
			_DeleteObject(br);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7160
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7161
		    ReleaseDC(ev->ev_hWnd,dc);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  7162
		}
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  7163
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7164
		/*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
  7165
	    /*expose:*/
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7166
		DPRINTF((">>> WM_PAINT -> expose %d/%d -> %d/%d\n", x, y, w, h));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7167
		(*exp.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7168
			 @symbol(exposeX:y:width:height:view:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7169
			 nil, &exp,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7170
			 __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7171
			 __MKSMALLINT(y),
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  7172
			 __MKSMALLINT(w),
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  7173
			 __MKSMALLINT(h),
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7174
			 theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7175
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7176
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7177
	    case WM_LBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7178
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7179
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7180
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7181
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7182
	    case WM_LBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7183
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7184
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7185
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7186
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7187
	    case WM_LBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7188
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7189
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7190
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7191
	    case WM_MBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7192
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7193
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7194
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7195
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7196
	    case WM_MBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7197
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7198
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7199
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7200
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7201
	    case WM_MBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7202
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7203
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7204
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7205
	    case WM_RBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7206
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7207
		butt = __MKSMALLINT(Button3);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7208
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7209
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7210
	    case WM_RBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7211
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7212
		butt = __MKSMALLINT(Button3);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7213
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7214
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7215
	    case WM_RBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7216
		butt = __MKSMALLINT(Button3);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7217
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7218
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7219
	    commonButtonDown:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7220
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7221
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7222
		modifiers = ev->ev_modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7223
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7224
		if (__INST(buttonTranslation) != nil) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7225
		    butt = __AT_(__INST(buttonTranslation), butt);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7226
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7227
		arg = butt;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7228
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7229
		__INST(altDown) = (modifiers & AltMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7230
		__INST(metaDown) = (modifiers & MetaMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7231
		__INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7232
		__INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7233
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7234
		if (isDoubleClick) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7235
		    multiClickState = 1;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7236
		    nextMultiClickTime = lastMSGTime + multiClickTime;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7237
		    ipS = &bmp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7238
		    symS = @symbol(buttonMultiPress:x:y:view:);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7239
		} else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7240
		    if (isDown) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7241
			if (multiClickState && (lastMSGTime < nextMultiClickTime)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7242
			    nextMultiClickTime = lastMSGTime + multiClickTime;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7243
			    ipS = &bmp;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7244
			    symS = @symbol(buttonMultiPress:x:y:view:);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7245
			} else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7246
			    multiClickState = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7247
			    ipS = &bp;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7248
			    symS = @symbol(buttonPress:x:y:view:);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7249
			}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7250
		    } else {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7251
			ipS = &br;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7252
			symS = @symbol(buttonRelease:x:y:view:);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7253
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7254
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7255
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7256
		if (__isSymbol(arg)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7257
		    DPRINTF(("buttonPress/buttonRelease: %s %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7258
				__stringVal(arg), x, y));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7259
		} else {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7260
		    DPRINTF(("buttonPress/buttonRelease: %d %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7261
				__intVal(arg), x, y));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7262
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7263
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7264
		(*(*ipS).ilc_func)(self, symS, nil, ipS,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7265
				   arg,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7266
				   __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7267
				   __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7268
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7269
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7270
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7271
	    case __WM_MOUSEENTER:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7272
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7273
		y = ev->ev_y;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7274
		state = ev->ev_modifiers;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7275
		DPRINTF((">>> WM_MOUSEENTER: %d/%d %x\n", x, y, state));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7276
		(*pe.ilc_func)(self, @symbol(pointerEnter:x:y:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7277
				    nil, &pe,
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7278
				    __MKSMALLINT(state),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7279
				    __MKSMALLINT(x),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7280
				    __MKSMALLINT(y),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7281
				    theView);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7282
		break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7283
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7284
	    case __WM_MOUSELEAVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7285
		state = ev->ev_modifiers;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7286
		DPRINTF((">>> WM_MOUSELEAVE: %d/%d %x\n", x, y, state));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7287
		(*pl.ilc_func)(self, @symbol(pointerLeave:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7288
				    nil, &pl,
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7289
				    __MKSMALLINT(state),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7290
				    theView);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7291
		break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7292
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7293
	    case WM_MOUSEMOVE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7294
		x = ev->ev_x;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7295
		y = ev->ev_y;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7296
		state = ev->ev_modifiers;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7297
		DPRINTF((">>> WM_MOUSEMOVE: %d/%d %x\n", x, y, state));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7298
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7299
		(*mot.ilc_func)(self, @symbol(buttonMotion:x:y:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7300
				    nil, &mot,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7301
				    __MKSMALLINT(state),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7302
				    __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7303
				    __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7304
				    theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7305
		break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7306
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7307
	    case WM_CHAR:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7308
		DPRINTF((">>> WM_CHAR: %d/%d\n", x, y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7309
		symS = @symbol(keyPress:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7310
		ipS = &skp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7311
		upDown = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7312
		goto keyPressAndRelease;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7313
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7314
	    case WM_SYSKEYUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7315
	    case WM_KEYUP:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7316
		DPRINTF((">>> WM_KEYUP / SYSKEYUP: %d/%d\n", x, y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7317
		symS = @symbol(keyRelease:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7318
		ipS = &skr;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7319
		upDown = false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7320
		goto keyPressAndRelease;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7321
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7322
	    case WM_SYSKEYDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7323
	    case WM_KEYDOWN:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7324
#ifdef DEBUG
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7325
		if (ev->ev_keyCode == 0x11)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7326
		  c_count = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7327
#endif
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7328
		DPRINTF((">>> WM_KEYDOWN / SYSKEYDOWN: %d/%d\n", x, y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7329
		symS = @symbol(keyPress:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7330
		ipS = &skp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7331
		upDown = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7332
		/* FALL INTO */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7333
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7334
	    keyPressAndRelease: ;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7335
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7336
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7337
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7338
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7339
#ifdef NOTDEF
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7340
		{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7341
		    BYTE vKeyState[256];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7342
		    char buff[5];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7343
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7344
		    GetKeyboardState(vKeyState);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7345
		    ToAscii(ev->ev_keyCode, ev->ev_scanCode, vKeyState, &buff; 0);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7346
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7347
#endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7348
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7349
		keyCode = ev->ev_keyCode;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7350
		modifiers = ev->ev_modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7351
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7352
		if (modifiers & TRANSLATED_KEY) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7353
		    if (modifiers & ControlMask) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7354
			if (keyCode < 0x20) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7355
			    keyCode = keyCode + 'a' - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7356
			    if (modifiers & ShiftMask) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7357
				keyCode = keyCode - 'a' + 'A';
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7358
			    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7359
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7360
		    } else if (modifiers & (MetaMask | AltMask)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7361
			if (! (modifiers & ShiftMask)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7362
			    if ((keyCode >= 'A') && (keyCode <= 'Z')) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7363
				keyCode = keyCode - 'A' + 'a';
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7364
			    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7365
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7366
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7367
		    arg = __MKCHARACTER(keyCode & 0xFF);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7368
		} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7369
		    switch (keyCode) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7370
			case VK_F1:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7371
			    arg = @symbol(F1);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7372
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7373
			case VK_F2:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7374
			    arg = @symbol(F2);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7375
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7376
			case VK_F3:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7377
			    arg = @symbol(F3);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7378
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7379
			case VK_F4:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7380
			    arg = @symbol(F4);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7381
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7382
			case VK_F5:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7383
			    arg = @symbol(F5);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7384
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7385
			case VK_F6:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7386
			    arg = @symbol(F6);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7387
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7388
			case VK_F7:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7389
			    arg = @symbol(F7);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7390
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7391
			case VK_F8:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7392
			    arg = @symbol(F8);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7393
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7394
			case VK_F9:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7395
			    arg = @symbol(F9);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7396
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7397
			case VK_F10:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7398
			    arg = @symbol(F10);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7399
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7400
			case VK_F11:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7401
			    arg = @symbol(F11);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7402
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7403
			case VK_F12:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7404
			    arg = @symbol(F12);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7405
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7406
			case VK_PRIOR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7407
			    arg = @symbol(Prior);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7408
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7409
			case VK_NEXT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7410
			    arg = @symbol(Next);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7411
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7412
			case VK_END:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7413
			    arg = @symbol(End);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7414
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7415
			case VK_HOME:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7416
			    arg = @symbol(Home);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7417
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7418
			case VK_LEFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7419
			    arg = @symbol(CursorLeft);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7420
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7421
			case VK_RIGHT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7422
			    arg = @symbol(CursorRight);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7423
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7424
			case VK_UP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7425
			    arg = @symbol(CursorUp);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7426
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7427
			case VK_DOWN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7428
			    arg = @symbol(CursorDown);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7429
			    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7430
			case VK_MENU:  /*alt key with w95 ???*/
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7431
			    arg = @symbol(Menu);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7432
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7433
			case VK_LMENU:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7434
			    arg = @symbol(Menu_L);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7435
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7436
			case VK_RMENU:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7437
			    arg = @symbol(Menu_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7438
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7439
			case VK_PAUSE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7440
			    arg = @symbol(Pause);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7441
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7442
			case VK_HELP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7443
			    arg = @symbol(Help);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7444
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7445
			case VK_EXECUTE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7446
			    arg = @symbol(Execute);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7447
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7448
			case VK_CANCEL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7449
			    arg = @symbol(Cancel);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7450
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7451
			case VK_SELECT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7452
			    arg = @symbol(Select);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7453
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7454
			case VK_PRINT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7455
			    arg = @symbol(Print);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7456
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7457
			case VK_SNAPSHOT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7458
			    arg = @symbol(Snapshot);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7459
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7460
			case VK_INSERT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7461
			    arg = @symbol(Insert);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7462
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7463
			case VK_DELETE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7464
			    arg = @symbol(Delete);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7465
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7466
			case VK_BACK:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7467
			    arg = @symbol(BackSpace);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7468
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7469
			case VK_LWIN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7470
			    arg = @symbol(Win_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7471
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7472
			case VK_RWIN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7473
			    arg = @symbol(Win_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7474
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7475
			case VK_APPS:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7476
			    arg = @symbol(Appl);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7477
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7478
			case VK_NUMPAD0:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7479
			    arg = @symbol(KeyPad0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7480
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7481
			case VK_NUMPAD1:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7482
			    arg = @symbol(KeyPad1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7483
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7484
			case VK_NUMPAD2:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7485
			    arg = @symbol(KeyPad2);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7486
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7487
			case VK_NUMPAD3:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7488
			    arg = @symbol(KeyPad3);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7489
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7490
			case VK_NUMPAD4:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7491
			    arg = @symbol(KeyPad4);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7492
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7493
			case VK_NUMPAD5:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7494
			    arg = @symbol(KeyPad5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7495
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7496
			case VK_NUMPAD6:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7497
			    arg = @symbol(KeyPad6);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7498
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7499
			case VK_NUMPAD7:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7500
			    arg = @symbol(KeyPad7);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7501
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7502
			case VK_NUMPAD8:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7503
			    arg = @symbol(KeyPad8);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7504
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7505
			case VK_NUMPAD9:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7506
			    arg = @symbol(KeyPad9);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7507
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7508
			case VK_LSHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7509
			    arg = @symbol(Shift_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7510
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7511
			case VK_RSHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7512
			    arg = @symbol(Shift_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7513
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7514
			case VK_LCONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7515
			    arg = @symbol(Ctrl_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7516
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7517
			case VK_RCONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7518
			    arg = @symbol(Ctrl_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7519
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7520
			case VK_CONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7521
			    arg = @symbol(Ctrl);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7522
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7523
			case VK_SHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7524
			    arg = @symbol(Shift);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7525
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7526
			case VK_TAB:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7527
			    arg = @symbol(Tab);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7528
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7529
			case VK_ESCAPE:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7530
			    arg = @symbol(Escape);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7531
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7532
			case VK_NUMLOCK:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7533
			    arg = @symbol(NumLock);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7534
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7535
			case VK_SCROLL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7536
			    arg = @symbol(ScrollLock);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7537
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7538
			case VK_RETURN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7539
			    arg = @symbol(Return);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7540
			    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7541
			default:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7542
			    nameBuffer[0] = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7543
			    /*GetKeyNameText(ev->ev_scanCode, nameBuffer, sizeof(nameBuffer));*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7544
			    DPRINTF(("char is <%d>\n", keyCode));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7545
			    arg = __MKCHARACTER(keyCode & 0xFF);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7546
			    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7547
		    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7548
		 }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7549
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7550
		DPRINTF(("%s: code=%x mod=%x\n", __stringVal(symS),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7551
				keyCode, modifiers));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7552
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7553
		__INST(altDown) = (modifiers & AltMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7554
		__INST(metaDown) = (modifiers & MetaMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7555
		__INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7556
		__INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7557
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7558
		(*(*ipS).ilc_func)(self, symS, nil, ipS,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7559
				   arg,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7560
				   __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7561
				   __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7562
				   theView);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7563
		break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7564
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7565
	   case WM_SYSCOLORCHANGE:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7566
		DPRINTF((">>> WM_SYSCOLORCHANGE\n"));
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  7567
		(*sysClrChg.ilc_func)(self, @symbol(systemColorChange:), nil, &sysClrChg, theView);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7568
		break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7569
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7570
	   case WM_FONTCHANGE:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7571
		DPRINTF((">>> WM_FONTCHANGE\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7572
		(*fontChg.ilc_func)(self, @symbol(fontChange), nil, &fontChg);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7573
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7574
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7575
	   case WM_DISPLAYCHANGE:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7576
		DPRINTF((">>> WM_DISPLAYCHANGE\n"));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7577
		(*fontChg.ilc_func)(self, @symbol(displayChange), nil, &fontChg);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7578
		break;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7579
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7580
	   case WM_QUERYENDSESSION:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7581
		DPRINTF((">>> WM_QUERYENDSESSION\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7582
		(*qEndSess.ilc_func)(self, @symbol(queryEndSession), nil, &qEndSess);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7583
		break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7584
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7585
#ifdef LATER
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7586
	   case WM_POWER:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7587
		DPRINTF((">>> WM_POWER\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7588
		(*power.ilc_func)(self, @symbol(powerDown), nil, &power);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7589
	       break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7590
#endif
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7591
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7592
	    default:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7593
		UNHANDLED_EVENT_PRINTF(("WinWorkstat [info]: >>> unhandled event: %x\n", ev->ev_message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7594
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7595
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7596
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7597
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7598
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7599
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7600
dispatchPendingEvents
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7601
    "central event handling method for modal operation.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7602
     (i.e. this is now only used in the modal debugger)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7603
     Dispatch any pending events; return when no more are pending.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7604
     This code is somewhat special, since X has a concept of graphic
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7605
     expose events (which are sent after a bitblt). After such a bitblt,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7606
     we only handle exposes until the graphicsExpose arrives.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7607
     Other systems may not need such a kludge"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7608
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7609
    "interested in exposes only ?"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7610
    dispatchingExpose notNil ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7611
	[self exposeEventPendingFor:dispatchingExpose withSync:false] whileTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7612
	    self dispatchExposeEventFor:dispatchingExpose
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7613
	].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7614
	^ self
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7615
    ].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7616
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7617
    [self eventPendingWithSync:false] whileTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7618
	(self getEventFor:nil withMask:nil) ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7619
	    AbortSignal handle:[:ex |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7620
		ex return
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7621
	    ] do:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7622
		self dispatchLastEvent
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7623
	    ]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7624
	].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7625
    ]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7626
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7627
    "Modified: 19.8.1997 / 17:11:18 / cg"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7628
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7629
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7630
disposeEventsWithMask:aMask for:aWindowIdOrNil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7631
    "dispose (throw away) specific events. If aWindowId is nil,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7632
     events matching the mask are thrown away regardless of which
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7633
     view they are for. Otherwise, only matching events for that
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7634
     view are flushed."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7635
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7636
%{  /* NOCONTEXT */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  7637
   PRINTF(("WinWorkstation: disposeEventsWithMask:for: not yet implemented.\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7638
   RETURN ( self );
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  7639
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7640
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7641
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7642
eventMaskFor:anEventSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7643
    "return the eventMask bit-constant corresponding to an event symbol"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7644
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7645
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7646
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7647
    int m = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7648
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7649
    if (anEventSymbol == @symbol(keyPress)) m = KeyPressMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7650
    else if (anEventSymbol == @symbol(keyRelease)) m = KeyReleaseMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7651
    else if (anEventSymbol == @symbol(buttonPress)) m = ButtonPressMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7652
    else if (anEventSymbol == @symbol(buttonRelease)) m = ButtonReleaseMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7653
    else if (anEventSymbol == @symbol(buttonMotion)) m = ButtonMotionMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7654
    else if (anEventSymbol == @symbol(pointerMotion)) m = PointerMotionMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7655
    else if (anEventSymbol == @symbol(expose)) m = ExposureMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7656
    else if (anEventSymbol == @symbol(focusChange)) m = FocusChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7657
    else if (anEventSymbol == @symbol(enter)) m = EnterWindowMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7658
    else if (anEventSymbol == @symbol(leave)) m = LeaveWindowMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7659
    else if (anEventSymbol == @symbol(keymapState)) m = KeymapStateMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7660
    else if (anEventSymbol == @symbol(visibilityChange)) m = VisibilityChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7661
    else if (anEventSymbol == @symbol(structureNotify)) m = StructureNotifyMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7662
    else if (anEventSymbol == @symbol(resizeRedirect)) m = ResizeRedirectMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7663
    else if (anEventSymbol == @symbol(propertyChange)) m = PropertyChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7664
    else if (anEventSymbol == @symbol(colormapChange)) m = ColormapChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7665
    RETURN (__MKSMALLINT(m));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7666
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7667
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7668
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7669
eventPending
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7670
    "return true, if any event is pending.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7671
     This looks for both the internal queue and the display connection."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7672
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7673
    ConservativeSyncing == true ifTrue:[self sync].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7674
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7675
    dispatchingExpose notNil ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7676
	^ self exposeEventPendingFor:dispatchingExpose withSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7677
    ].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7678
    ^ self eventPendingWithSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7679
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7680
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7681
eventPending:anEventSymbol for:aWindowIdOrNil
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7682
    "return true, if a specific event is pending"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7683
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7684
    ^ self eventsPending:(self eventMaskFor:anEventSymbol) for:aWindowIdOrNil withSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7685
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7686
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7687
eventPendingWithSync:doSync
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7688
    "return true, if any event is pending.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7689
     The doSync argument is ignored here - in windows, all drawing is synchronous."
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7690
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7691
    doSync notNil ifTrue:[self flush].
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7692
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7693
%{  /* xxLIMITEDSTACK (WIN95 only) */
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7694
    if (__INST(inRecursiveDispatch) != true) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7695
	if (hasEventQueued()) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7696
	    RETURN (true);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7697
	}
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7698
    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7699
%}.
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7700
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7701
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7702
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7703
eventQueued
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7704
    "return true, if any event is queued"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7705
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7706
    ^ self eventQueuedAlready
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7707
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7708
    "Created: 12.12.1995 / 21:43:00 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7709
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7710
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7711
eventQueuedAlready
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7712
    "return true, if any event is queued internally.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7713
     (i.e. in X's internal event queue, which is both filled by explicit
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7714
      nextEvent calls AND whenever drawing is done and events are pending on
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7715
      the display connection)."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7716
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7717
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7718
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7719
    DDPRINTF(("peek q - "));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7720
    if (hasEventQueued()) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7721
	DDPRINTF(("true\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7722
	RETURN (true);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7723
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7724
    DDPRINTF(("false\n"));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7725
%}.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7726
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7727
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7728
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7729
eventsPending:anEventMask for:aWindowIdOrNil withSync:doSync
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7730
    "return true, if any of the masked events is pending.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7731
     The doSync argument is ignored here - in windows, all drawing is synchronous."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7732
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7733
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7734
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7735
    DPRINTF(("eventsPending mask %x - not implemented\n", __intVal(anEventMask)));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7736
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7737
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7738
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7739
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7740
exposeEventPendingFor:aWindowIdOrNil withSync:doSync
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7741
    "return true, if any expose event is pending for a specific view,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7742
     or any view (if the arg is nil).
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7743
     This is an X specific interface - not used on windows (scrolling is synchronous)"
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7744
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7745
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7746
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7747
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7748
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7749
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7750
getEventFor:aViewIdOrNil withMask:eventMask
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7751
    "read next event - put into local eventBuffer.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7752
     If aViewIdOrNil is nil, events for any view are fetched;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7753
     otherwise only events for that specific view will be fetched.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7754
     Returns true, if there was an event, false otherwise."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7755
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7756
%{  /* xxLIMITEDSTACK */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7757
    HWND win, wWanted;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7758
    int evMask;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7759
    OBJ eB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7760
    struct queuedEvent *ev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7761
    struct queuedEvent *qev;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7762
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7763
    eB = __INST(eventBuffer);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7764
    if (! __isByteArray(eB)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7765
	fprintf(stderr, "WinWorkstation [error]: no eventBuffer\n");
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7766
	/* RETURN (false); */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7767
    } else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7768
	ev = (struct queuedEvent *)(__ByteArrayInstPtr(eB)->ba_element);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7769
	ev->ev_message = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7770
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7771
	if (__isSmallInteger(eventMask)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7772
	    evMask = __intVal(eventMask);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7773
	} else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7774
	    evMask = ~0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7775
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7776
	if (__isExternalAddress(aViewIdOrNil)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7777
	    wWanted = _HWNDVal(aViewIdOrNil);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7778
	} else{
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7779
	    wWanted = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7780
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7781
	if (deqEvent(ev, wWanted, evMask)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7782
	    RETURN ( true );
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7783
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7784
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7785
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7786
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7787
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7788
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7789
handleAllEvents
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7790
    "from now on, handle any kind of event"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7791
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7792
    dispatchingExpose := nil
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7793
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7794
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7795
handleExposeOnlyFor:aView
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7796
    "from now on, handle expose events only"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7797
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  7798
    "/ dispatchingExpose := aView id
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  7799
    'handleExposeOnlyFor: not yet implemented' printCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7800
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7801
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7802
mappingChanged:what event:eB
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7803
    "One of Keyboard-, Modifier- or PointerMap has change, probably by xmodmap.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7804
     Tell xlib about the fact."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7805
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7806
    (what == #mappingKeyboard or:[what == #mappingModifier]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7807
	self refreshKeyboardMapping:eB.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7808
	"Maybe some of our modifiers have been changed"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7809
	self initializeModifierMappings.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7810
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7811
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7812
    "Created: 1.12.1995 / 16:28:23 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7813
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7814
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7815
setEventMask:aMask in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7816
    "tell X that we are only interested in events from aMask, which
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7817
     is the bitwise or of the eventMask bits (see 'eventMaskFor:')"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7818
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7819
%{  /* NOCONTEXT */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7820
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7821
    if (__isExternalAddress(aWindowId)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7822
	&& __isSmallInteger(aMask))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7823
    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7824
	HWND hWnd = _HWNDVal(aWindowId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7825
	int mask = __intVal(aMask);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7826
	if (GETLOCALWINDOWINFOPTR(hWnd))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7827
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7828
	  DPRINTF(("new eventMask %x\n",mask));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7829
#ifdef DEBUGMASK
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7830
	  PRINTF(("new eventMask %x\n",mask));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7831
	  printMask(mask);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7832
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7833
	  GETLOCALWINDOWINFOPTR(hWnd)->eventMask = mask;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7834
	  RETURN ( self );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7835
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7836
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7837
%}.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7838
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7839
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7840
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7841
!WinWorkstation methodsFor:'event sending'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7842
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7843
sendKeyOrButtonEvent:typeSymbol x:xPos y:yPos keyOrButton:keySymCodeOrButtonNr state:stateMask toViewId:targetId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7844
    "send a keyPress/Release or buttonPress/Release event to some (possibly alien) view.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7845
     TypeSymbol must be one of: #keyPress, #keyRelease, #buttonPress , #buttonRelease.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7846
     For buttonEvents, the keySymCodeOrButtonNr must be the buttons number (1, 2 ...);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7847
     for key events, it can be either a symbol (as listen in X's keySyms)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7848
     or a numeric keysym code. If state is nil, the modifier bits (shift & control)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7849
     are computed from the keyboardMap - if non-nil, these are passed as modifierbits.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7850
     The non-nil case is the lowlevel entry, where state must include any shift/ctrl information
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7851
     (not very user friendly)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7852
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7853
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7854
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7855
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7856
simulateKeyboardInput:aCharacterOrString inViewId:viewId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7857
    "send input to some other view, by simulating keyPress/keyRelease
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7858
     events.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7859
     Only a few control characters are supported.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7860
     Notice: not all alien views allow this kind of synthetic input;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7861
	     some simply ignore it."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7862
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7863
    |control code state|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7864
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7865
    aCharacterOrString isString ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7866
	aCharacterOrString do:[:char |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7867
	    self simulateKeyboardInput:char inViewId:viewId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7868
	].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7869
	^ self
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7870
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7871
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7872
    control := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7873
    code := aCharacterOrString asciiValue.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7874
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7875
    (aCharacterOrString == Character cr) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7876
	code := #Return
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7877
    ] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7878
	(aCharacterOrString == Character tab) ifTrue:[
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7879
	    code := #Tab
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7880
	] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7881
	    (aCharacterOrString == Character esc) ifTrue:[
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7882
		code := #Escape
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7883
	    ]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7884
	]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7885
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7886
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7887
    control ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7888
	state := self controlMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7889
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7890
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7891
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7892
    "/ the stuff below should not be needed 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7893
    "/ (sendKeyOrButtonevent should be able to figure out things itself)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7894
    "/ however, on some linux systems it seems to not work correctly.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7895
    "/ Hopefully, this is correct ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7896
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7897
    code isNumber ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7898
	code >= $A asciiValue ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7899
	    code <= $Z asciiValue ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7900
		state := self shiftMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7901
	    ]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7902
	]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7903
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7904
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7905
    self sendKeyOrButtonEvent:#keyPress x:0 y:0 keyOrButton:code state:state toViewId:viewId.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7906
    self sendKeyOrButtonEvent:#keyRelease x:0 y:0 keyOrButton:code state:state toViewId:viewId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7907
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7908
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7909
      sending input to some (possibly alien) view:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7910
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7911
      |point id|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7912
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7913
      point :=  Display pointFromUser.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7914
      id := Display viewIdFromPoint:point.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7915
      Display simulateKeyboardInput:'Hello_world' inViewId:id
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7916
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7917
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7918
    "Modified: 11.6.1996 / 10:59:42 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7919
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7920
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7921
!WinWorkstation methodsFor:'font stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7922
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7923
createFontFor:aFontName
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7924
    "a basic method for font allocation; this method allows
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7925
     any font to be aquired (even those not conforming to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7926
     standard naming conventions, such as cursor, fixed or k14)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7927
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7928
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7929
    HGDIOBJ hFont;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7930
    char *fn;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7931
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7932
    if (__isString(aFontName)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7933
	fn = __stringVal(aFontName);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7934
	if (strcmp(fn, "fixed") == 0) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7935
	    hFont = GetStockObject(ANSI_FIXED_FONT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7936
	} else if (strcmp(fn, "variable") == 0) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7937
	    hFont = GetStockObject(ANSI_VAR_FONT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7938
	} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7939
	    hFont = GetStockObject(ANSI_FIXED_FONT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7940
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7941
	if (hFont) {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7942
	    DPRINTF(("createFontFor:aFontName: %s -> %x\n", fn, hFont));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7943
	    RETURN ( __MKOBJ(hFont) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7944
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7945
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7946
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7947
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7948
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7949
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7950
fontMetricsOf:fontId into:aBlock
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7951
    "evaluate aBlock, passing a fonts metrics as arguments"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7952
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7953
    |data|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7954
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7955
    data := Array new:10.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7956
    (self primFontMetricsOf:fontId intoArray:data) isNil ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7957
	self primitiveFailed.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7958
	^ self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7959
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7960
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7961
    aBlock value:#iso8859
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7962
	   value:(data at:1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7963
	   value:(data at:2)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7964
	   value:(data at:3)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7965
	   value:(data at:4)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7966
	   value:(data at:5)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7967
	   value:(data at:6)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7968
	   value:(data at:7)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7969
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7970
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7971
fontsInFamily:aFamilyName face:aFaceName filtering:filter
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7972
    "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
  7973
     On WinWorkStations there is curently Face
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7974
     But only thise matching filter (if nonNil)."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7975
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7976
    |allFonts fonts|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7977
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7978
    allFonts := self listOfAvailableFonts.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7979
    allFonts isNil ifTrue:[^ nil].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7980
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7981
    fonts := Set new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7982
    allFonts do:[:fntDescr |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7983
	(aFamilyName sameAs:(fntDescr family)) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7984
	    (filter isNil or:[filter value:fntDescr]) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7985
		fonts add:fntDescr
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7986
	    ]
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7987
	]
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7988
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7989
    ^ fonts
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7990
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7991
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7992
fontsInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7993
    "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
  7994
     on this display.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7995
     On WinWorkStations there is curently no style or Face
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7996
     But only those matching filter (if nonNIl)."
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7997
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7998
    |allFonts fonts|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7999
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8000
    allFonts := self listOfAvailableFonts.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8001
    allFonts isNil ifTrue:[^ nil].
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8002
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8003
    fonts := Set new.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8004
    allFonts do:[:fntDescr |
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8005
	(aFamilyName sameAs:(fntDescr family)) ifTrue:[
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8006
	    (filter isNil or:[filter value:fntDescr]) ifTrue:[
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8007
		fonts add:fntDescr
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8008
	    ]
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8009
	]
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8010
    ].
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8011
    ^ fonts
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8012
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8013
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8014
fullNameOf:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8015
    "the fonts fullName - this is very device specific and should only be
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8016
     used for user feed-back (for example: in the fontPanel).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8017
     If the display/font do not provide that info, return nil."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8018
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8019
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8020
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8021
getAvailableFontsMatching:pattern
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8022
    "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
  8023
    self halt.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8024
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8025
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8026
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8027
getDefaultFont
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8028
    "return a default font id - used when class Font cannot
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8029
     find anything usable"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8030
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8031
     ^ self createFontFor:'fixed'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8032
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8033
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8034
getFontWithFamily:familyString face:faceString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8035
	    style:styleArgString size:sizeArg encoding:encodingSym
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8036
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8037
    "try to get the specified font, if not available, try next smaller
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8038
     font. Access to X-fonts by name is possible, by passing the X font name
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8039
     as family and the other parameters as nil. For example, the cursor font
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8040
     can be aquired that way."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8041
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8042
    |styleString theName theId xlatedStyle id spacing|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8043
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8044
    styleString := styleArgString.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8045
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8046
    "special: if face is nil, allow access to X-fonts"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8047
    faceString isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8048
	sizeArg notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8049
	    theName := familyString , '-' , sizeArg printString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8050
	] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8051
	    theName := familyString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8052
	].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8053
	theName isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8054
	    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8055
	     mhmh - fall back to the default font
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8056
	    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8057
	    theName := 'fixed'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8058
	].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8059
	theId := self createFontFor:theName.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8060
	theId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8061
	    theId := self getDefaultFont
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8062
	].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8063
	^ theId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8064
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8065
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8066
    "/ spacing other than 'normal' is contained as last component
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8067
    "/ in style
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8068
    styleString notNil ifTrue:[
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8069
	((styleString endsWith:'-narrow')
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8070
	 or:[styleString endsWith:'-semicondensed']) ifTrue:[
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8071
	    |i|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8072
	    i := styleString lastIndexOf:$-.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8073
	    spacing := styleString copyFrom:(i+1).
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8074
	    styleString := styleString copyTo:(i-1).
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8075
	] ifFalse:[
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8076
	    spacing := 'normal'.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8077
	].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8078
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8079
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8080
    xlatedStyle := styleString.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8081
    xlatedStyle notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8082
	xlatedStyle := xlatedStyle first asString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8083
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8084
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8085
    id := self
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8086
	    getFontWithFoundry:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8087
	    family:familyString asLowercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8088
	    weight:faceString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8089
	    slant:xlatedStyle
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8090
	    spacing:spacing
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8091
	    pixelSize:nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8092
	    size:sizeArg
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8093
	    registry:encodingSym
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8094
	    encoding:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8095
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8096
    id isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8097
	(encodingSym notNil and:[encodingSym ~= '*']) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8098
	    "/ too stupid: encodings come in both cases
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8099
	    "/ and X does not ignore case
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8100
	    "/
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8101
	    id := self
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8102
		    getFontWithFoundry:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8103
		    family:familyString asLowercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8104
		    weight:faceString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8105
		    slant:xlatedStyle
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8106
		    spacing:spacing
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8107
		    pixelSize:nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8108
		    size:sizeArg
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8109
		    registry:encodingSym asUppercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8110
		    encoding:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8111
	    id isNil ifTrue:[
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8112
		id := self
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8113
			getFontWithFoundry:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8114
			family:familyString asLowercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8115
			weight:faceString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8116
			slant:xlatedStyle
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8117
			spacing:spacing
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8118
			pixelSize:nil
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8119
			size:sizeArg
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8120
			registry:encodingSym asLowercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8121
			encoding:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8122
	    ]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8123
	]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8124
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8125
    ^ id
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8126
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8127
    "Modified: 24.2.1996 / 22:37:24 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8128
    "Modified: 4.7.1996 / 11:38:47 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8129
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8130
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8131
getFontWithFoundry:foundry family:family weight:weight
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8132
	      slant:slant spacing:spc pixelSize:pSize size:size
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8133
	      registry:registry encoding:encoding
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8134
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8135
    "get the specified font, if not available, return nil.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8136
     This is the new font creation method - all others will be changed to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8137
     use this entry.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8138
     Individual attributes can be left empty (i.e. '') or nil to match any.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8139
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8140
     foundry: 'adobe', 'misc', 'dec', 'schumacher' ... usually '*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8141
     family:  'helvetica' 'courier' 'times' ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8142
     weight:  'bold' 'medium' 'demi' ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8143
     slant:   'r(oman)' 'i(talic)' 'o(blique)'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8144
     spacing: 'narrow' 'normal' semicondensed' ... usually '*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8145
     pixelSize: 16,18 ... usually left empty
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8146
     size:      size in point (1/72th of an inch)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8147
     registry:  iso8859, sgi ... '*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8148
     encoding:  vendor specific encoding (usually '*')
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8149
    "
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8150
    "
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8151
	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
  8152
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8153
		nHeight
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8154
		nWidth
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8155
		nEscapement
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8156
		nOrientation
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8157
		fnWeight        FW_DONTCARE, FW_NORMAL, FW_MEDIUM, FW_BOLD, ...
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8158
		fdwItalic       TRUE or FALSE
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8159
		fdwUnderline    TRUE or FALSE
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8160
		fdwStrikeOut    TRUE or FALSE
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8161
		fdwCharSet      ANSI_CHARSET, UNICODE_, SYMBOL_, SHIFTJIS_,...
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8162
		fdwOutputPrecision      DEFAULT, STRING, CHAR, ...
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8163
		fdwClipPrecision        DEFAULT, CHAR, STROKE, MASK, ...
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8164
		fdwQuality      DEFAULT, DRAFT, or PROOF.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8165
		fdwPitchAndFamily
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8166
			DEFAULT, FIXED or VARIABLE pitch
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8167
			DECORATIVE, DONTCASE, MODERN, ROMAN, SCRIPT, or SWISS.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8168
		lpszFace
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8169
			Typeface Name
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8170
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8171
	These two above descriptions will be matched as follows:
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8172
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8173
		foundry - ignored
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8174
		family  - mapped to type face name.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8175
		weight  - mapped to fnWeight
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8176
		slant   - NOT USED INITIALLY  user for style
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8177
		spacing - NOT USED INITIALLY
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8178
		pixelSize - NOT USED INITIALLY
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8179
		size      - mapped to nHeight
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8180
		registry  - NOT USED INITIALLY
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8181
		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
  8182
	"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8183
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8184
%{  /* xxLIMITEDSTACK (WIN95 only) */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8185
    HGDIOBJ hFont;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8186
    int  nHeight, nWidth, nEscapement, nOrientation;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8187
    char* work;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8188
    char* work2;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8189
    DWORD fnWeight;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8190
    DWORD fdwItalic;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8191
    DWORD fdwUnderline;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8192
    DWORD fdwStrikeOut;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8193
    DWORD fdwCharSet;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8194
    DWORD fdwOutputPrecision;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8195
    DWORD fdwClipPrecision;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8196
    DWORD fdwQuality;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8197
    DWORD fdwPitchAndFamily;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8198
    LPCTSTR lpszFace;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8199
    static char temp[33];
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8200
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8201
/* INITIALIZE */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8202
    strcpy( temp, "                           " );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8203
    lpszFace = &temp[0];
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8204
    strcpy( (char *)lpszFace, "NULL" );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8205
    nHeight  = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8206
    nWidth   = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8207
    nEscapement = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8208
    nOrientation = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8209
    fnWeight = FW_NORMAL;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8210
    fdwItalic = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8211
    fdwUnderline = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8212
    fdwStrikeOut = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8213
    fdwCharSet   = ANSI_CHARSET;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8214
    fdwOutputPrecision = OUT_DEFAULT_PRECIS;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8215
    fdwClipPrecision   = CLIP_DEFAULT_PRECIS;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8216
    fdwQuality         = DEFAULT_QUALITY;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8217
    fdwPitchAndFamily  = FF_DONTCARE;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8218
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8219
/* SET VALUES */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8220
    if ( __isString( family ) ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8221
	work = __stringVal( family );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8222
	if ( strcmp( work, "nil" ) != 0 ) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8223
	    strncpy( (char *)lpszFace, work, 32 );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8224
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8225
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8226
    if( __isString( weight ) ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8227
	work = __stringVal( weight );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8228
	if( strcmp( work, "bold" ) == 0 ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8229
	    fnWeight = FW_BOLD;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8230
    } else {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8231
	if( strcmp( work, "medium" ) == 0 ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8232
	    fnWeight = FW_MEDIUM;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8233
	    } else {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8234
		if( strcmp( work, "demi" ) == 0 )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8235
		    fnWeight = FW_LIGHT;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8236
	    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8237
	}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8238
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8239
    if(__isSmallInteger( size ) )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8240
    {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8241
	nHeight = __intVal( size );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8242
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8243
    work2 = __stringVal( slant );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8244
    work  = __stringVal( slant );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8245
    if( strncmp( work2, "italic", 6 ) == 0 )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8246
    {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8247
	fdwItalic = TRUE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8248
	if( work2[6] = '-' )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8249
	   strncpy( work, &work2[7], ( strlen( work2 ) - 7 ) );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8250
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8251
    if( strncmp( work, "underline", 9 ) == 0 )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8252
    {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8253
	fdwUnderline = TRUE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8254
	if( work[10] == '-' )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8255
	   strncpy( work2, &work[11], ( strlen( work ) - 10 ) );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8256
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8257
    if( strncmp( work2, "strikeOut", 9 ) == 0 )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8258
	fdwStrikeOut = TRUE;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8259
    nHeight = -MulDiv(nHeight, __logPixelSY, 72);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8260
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8261
    DPRINTF(("CreateFont %s h=%d\n",lpszFace,nHeight));
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8262
    hFont = CreateFont( nHeight,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8263
			nWidth,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8264
			nEscapement,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8265
			nOrientation,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8266
			fnWeight,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8267
			fdwItalic,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8268
			fdwUnderline,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8269
			fdwStrikeOut,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8270
			fdwCharSet,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8271
			fdwOutputPrecision,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8272
			fdwClipPrecision,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8273
			fdwQuality,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8274
			fdwPitchAndFamily,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8275
			lpszFace );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8276
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8277
    if( hFont != NULL )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8278
    {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8279
	DPRINTF(("createFontWithFoundry: %x\n", hFont));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8280
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8281
	    __cnt_font++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8282
	   RES1PRINTF(("CreateFont %d\n",__cnt_font));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8283
#endif
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8284
	RETURN ( __MKOBJ(hFont) );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8285
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8286
    DPRINTF(("***** ERROR createFontWithFoundry failed ERROR *****\n" ));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8287
%}.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8288
    ^ nil
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8289
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8290
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8291
     Display getFontWithFoundry:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8292
			 family:'courier'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8293
			 weight:'medium'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8294
			  slant:'r'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8295
			spacing:nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8296
		      pixelSize:nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8297
			   size:13
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8298
		       registry:'iso8859'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8299
		       encoding:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8300
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8301
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8302
    "new NT Version: 20.2.1997 / 22:33:29 / dq"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8303
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8304
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8305
listOfAvailableFonts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8306
    "return a list with all available fonts on this display.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8307
     Since this takes a long time, keep the result of the query for the
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8308
     next time. The elements of the returned collection are instances of
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8309
     FontDescription."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8310
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8311
    |list typeFaceList|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8312
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8313
    listOfFonts notNil ifTrue:[^ listOfFonts].
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
    list := OrderedCollection new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8316
    typeFaceList := OrderedCollection new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8317
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8318
    [
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8319
      self primEnumFontTypesInto:typeFaceList.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8320
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8321
      "/Transcript showCR:typeFaceList.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8322
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8323
      typeFaceList do:[:typeFace |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8324
	  self primEnumFontsIn:typeFace into:list.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8325
	  0
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
    ] valueUninterruptably.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8328
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8329
    "/Transcript showCR:list.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8330
    listOfFonts := list
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8331
		       collect:[:anArray |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8332
			| fntDescr family face style size encoding |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8333
			family := anArray at:14.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8334
			face   := anArray at:5.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8335
			style  := anArray at:16.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8336
			size   := anArray at:1.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8337
			encoding := anArray at:15.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8338
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8339
			fntDescr := FontDescription
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8340
					family:family
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8341
					face:face
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8342
					style:style
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8343
					size:size
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8344
					encoding:encoding.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8345
			fntDescr
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8346
		       ].
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8347
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8348
    ^ listOfFonts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8349
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8350
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8351
     Display listOfAvailableFonts.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8352
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8353
     Display getAvailableFontsMatching:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8354
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8355
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8356
    "Modified: 27.9.1995 / 10:54:47 / stefan"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8357
    "Modified: 17.4.1996 / 15:27:57 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8358
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8359
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8360
primEnumFontTypesInto:typeFaceList
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8361
%{      /* xxLIMITEDSTACK (WIN95) */
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8362
	if (__tmpDC) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8363
	    if ( EnumFontFamilies( __tmpDC, NULL, EnumFPTypeFaceProc, (DWORD)&(typeFaceList))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8364
		DPRINTF(("EnumFonts successful\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8365
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8366
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8367
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8368
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8369
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8370
primEnumFontsIn:typeFace into:fontList
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8371
%{      /* xxLIMITEDSTACK (WIN95) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8372
	char *cp;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8373
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8374
	if (__isString(typeFace)) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8375
	    if (__tmpDC) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8376
		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
  8377
		    DPRINTF(("EnumFonts Successful\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8378
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8379
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8380
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8381
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8382
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8383
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8384
primFontMetricsOf:fontId intoArray:data
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8385
    "evaluate aBlock, passing a fonts metrics as arguments"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8386
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8387
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8388
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8389
    if (__isExternalAddress(fontId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8390
	SIZE size;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8391
	int avgWidth;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8392
	HGDIOBJ hFont;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8393
	HGDIOBJ prevFont;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8394
	TEXTMETRIC tmet;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8395
	int len;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8396
	hFont = _HGDIOBJVal(fontId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8397
	/*
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8398
	 * temporarily set this font in the root context
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8399
	 */
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8400
	prevFont = SelectObject(__tmpDC, hFont);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8401
	GetTextMetrics(__tmpDC, &tmet);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8402
	GetTextExtentPoint32(__tmpDC,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrst"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8403
	 "uvwxyz",52,&size);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8404
	SelectObject(__tmpDC, prevFont);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8405
	avgWidth = (size.cx/26+1)/2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8406
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8407
	__ArrayInstPtr(data)->a_element[0] = __MKSMALLINT(tmet.tmAscent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8408
	__ArrayInstPtr(data)->a_element[1] = __MKSMALLINT(tmet.tmDescent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8409
	__ArrayInstPtr(data)->a_element[2] = __MKSMALLINT(tmet.tmAscent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8410
	__ArrayInstPtr(data)->a_element[3] = __MKSMALLINT(tmet.tmDescent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8411
	__ArrayInstPtr(data)->a_element[4] = __MKSMALLINT(avgWidth);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8412
	__ArrayInstPtr(data)->a_element[5] = __MKSMALLINT(tmet.tmMaxCharWidth);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8413
	__ArrayInstPtr(data)->a_element[6] = __MKSMALLINT(avgWidth);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8414
	DPRINTF(("textMetrics h=%x  avgAsc=%d avgDesc=%d minW=%d maxW=%d avgW=%d\n",
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8415
		    hFont, tmet.tmAscent, tmet.tmDescent, avgWidth, tmet.tmMaxCharWidth,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8416
		    tmet.tmAveCharWidth));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8417
	RETURN (self);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8418
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8419
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8420
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8421
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8422
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8423
releaseFont:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8424
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8425
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8426
    if (__isExternalAddress(aFontId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8427
	HGDIOBJ hFont = _HGDIOBJVal(aFontId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8428
	if (hFont)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8429
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8430
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8431
	    __cnt_font--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8432
	   RES1PRINTF(("DestroyFont %d\n",__cnt_font));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8433
#endif
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  8434
	  _DeleteObject(hFont);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8435
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8436
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8437
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8438
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8439
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8440
sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8441
    "return a set of all available font sizes in aFamily/aFace/aStyle
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8442
     on this display.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8443
     Redefined to handle X's special case of 0-size (which stands for any)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8444
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8445
    |sizes|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8446
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8447
    sizes := super sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8448
    (sizes notNil and:[sizes includes:0]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8449
	"special: in X11R5 and above, size 0 means:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8450
	 there are scaled versions in all sizes available"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8451
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8452
	^ #(4 5 6 7 8 9 10 11 12 14 16 18 20 22 24 28 32 48 64)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8453
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8454
    ^ sizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8455
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8456
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8457
     Display sizesInFamily:'courier' face:'bold' style:'roman'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8458
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8459
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8460
    "Created: 27.2.1996 / 01:38:15 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8461
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8462
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8463
widthOf:aString from:index1 to:index2 inFont:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8464
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8465
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8466
    char *cp;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8467
    int len, n, i1, i2, l;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8468
    OBJ cls;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8469
    int nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8470
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8471
    if (__bothSmallInteger(index1, index2)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8472
     && __isExternalAddress(aFontId)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8473
     && __isNonNilObject(aString)) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8474
	HGDIOBJ hFont,prevFont;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8475
	SIZE tsize;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8476
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8477
	hFont = _HGDIOBJVal(aFontId);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8478
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8479
	i1 = __intVal(index1) - 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8480
	cls = __qClass(aString);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8481
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8482
	if (i1 >= 0) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8483
	    i2 = __intVal(index2) - 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8484
	    if (i2 < i1) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8485
		RETURN ( __MKSMALLINT( 0 ) );
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8486
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8487
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8488
	    cp = (char *) _stringVal(aString);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8489
	    l = i2 - i1 + 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8490
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8491
	    if ((cls == @global(String)) || (cls == @global(Symbol))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8492
		n = _stringSize(aString);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8493
		if (i2 < n) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8494
		    cp += i1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8495
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8496
		    prevFont = SelectObject(__tmpDC, hFont);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8497
		    GetTextExtentPoint32(__tmpDC, cp, l, &tsize);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8498
#ifdef SUPERDEBUG
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8499
		    if (__debug__) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8500
		      char buf[80];
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8501
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8502
		      GetTextFace(__tmpDC,80,buf);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8503
		      printf("font1 %x %s >%s< l=%d dx=%d\n",hFont,buf,cp,l,tsize.cx);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8504
		    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8505
#endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8506
		    SelectObject(__tmpDC, prevFont);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8507
		    RETURN ( __MKSMALLINT(tsize.cx) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8508
		}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8509
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8510
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8511
	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8512
	    cp += nInstBytes;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8513
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8514
	    if (__isBytes(aString)) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8515
		n = __byteArraySize(aString) - nInstBytes;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8516
		if (i2 < n) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8517
		    cp += i1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8518
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8519
		    prevFont = SelectObject(__tmpDC, hFont);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8520
		    GetTextExtentPoint32(__tmpDC, cp, l, &tsize);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8521
#ifdef SUPERDEBUG
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8522
		    if (__debug__) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8523
		      char buf[80];
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8524
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8525
		      GetTextFace(__tmpDC,80,buf);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8526
		      printf("font1 %x %s >%s< l=%d dx=%d\n",hFont,buf,cp,l,tsize.cx);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8527
		    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8528
#endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8529
		    SelectObject(__tmpDC, prevFont);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8530
		    RETURN ( __MKSMALLINT(tsize.cx) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8531
		}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8532
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8533
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8534
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8535
#undef NLOCALBUFFER
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8536
%}.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8537
"/  'no stringlen' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8538
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8539
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8540
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8541
!WinWorkstation methodsFor:'grabbing '!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8542
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8543
allowEvents:mode
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8544
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8545
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8546
grabKeyboardIn:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8547
    "grab the keyboard"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8548
%{    
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8549
    if (__isExternalAddress(aWindowId)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8550
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8551
      HWND hWnd = _HWNDVal(aWindowId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8552
      CPRINTF(("grabKeyboard in %x\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8553
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8554
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8555
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8556
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8557
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8558
grabPointerIn:aWindowId withCursor:aCursorId pointerMode:pMode keyboardMode:kMode confineTo:confineId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8559
    "grap the pointer - return true if ok"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8560
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8561
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8562
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8563
	HWND hWnd = _HWNDVal(aWindowId);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8564
	{
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8565
	  HCURSOR hCursor = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8566
	  if (currentCapture != CAPTURE_NONE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8567
	  {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8568
	    PostMessage(currentPointerView,WM_THREADSETCAPTURE,0,0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8569
	    //ReleaseCapture();
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8570
	  }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8571
#if 1
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8572
	  if (hWnd == __rootWin)
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
	     hWnd = __rootWinSpezial;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8575
	     ShowWindow(hWnd,SW_SHOWNOACTIVATE);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  8576
	     //EnableWindow(hWnd,TRUE);
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8577
	     SetWindowPos(hWnd, HWND_TOP,
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  8578
	      0, 0, 0, 0,SWP_NOREDRAW|SWP_NOSENDCHANGING|SWP_NOCOPYBITS
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  8579
	      |SWP_NOACTIVATE |SWP_NOMOVE|SWP_NOSIZE);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8580
	     CPRINTF(("setRootCapture %x\n",hWnd));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8581
	  }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8582
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8583
	  if (__isExternalAddress(aCursorId))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8584
	  {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8585
	      hCursor = _HCURSORVal(aCursorId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8586
	  }
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8587
	  CPRINTF(("grabPointerIn  SetCapture %x\n",hWnd));
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8588
	  PostMessage(hWnd,WM_THREADSETCAPTURE,(INT)hWnd,(INT)hCursor);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8589
	  if (__isExternalAddress(aCursorId))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8590
	  {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8591
	      RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8592
	  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8593
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8594
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8595
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8596
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8597
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8598
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8599
ungrabKeyboard
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8600
    "release the keyboard"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8601
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8602
    activeKeyboardGrab := nil.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8603
%{    
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8604
    CPRINTF(("ungrabKeyboard\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8605
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8606
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8607
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8608
ungrabPointer
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8609
    "release the pointer"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8610
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8611
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8612
    CPRINTF(("ungrabPointer 1\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8613
    PostThreadMessage(_dispatchThreadId,WM_THREADSETCAPTURE,0,0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8614
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8615
    activePointerGrab := nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8616
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8617
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8618
!WinWorkstation methodsFor:'graphic context stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8619
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8620
noClipIn:aWindowId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8621
    "disable clipping rectangle"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8622
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8623
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8624
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8625
    if (__isExternalAddress(aWindowId)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8626
     && __isExternalAddress(aGCId))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8627
     {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8628
	struct gcData *gcData = _GCDATA(aGCId);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8629
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8630
	if (gcData->clipping != FALSE) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8631
	    gcData->clipping = FALSE;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8632
	    FLUSH_CACHED_DC(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8633
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8634
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8635
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8636
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8637
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8638
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8639
setBackground:bgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8640
    "set background color to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8641
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8642
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8643
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8644
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8645
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8646
    if (__isExternalAddress(aGCId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8647
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8648
	COLORREF bgColor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8649
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8650
	bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8651
	if (bgColor != gcData->bgColor) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8652
	    gcData->bgColor = bgColor;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8653
	    if (lastGcData == gcData) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8654
		SetBkColor(gcData->_hDC, bgColor);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8655
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8656
#if 0
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8657
	    FLUSH_CACHED_DC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8658
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8659
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8660
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8661
	DDPRINTF(("setBackground: %x\n", bgColor));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8662
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8663
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8664
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8665
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8666
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8667
setBitmapMask:aBitmapId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8668
    "set or clear the drawing mask - a bitmap mask using current fg/bg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8669
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8670
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8671
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8672
    if (__isExternalAddress(aGCId)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8673
	struct gcData *gcData = _GCDATA(aGCId);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8674
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8675
	if (__isExternalAddress(aBitmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8676
	    gcData->hMask = _HBITMAPVAL(aBitmapId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8677
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8678
	    gcData->hMask = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8679
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8680
	FLUSH_CACHED_DC(gcData);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8681
	DPRINTF(("masks set to %x\n",gcData->hMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8682
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8683
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8684
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8685
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8686
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  8687
setClipByChildren:aBool in:aWindowId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8688
    "enable/disable drawing into child views"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8689
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8690
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8691
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8692
    if (ISCONNECTED && __isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8693
	struct gcData *gcData = _GCDATA(aGCId);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8694
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8695
	if (gcData && gcData->hWnd) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8696
	    if ( aBool == true ) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8697
		/* set clip by child */
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8698
		gcData->clipByChild = TRUE;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8699
	    } else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8700
		gcData->clipByChild = FALSE;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8701
	    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8702
	    FLUSH_CACHED_DC(gcData);
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  8703
	} else {
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  8704
	    DPRINTF(("clipping by child failed - invalid win\n" ));
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  8705
	}
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  8706
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8707
%}.
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8708
    ^ self
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8709
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8710
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8711
setClipX:clipX y:clipY width:clipWidth height:clipHeight in:aDrawableId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8712
    "clip to a rectangle"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8713
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8714
"
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8715
      p--w---
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8716
      |     |
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8717
      h     |  the clipping rectangle
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8718
      |     |
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8719
      -------
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8720
	  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
  8721
"
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8722
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8723
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8724
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8725
    if (  __isExternalAddress(aGCId)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8726
       && __bothSmallInteger(clipX, clipY)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8727
       && __bothSmallInteger(clipWidth, clipHeight) ) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8728
	struct gcData *gcData = _GCDATA(aGCId);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8729
	int cX, cY, cW, cH;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8730
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8731
	cX = __intVal(clipX);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8732
	cY = __intVal(clipY);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8733
	cW = __intVal(clipWidth);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8734
	cH = __intVal(clipHeight);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8735
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8736
	if ((gcData->clipping != TRUE)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8737
	 || (cX != gcData->clipX)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8738
	 || (cY != gcData->clipY)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8739
	 || (cW != gcData->clipW)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8740
	 || (cH != gcData->clipH)) {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8741
	    gcData->clipping = TRUE;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8742
	    gcData->clipX = cX; 
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8743
	    gcData->clipY = cY; 
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8744
	    gcData->clipW = cW; 
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8745
	    gcData->clipH = cH; 
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8746
	    FLUSH_CACHED_DC(gcData);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8747
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8748
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8749
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8750
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8751
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8752
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8753
setDashes:dashList dashOffset:offset in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8754
    "set line attributes"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8755
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8756
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8757
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8758
    if (__isExternalAddress(aGCId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8759
	PRINTF(("dashes not yet implemented\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8760
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8761
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8762
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8763
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8764
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8765
setFont:aFontId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8766
    "set font to be drawn in"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8767
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8768
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8769
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8770
    if (__isExternalAddress(aGCId)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8771
     && __isExternalAddress(aFontId))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8772
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8773
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8774
	HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8775
	HGDIOBJ hFont;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8776
	TEXTMETRIC tmet;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8777
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8778
	hDC = _getDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8779
	hFont = _HGDIOBJVal(aFontId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8780
	gcData->hFont = hFont;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8781
	hFont = SelectObject(hDC, hFont);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8782
	GetTextMetrics(hDC, &tmet);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8783
	gcData->fontAscent = tmet.tmAscent;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8784
#ifdef DEBUG
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8785
	if (__debug__) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8786
	    char buf[80];
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8787
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8788
	    GetTextFace(hDC,80,buf);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8789
	    PRINTF(("setFont: %x %s\n", hFont,buf));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8790
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8791
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8792
	SelectObject(hDC, hFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8793
	_releaseDC(gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8794
	FLUSH_CACHED_DC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8795
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8796
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8797
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8798
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8799
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8800
setForeground:fgColorIndex background:bgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8801
    "set foreground and background colors to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8802
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8803
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8804
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8805
    if (__isExternalAddress(aGCId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8806
	struct gcData *gcData = _GCDATA(aGCId);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8807
	COLORREF fg, bg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8808
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8809
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8810
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8811
	if ((fg != gcData->fgColor)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8812
	 || (bg != gcData->bgColor)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8813
	    gcData->fgColor = fg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8814
	    gcData->bgColor = bg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8815
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8816
#if 0
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8817
	    FLUSH_CACHED_DC(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8818
#else
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8819
	    if (lastGcData == gcData) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8820
		SetTextColor(gcData->_hDC, fg);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8821
		SetBkColor(gcData->_hDC, bg);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8822
		FLUSH_CACHED_PEN(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8823
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8824
#endif
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8825
	    DDPRINTF(("setForeground: %x background: %x\n", gcData->fgColor, gcData->bgColor));
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8826
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8827
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8828
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8829
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8830
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8831
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8832
setForeground:fgColorIndex background:bgColorIndex mask:aBitmapId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8833
    "set foreground and background colors to be drawn with using mask or
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8834
     solid (if aBitmapId is nil)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8835
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8836
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8837
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8838
    if (__isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8839
	struct gcData *gcData = _GCDATA(aGCId);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8840
	COLORREF fg, bg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8841
	HBITMAP m;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8842
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8843
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8844
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8845
	if (__isExternalAddress(aBitmapId))
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8846
	    m = _HBITMAPVAL(aBitmapId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8847
	else
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8848
	    m = 0;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8849
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8850
	if ((gcData->fgColor != fg)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8851
	 || (gcData->bgColor != bg)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8852
	 || (gcData->hMask != m)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8853
	    gcData->fgColor = fg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8854
	    gcData->bgColor = bg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8855
	    gcData->hMask = m;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8856
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8857
	    FLUSH_CACHED_DC(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8858
	    DDPRINTF(("setForeground: %x background: %x mask: %x\n", gcData->fgColor, gcData->bgColor,gcData->hMask));
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8859
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8860
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8861
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8862
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8863
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8864
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8865
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
  8866
    "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
  8867
     solid (if aBitmapId is nil); also set lineWidth"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8868
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8869
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8870
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8871
    if (__isExternalAddress(aGCId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8872
	struct gcData *gcData = _GCDATA(aGCId);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8873
	COLORREF fg, bg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8874
	HBITMAP m;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8875
	int l;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8876
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8877
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8878
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8879
	if (__isExternalAddress(aBitmapId))
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8880
	    m = _HBITMAPVAL(aBitmapId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8881
	else
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8882
	    m = 0;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8883
	l = __intVal(lw);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8884
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8885
	if ((gcData->fgColor != fg)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8886
	 || (gcData->bgColor != bg)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8887
	 || (gcData->lineWidth != l)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8888
	 || (gcData->hMask != m)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8889
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8890
	    gcData->fgColor = fg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8891
	    gcData->bgColor = bg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8892
	    gcData->lineWidth = l;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8893
	    gcData->hMask = m;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8894
	    FLUSH_CACHED_DC(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8895
	    DDPRINTF(("setForeground: %x background: %x mask: %x linewidth: %d\n", gcData->fgColor, gcData->bgColor,gcData->hMask,gcData->lineWidth));
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8896
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8897
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8898
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8899
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8900
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8901
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8902
setForeground:fgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8903
    "set foreground color to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8904
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8905
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8906
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8907
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8908
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8909
    if (__isExternalAddress(aGCId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8910
	struct gcData *gcData = _GCDATA(aGCId);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8911
	COLORREF fg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8912
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8913
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8914
	if (fg != gcData->fgColor) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8915
	    gcData->fgColor = fg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8916
#if 0
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8917
	    FLUSH_CACHED_DC(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8918
#else
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8919
	    if (lastGcData == gcData) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8920
		SetTextColor(gcData->_hDC, fg);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8921
		FLUSH_CACHED_PEN(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8922
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8923
#endif
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8924
	    DDPRINTF(("setForeground: %x\n", gcData->fgColor));
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8925
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8926
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8927
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8928
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8929
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8930
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8931
setFunction:aFunctionSymbol in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8932
    "set alu function to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8933
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8934
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8935
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8936
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8937
    if (__isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8938
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8939
	int fun = -1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8940
	int bfun = -1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8941
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8942
	if (aFunctionSymbol == @symbol(copy)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8943
	    fun = R2_COPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8944
	    bfun = BITBLT_COPY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8945
	} else if (aFunctionSymbol == @symbol(copyInverted)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8946
	    fun = R2_NOTCOPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8947
	    bfun = BITBLT_COPYINVERTED;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8948
	} else if (aFunctionSymbol == @symbol(xor)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8949
	    fun = R2_XORPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8950
	    bfun = BITBLT_XOR;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8951
	} else if (aFunctionSymbol == @symbol(and)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8952
	    fun = R2_MASKPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8953
	    bfun = BITBLT_AND;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8954
	} else if (aFunctionSymbol == @symbol(or)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8955
	    fun = R2_MERGEPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8956
	    bfun = BITBLT_OR;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8957
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8958
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8959
	if (fun != -1) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8960
#if 0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8961
	    printf("set func to");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8962
	    switch (bfun) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8963
		case BITBLT_COPY:
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8964
		    printf("BITBLT_COPY\n");
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8965
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8966
		case BITBLT_COPYINVERTED:
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8967
		    printf("BITBLT_COPYINVERTED\n");
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8968
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8969
		case BITBLT_XOR:
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8970
		    printf("BITBLT_XOR\n");
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8971
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8972
		case BITBLT_AND:
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8973
		    printf("BITBLT_AND\n");
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8974
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8975
		case BITBLT_OR:
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8976
		    printf("BITBLT_OR\n");
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8977
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8978
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8979
#endif
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8980
	} else {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8981
	    INFOPRINT( (stderr, "WinWorkstat [warning]: unsuported Rasterfunction\n") );
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8982
	    fun = R2_COPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8983
	    bfun = BITBLT_COPY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8984
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8985
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8986
	if ((fun != gcData->rop2)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8987
	 || (bfun != gcData->bitbltrop2)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8988
	    gcData->rop2 = fun;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8989
	    gcData->bitbltrop2 = bfun;
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8990
	    if (gcData == lastGcData) {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8991
		SetROP2(gcData->_hDC, fun);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8992
	    } else {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8993
		FLUSH_CACHED_DC(gcData);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8994
	    }
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8995
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8996
    } else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8997
	INFOPRINT((stderr, "WinWorkstation [warning]: Rasterfunction no GC\n"));
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8998
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8999
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9000
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9001
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9002
setGraphicsExposures:aBoolean in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9003
    "set or clear the graphics exposures flag"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9004
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9005
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9006
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9007
setLineWidth:aNumber style:lineStyle cap:capStyle join:joinStyle in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9008
    "set line attributes"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9009
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9010
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9011
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9012
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9013
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9014
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9015
     && __isSmallInteger(aNumber)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9016
	struct gcData *gcData = _GCDATA(aGCId);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9017
	int style;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9018
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9019
	gcData->lineWidth = __intVal(aNumber);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9020
	if (lineStyle == @symbol(solid)) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9021
	    style = PS_SOLID;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9022
	} else if (lineStyle == @symbol(dashed)) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9023
	    style= PS_DASH;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  9024
	} else if (lineStyle == @symbol(dotted)) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9025
	    style= PS_DOT;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  9026
	} else if (lineStyle == @symbol(dashDot)) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9027
	    style= PS_DASHDOT;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  9028
	} else if (lineStyle == @symbol(dashDotDot)) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9029
	    style= PS_DASHDOTDOT;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9030
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9031
	    style= PS_SOLID;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9032
	gcData->lStyle &= ~PS_STYLE_MASK;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9033
	gcData->lStyle |= style;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9034
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9035
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9036
	if (capStyle == @symbol(round)) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9037
	    style = PS_ENDCAP_ROUND;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9038
	} else if (capStyle == @symbol(square)) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9039
	    style = PS_ENDCAP_SQUARE;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9040
	} else if (capStyle == @symbol(flat)) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9041
	    style = PS_ENDCAP_FLAT;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9042
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9043
	    style = PS_ENDCAP_FLAT;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9044
	gcData->lStyle &= ~PS_ENDCAP_MASK;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9045
	gcData->lStyle |= style;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9046
        
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9047
	if (joinStyle == @symbol(bevel)) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9048
	    style = PS_JOIN_BEVEL;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9049
	} else if (joinStyle == @symbol(miter)) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9050
	    style = PS_JOIN_MITER;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9051
	} else if (joinStyle == @symbol(round)) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9052
	    style = PS_JOIN_ROUND;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9053
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9054
	    style = PS_JOIN_MITER;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9055
	gcData->lStyle &= ~PS_JOIN_MASK;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9056
	gcData->lStyle |= style;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9057
	FLUSH_CACHED_DC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9058
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9059
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9060
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9061
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9062
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9063
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9064
setMaskOriginX:orgX y:orgY in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9065
    "set the mask origin"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9066
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9067
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9068
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9069
    if (__isExternalAddress(aGCId)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9070
     && __bothSmallInteger(orgX,orgY)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9071
	struct gcData *gcData = _GCDATA(aGCId);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9072
	int oX, oY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9073
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9074
	oX = __intVal(orgX);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9075
	oY = __intVal(orgY);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9076
	if ((oX != gcData->maskOrgX)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9077
	 || (oY != gcData->maskOrgY)) {
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9078
	    gcData->maskOrgX = __intVal(orgX);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9079
	    gcData->maskOrgY = __intVal(orgY);;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9080
	    FLUSH_CACHED_DC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9081
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9082
	RETURN (self);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9083
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9084
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9085
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9086
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9087
setPixmapMask:aPixmapId in:aGCId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9088
    "set or clear the drawing mask - a pixmap mask providing full color"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9089
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9090
%{  /* xxLIMITEDSTACK (WIN95 only) */
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9091
    if (__isExternalAddress(aGCId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9092
	struct gcData *gcData = _GCDATA(aGCId);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9093
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9094
	if (__isExternalAddress(aPixmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9095
	    gcData->hMask = _HBITMAPVAL(aPixmapId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9096
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9097
	    gcData->hMask = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9098
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9099
	FLUSH_CACHED_DC(gcData);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9100
	DPRINTF(("PixmapMasks set to %x\n",gcData->hMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9101
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9102
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9103
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9104
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9105
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9106
!WinWorkstation methodsFor:'initialize / release'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9107
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9108
close
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9109
    "close down the connection to the display"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9110
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9111
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9112
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9113
initializeDefaultValues
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9114
    focusMode := #activeWindow.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9115
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9116
    buttonTranslation := ButtonTranslation.
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9117
"/    multiClickTimeDelta := MultiClickTimeDelta.  "/ ignored - defined by preference-panel
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9118
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9119
    self initializeModifierMappings
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9120
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9121
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9122
initializeEventBuffer
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9123
    |sz|
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9124
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9125
%{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9126
    sz = __MKSMALLINT(sizeof(struct queuedEvent) + 100);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9127
%}.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9128
    eventBuffer isNil ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9129
	eventBuffer := ByteArray new:sz.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9130
    ].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9131
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9132
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9133
initializeFor:aDisplayName
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9134
    "initialize the receiver for a connection to an X-Server;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9135
     the argument, aDisplayName may be nil (for the default server from
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9136
     DISPLAY-variable or command line argument) or the name of the server
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9137
     as hostname:number"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9138
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9139
    displayId notNil ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9140
	"/ already connected - trying to trick me ?
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9141
	^ self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9142
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9143
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9144
    displayId := self primInitializeFor:aDisplayName.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9145
    displayId isNil ifTrue:[^ self].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9146
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9147
    dispatching := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9148
    isSlow := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9149
    shiftDown := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9150
    ctrlDown := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9151
    metaDown := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9152
    altDown := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9153
    motionEventCompression := true.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9154
    buttonsPressed := 0.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9155
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9156
    self initializeScreenProperties.
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9157
    self initializeDeviceResourceTables.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9158
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9159
    self initializeDefaultValues.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9160
    self initializeEventBuffer.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9161
    self initializeSpecialFlags.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9162
    self initializeKeyboardMap.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9163
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9164
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9165
initializeModifierMappings
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9166
    shiftModifiers := #(#'Shift_L' #'Shift_R' #'Shift').
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9167
    ctrlModifiers := #(#'Ctrl_L' #'Ctrl_R' #'Ctrl').
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9168
    metaModifiers := #(#'Alt_L' #'Alt').
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9169
    altModifiers := #(#'Alt_R').
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9170
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9171
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9172
initializeScreenProperties
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9173
    super initializeScreenProperties.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9174
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9175
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9176
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9177
    int scr;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9178
    int maxRGBDepth;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9179
    int rgbRedMask, rgbGreenMask, rgbBlueMask;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9180
    int nvi, i;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9181
    char *type, *nm;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9182
    int dummy;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9183
    int mask, shift, nBits;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9184
    HDC _rootDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9185
    OBJ id;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9186
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9187
    if (firstInstance) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9188
	OSVERSIONINFO osvi;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9189
	WNDCLASS wc;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9190
	firstInstance = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9191
	DPRINTF(("first create - registerClass\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9192
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9193
	memset(&osvi, 0, sizeof(OSVERSIONINFO));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9194
	osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9195
	GetVersionEx (&osvi);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9196
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  9197
	if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) {
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  9198
	    __isWinNT = 1;
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  9199
	    __INST(isWin95) = false;
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  9200
	} else {
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  9201
	    __isWinNT = 0;
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  9202
	    __INST(isWin95) = true;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9203
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9204
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9205
	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
  9206
	wc.lpfnWndProc = (WNDPROC) MainWndProc;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9207
	wc.cbClsExtra = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9208
	wc.cbWndExtra = N_WINDOW_PRIVATE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9209
	wc.hInstance = (HANDLE) __getHInstance();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9210
	wc.hIcon = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9211
	wc.hCursor = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9212
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9213
	wc.hbrBackground = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9214
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9215
	wc.lpszMenuName =  NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9216
	wc.lpszClassName = app_name;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9217
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9218
	if (!RegisterClass(&wc)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9219
	    DPRINTF(("RegisterClass failed\n"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9220
    /*            return NULL;     */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9221
	}
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
	wc.style = 0;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9224
	wc.lpfnWndProc = (WNDPROC) MainWndProc;// Root;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9225
	wc.cbClsExtra = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9226
	wc.cbWndExtra = N_WINDOW_PRIVATE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9227
	wc.hInstance = (HANDLE) __getHInstance();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9228
	wc.hIcon = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9229
	wc.hCursor = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9230
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9231
	wc.hbrBackground = GetStockObject(HOLLOW_BRUSH);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9232
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9233
	wc.lpszMenuName =  NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9234
	wc.lpszClassName = app_nameroot;
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
	if (!RegisterClass(&wc)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9237
	    DPRINTF(("RegisterClass failed\n"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9238
    /*            return NULL;     */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9239
	}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9240
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9241
	hCreateEvent = CreateEvent(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9242
	    NULL,        /* no security attributes */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9243
	    FALSE,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9244
	    FALSE,
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9245
	    "CreateEvents");  /* name of mutex */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9246
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9247
	if (hCreateEvent == NULL) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9248
	    DPRINTF(("CreateEvent failed\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9249
/*            return NULL;     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9250
	}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9251
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9252
	hInputEvent = CreateEvent(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9253
	    NULL,        /* no security attributes */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9254
	    FALSE,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9255
	    FALSE,
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9256
	    "InputEvents");
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9257
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9258
	if (hInputEvent == NULL) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9259
	    DPRINTF(("InputEvent failed\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9260
/*            return NULL;     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9261
	}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9262
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9263
	hEventQMutex = CreateMutex(
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9264
	    NULL,                       /* no security attributes */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9265
	    FALSE,                      /* initially not owned */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9266
	    "EvQMutex");                /* name of mutex */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9267
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9268
	if (hEventQMutex == NULL) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9269
	    DPRINTF(("CreateMutex failed\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9270
/*            return NULL;     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9271
	}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9272
	DuplicateHandle(GetCurrentProcess(), 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9273
			hEventQMutex, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9274
			GetCurrentProcess(), 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9275
			&hEventQMutex, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9276
			DUPLICATE_SAME_ACCESS, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9277
			FALSE, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9278
			DUPLICATE_SAME_ACCESS);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9279
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9280
	hEventFreeListMutex = CreateMutex(
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9281
	    NULL,                       /* no security attributes */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9282
	    FALSE,                      /* initially not owned */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9283
	    "EvFMutex");                /* name of mutex */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9284
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9285
	if (hEventFreeListMutex == NULL) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9286
	    DPRINTF(("CreateMutex failed\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9287
/*            return NULL;     */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9288
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9289
	DuplicateHandle(GetCurrentProcess(), 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9290
			hEventFreeListMutex, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9291
			GetCurrentProcess(), 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9292
			&hEventFreeListMutex, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9293
			DUPLICATE_SAME_ACCESS, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9294
			FALSE, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9295
			DUPLICATE_SAME_ACCESS);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9296
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9297
	/*__setWaitInputEvent(waitInputEvent);*/
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9298
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  9299
#ifndef WIN32THREADS
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9300
	_masterThreadId = GetCurrentThreadId();
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9301
	DuplicateHandle(GetCurrentProcess(),
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9302
			GetCurrentThread(),
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9303
			GetCurrentProcess(),
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9304
			&_masterThread,
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9305
			DUPLICATE_SAME_ACCESS,
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9306
			FALSE,
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9307
			DUPLICATE_SAME_ACCESS);
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  9308
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9309
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  9310
	initqueue();
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9311
	__beginthread(dispatchThread, EVENT_THREAD_STACKSIZE, 0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9312
	{
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9313
	    DWORD dwWaitResult;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9314
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9315
	    dwWaitResult = WaitForSingleObject(
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9316
			    hCreateEvent,   /* handle of mutex */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9317
			    5000L);         /* time-out interval */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9318
	    if (dwWaitResult != WAIT_OBJECT_0) {
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9319
		fprintf(stderr, "WinWorkstation [error]: oops timeout waiting for eventThread to start\n");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9320
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9321
	}
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9322
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9323
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9324
#if 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9325
    __rootDesk = OpenDesktop ("Desktop0", 0, FALSE, GENERIC_ALL);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9326
    if (!__rootDesk) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9327
	PRINTF(("OpenDesktop fail\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9328
	__rootDesk = CreateDesktop ("Desktop0", NULL,NULL,0,DESKTOP_WRITEOBJECTS,NULL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9329
	if (!__rootDesk) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9330
	    PRINTF(("CreateDesktop fail\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9331
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9332
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9333
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9334
    __rootWin = GetDesktopWindow();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9335
    __PROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9336
    id = __MKOBJ(__rootWin);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9337
    __UNPROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9338
    __INST(rootWin) = id; __STORE(self, id);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9339
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9340
    _rootDC = __rootDC = CreateDC("DISPLAY", NULL, NULL, NULL);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9341
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9342
    __tmpDC = CreateCompatibleDC(_rootDC);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9343
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9344
    __PROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9345
    id = __MKOBJ(_rootDC);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9346
    __UNPROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9347
    __INST(rootDC) = id; __STORE(self, id);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9348
%}.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9349
    self initializeVariableScreenProperties.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9350
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9351
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9352
initializeVariableScreenProperties
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9353
    "fetch properties which can be changed via the user settings.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9354
     Invoked initially and as a result of the displayChange event."
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9355
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9356
%{
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9357
    int nvi, i, val, capabilities, planes, numcolors, numpens, realDepth;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9358
    RECT rect;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9359
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9360
    multiClickTime = GetDoubleClickTime();
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9361
    DPRINTF(("multiClickTime = %d\n",multiClickTime));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9362
    __INST(multiClickTimeDelta) = __MKSMALLINT(multiClickTime);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9363
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9364
    GetWindowRect(__rootWin, &rect);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9365
    __INST(width) = __MKSMALLINT(rect.right - rect.left);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9366
    __INST(height) = __MKSMALLINT(rect.bottom - rect.top);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9367
    DPRINTF(("screen is %d/%d\n", __intVal(__INST(width)), __intVal(__INST(height))));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9368
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9369
    realDepth = GetDeviceCaps(__rootDC, BITSPIXEL);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9370
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9371
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9372
    __depth = 24;  /* its a hack */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9373
#else
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9374
    __depth = realDepth;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9375
    if (__depth == 15)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9376
	__depth = 16;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9377
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9378
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9379
#if 0
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9380
    numcolors = GetDeviceCaps(__rootDC, NUMCOLORS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9381
    numpens = GetDeviceCaps(__rootDC, NUMPENS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9382
    planes = GetDeviceCaps(__rootDC, PLANES);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9383
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9384
    DPRINTF(("screen has %d planes\n", planes));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9385
    DPRINTF(("numcolors is %d\n", numcolors));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9386
    DPRINTF(("numpens is %d\n", numpens));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9387
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9388
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9389
    __INST(depth) = __MKSMALLINT(__depth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9390
    __INST(ncells) = __MKSMALLINT(1<<__depth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9391
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9392
    val = GetDeviceCaps(__rootDC, HORZSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9393
    DPRINTF(("HORSIZE=%d\n",val));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9394
    __INST(widthMM) = __MKSMALLINT(val);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9395
    val = GetDeviceCaps(__rootDC, VERTSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9396
    DPRINTF(("VERTSIZE=%d\n",val));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9397
    __INST(heightMM) = __MKSMALLINT(val);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9398
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9399
    __logPixelSY = GetDeviceCaps(__rootDC, LOGPIXELSY);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9400
    capabilities = GetDeviceCaps(__rootDC, RASTERCAPS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9401
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9402
#ifdef LATER
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9403
    printf("device support:\n");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9404
    if (capabilities & RC_BANDING)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9405
	printf(" RC_BANDING");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9406
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9407
    if (capabilities & RC_BITBLT)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9408
	printf(" RC_BITBLT");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9409
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9410
    if (capabilities & RC_BITMAP64)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9411
	printf(" RC_BITMAP64");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9412
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9413
    if (capabilities & RC_DI_BITMAP)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9414
	printf(" RC_DI_BITMAP");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9415
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9416
    if (capabilities & RC_DIBTODEV)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9417
	printf(" RC_DIBTODEV");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9418
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9419
    if (capabilities & RC_FLOODFILL)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9420
	printf(" RC_FLOODFILL");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9421
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9422
    if (capabilities & RC_PALETTE)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9423
	printf(" RC_PALETTE");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9424
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9425
    if (capabilities & RC_SCALING)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9426
	printf(" RC_SCALING");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9427
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9428
    if (capabilities & RC_STRETCHBLT)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9429
	printf(" RC_STRETCHBLT");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9430
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9431
    if (capabilities & RC_STRETCHDIB)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9432
	printf(" RC_STRETCHDIB");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9433
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9434
    printf("\n");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9435
    printf("cursor size %d %d\n", GetSystemMetrics(SM_CXCURSOR), GetSystemMetrics(SM_CYCURSOR));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9436
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9437
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9438
    __INST(whitepixel) = __MKSMALLINT(WhitePixel);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9439
    __INST(blackpixel) = __MKSMALLINT(BlackPixel);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9440
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9441
    __INST(monitorType) = @symbol(unknown);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9442
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9443
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9444
    __INST(hasColors) = true;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9445
    __INST(hasGreyscales) = true;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9446
    __INST(visualType) = @symbol(TrueColor);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9447
    __INST(redShift) = __MKSMALLINT(0);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9448
    __INST(greenShift) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9449
    __INST(blueShift) = __MKSMALLINT(16);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9450
    switch (realDepth) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9451
	case 15:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9452
	case 16:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9453
	    __INST(bitsPerRGB) = __MKSMALLINT(5);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9454
	    break;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9455
	default:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9456
	    __INST(bitsPerRGB) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9457
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9458
    __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9459
    __INST(redMask) = __MKSMALLINT(0xFF);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9460
    __INST(greenMask) = __MKSMALLINT(0xFF00);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9461
    __INST(blueMask) = __MKSMALLINT(0xFF0000);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9462
#else
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9463
    if (! (capabilities & RC_PALETTE)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9464
	DPRINTF(("no palette\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9465
	if (__depth == 1) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9466
	    __INST(hasColors) = false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9467
	    __INST(hasGreyscales) = false;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9468
	    __INST(visualType) = @symbol(GrayScale);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9469
	    __INST(monitorType) = @symbol(monochrome);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9470
	} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9471
	    __INST(hasColors) = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9472
	    __INST(hasGreyscales) = true;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9473
	    if ((__depth == 16) || (__depth == 15)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9474
	      __INST(visualType) = @symbol(TrueColor);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9475
	      __INST(blueShift) = __MKSMALLINT(0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9476
	      __INST(greenShift) = __MKSMALLINT(5);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9477
	      __INST(redShift) = __MKSMALLINT(11);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9478
	      __INST(bitsPerRGB) = __MKSMALLINT(5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9479
	      __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9480
	      __INST(blueMask) = __MKSMALLINT(0x1f);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9481
	      __INST(greenMask) = __MKSMALLINT(0x7e0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9482
	      __INST(redMask) = __MKSMALLINT(0xf800);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9483
	    } else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9484
	      __INST(visualType) = @symbol(TrueColor);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9485
	      __INST(redShift) = __MKSMALLINT(0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9486
	      __INST(greenShift) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9487
	      __INST(blueShift) = __MKSMALLINT(16);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9488
	      __INST(bitsPerRGB) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9489
	      __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9490
	      __INST(redMask) = __MKSMALLINT(0xFF);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9491
	      __INST(greenMask) = __MKSMALLINT(0xFF00);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9492
	      __INST(blueMask) = __MKSMALLINT(0xFF0000);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9493
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9494
	}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9495
    } else {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9496
	val = GetDeviceCaps(__rootDC, SIZEPALETTE); /* First two entries are black and white. */
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  9497
	// printf("SizeofPalette %d\n",val);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9498
	__INST(ncells) = __MKSMALLINT(val);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9499
	__INST(blackpixel) = __MKSMALLINT(0);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9500
	__INST(whitepixel) = __MKSMALLINT(1);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9501
	__INST(hasColors) = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9502
	__INST(hasGreyscales) = true;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9503
	__INST(usingSystemPalette) = true;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9504
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9505
	__INST(redShift) = __MKSMALLINT(0);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9506
	__INST(greenShift) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9507
	__INST(blueShift) = __MKSMALLINT(4);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9508
	__INST(bitsPerRGB) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9509
	__INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9510
	__INST(redMask) = __MKSMALLINT(0x3);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9511
	__INST(greenMask) = __MKSMALLINT(0xc); 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9512
	__INST(blueMask) = __MKSMALLINT(0x30);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9513
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9514
#endif /* ! ALWAYSTRUECOLOR */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9515
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9516
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9517
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9518
initializeSpecialFlags
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9519
    "perform additional special server implementation flags"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9520
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9521
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9522
primInitializeFor:aDisplayName
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9523
    "initialize the receiver for a connection to a display;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9524
     the argument, aDisplayName may be nil (for the default display)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9525
     or the name of the display server as hostname:number
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9526
     (not yet under WIN32)"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9527
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9528
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9529
    RETURN ( __MKSMALLINT(1) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9530
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9531
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9532
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9533
reinitialize
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9534
    rootWin := rootDC := nil.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9535
    super reinitialize.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9536
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9537
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9538
!WinWorkstation methodsFor:'keyboard mapping'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9539
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9540
altModifierMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9541
    "return the mask (in motionEvents) for the alt-key modifier.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9542
     Notice: ST/X may use the left ALT key as CMD/Meta key,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9543
     therefore return a variable here, which can be changed during startup."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9544
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9545
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9546
    RETURN (__MKSMALLINT(AltMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9547
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9548
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9549
    "Created: 23.3.1996 / 12:43:22 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9550
    "Modified: 23.3.1996 / 12:44:56 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9551
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9552
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9553
leftAltMask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9554
    "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
  9555
     See comment in altModifierMask: / metaModifierMask: for what
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9556
     this could be used."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9557
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9558
%{  /* NOCONTEXT */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9559
    RETURN (__MKSMALLINT(LeftAltMask));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9560
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9561
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9562
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9563
metaModifierMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9564
    "return the mask (in motionEvents) for the meta-key modifier.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9565
     Notice: ST/X may use the left ALT key as CMD/Meta key,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9566
     therefore return a variable here, which can be changed during startup."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9567
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9568
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9569
    RETURN (__MKSMALLINT(MetaMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9570
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9571
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9572
    "Created: 23.3.1996 / 12:43:39 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9573
    "Modified: 23.3.1996 / 12:45:09 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9574
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9575
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9576
modifierMapping
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9577
    "Get the Modifier Mapping.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9578
     We return an array of arrays of keycodes"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9579
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9580
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9581
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9582
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9583
rightAltMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9584
    "return the mask bit for the right Alt modifier key.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9585
     See comment in altModifierMask: / metaModifierMask: for what
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9586
     this could be used."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9587
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9588
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9589
    RETURN (__MKSMALLINT(RightAltMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9590
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9591
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9592
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9593
stringFromKeycode:code
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9594
    "Get a KeySymbol (a smalltalk symbol) from the keycode."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9595
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9596
    ^ ''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9597
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9598
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9599
	Display stringFromKeycode:28
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9600
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9601
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9602
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9603
!WinWorkstation methodsFor:'misc'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9604
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9605
beep
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9606
    "output an audible beep"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9607
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  9608
%{  
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9609
    MessageBeep( MB_ICONEXCLAMATION);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9610
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9611
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9612
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9613
flush
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9614
    "send all buffered drawing to the display.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9615
     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
  9616
     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
  9617
     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
  9618
     (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
  9619
     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
  9620
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9621
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9622
     GdiFlush();
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9623
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9624
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9625
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9626
refreshKeyboardMapping:eB
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9627
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9628
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9629
setInputFocusTo:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9630
    self setInputFocusTo:aWindowId revertTo:nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9631
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9632
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9633
setInputFocusTo:aWindowId revertTo:revertSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9634
    "set the focus to the view as defined by aWindowId.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9635
     Passing nil set the focus to no window and lets the display discard all
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9636
     input until a new focus is set.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9637
     RevertSymbol specifies what should happen if the view becomes invisible;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9638
     passing one of #parent, #root or nil specifies that the focus should be
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9639
     given to the parent view, the root view or no view."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9640
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9641
%{  /* xxLIMITEDSTACK (WIN95 only) */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9642
    if (__isExternalAddress(aWindowId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9643
	HWND hWnd = _HWNDVal(aWindowId);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  9644
	int r = 0;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9645
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9646
	if (revertSymbol == @symbol(parent)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9647
	    r = 1;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9648
	} else if (revertSymbol == @symbol(root)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9649
	    r = 2;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9650
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9651
	if (hWnd) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9652
	    if (GetFocus() != hWnd) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9653
		CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9654
#ifdef SET_FOCUS_IN_WINTHREAD
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9655
		PostMessage(hWnd, WM_THREADSETFOCUS, (INT)hWnd, GetCurrentThreadId());
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9656
#else
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9657
		if (SetFocus(hWnd) == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9658
		    PRINTF(("SetFocus to %x failed.\n",hWnd));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9659
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9660
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9661
	    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9662
		CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r));
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  9663
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9664
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9665
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9666
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9667
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9668
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9669
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9670
!WinWorkstation methodsFor:'pointer queries '!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9671
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9672
anyButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9673
    "return an integer for masking out any button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9674
     buttonStates value."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9675
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9676
    "/ should use ``Display buttonXMotionMask bitOr:....''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9677
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9678
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9679
    RETURN ( __MKSMALLINT(Button1Mask|Button2Mask|Button3Mask) );
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9680
%}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9681
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9682
    "Modified: 23.3.1996 / 12:41:33 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9683
    "Created: 23.3.1996 / 12:46:35 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9684
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9685
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9686
buttonStates
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9687
    "return an integer representing the state of the pointer buttons;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9688
     a one-bit in positions 0.. represent a pressed button.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9689
     See the button1Mask/button2Mask/button3Mask,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9690
     shiftMask/controlMask and modifierMask methods for the meaning of the bits."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9691
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9692
    |s |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9693
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9694
%{
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9695
    int modifiers = 0;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9696
    int b1m = Button1Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9697
    int b3m = Button3Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9698
    if (GetSystemMetrics(SM_SWAPBUTTON))
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9699
    {
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9700
      b3m = Button1Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9701
      b1m = Button3Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9702
    }
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9703
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9704
    if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9705
	modifiers |= b1m;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9706
    if (GetAsyncKeyState(VK_MBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9707
	modifiers |= Button2Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9708
    if (GetAsyncKeyState(VK_RBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9709
	modifiers |= b3m;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9710
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9711
    s = __MKSMALLINT(modifiers);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9712
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9713
    ^ s
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9714
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9715
    "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9716
     Display buttonStates
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9717
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9718
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9719
    "is the control-key pressed ?
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9720
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9721
     Display buttonStates bitTest:(Display controlMask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9722
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9723
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9724
    "is the alt/meta-key pressed ?
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9725
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9726
     Display buttonStates bitTest:(Display altModifierMask)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9727
     Display buttonStates bitTest:(Display metaModifierMask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9728
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9729
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9730
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9731
leftButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9732
    "return an integer for masking out the left button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9733
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9734
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9735
    "/ should use ``Display button1MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9736
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9737
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9738
    RETURN ( __MKSMALLINT(Button1Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9739
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9740
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9741
    "Modified: 23.3.1996 / 12:41:33 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9742
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9743
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9744
middleButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9745
    "return an integer for masking out the middle button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9746
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9747
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9748
    "/ should use ``Display button2MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9749
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9750
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9751
    RETURN ( __MKSMALLINT(Button2Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9752
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9753
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9754
    "Modified: 23.3.1996 / 12:41:43 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9755
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9756
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9757
pointerPosition
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9758
    "return the current pointer position in root-window coordinates"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9759
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9760
%{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9761
    POINT p;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9762
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9763
    if (! GetCursorPos(&p)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9764
	p.x = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9765
	p.y = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9766
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9767
    RETURN (__MKPOINT_INT(p.x, p.y));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9768
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9769
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9770
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9771
rightButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9772
    "return an integer for masking out the right button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9773
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9774
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9775
    "/ should use ``Display button3MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9776
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9777
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9778
    RETURN ( __MKSMALLINT(Button3Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9779
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9780
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9781
    "Modified: 23.3.1996 / 12:41:52 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9782
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9783
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9784
rootPositionOfLastEvent
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9785
    "return the position in root-window coordinates
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9786
     of the last button, key or pointer event"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9787
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9788
%{
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9789
    RETURN (__MKPOINT_INT(evRootX, evRootY));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9790
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9791
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9792
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9793
setPointerPosition:newPosition
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9794
    "change the pointer position in root-window coordinates."
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9795
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9796
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9797
    if (__isPoint(newPosition)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9798
	OBJ xpos, ypos;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9799
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9800
	xpos = __point_X(newPosition);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9801
	ypos = __point_Y(newPosition);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9802
	if (__bothSmallInteger(xpos, ypos)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9803
	    SetCursorPos(__intVal(xpos), __intVal(ypos));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9804
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9805
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9806
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9807
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9808
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9809
setPointerPosition:newPosition in:aWindowId
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9810
    "change the pointer position to a new position relative to the
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9811
     given windows origin (which may be the rootWindow).
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9812
     Be careful with this - its usually not very ergonimically
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9813
     to change the mousePointer position.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9814
     This interface is provided for special applications (presentation
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9815
     playback) and should not be used in normal applications."
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9816
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9817
    self setCursorPosition:(self translatePoint:newPosition from:aWindowId to:rootView id).
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9818
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9819
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9820
!WinWorkstation methodsFor:'retrieving pixels'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9821
1461
6d8b022bfcd8 renamed getBitsFrom to getBitsFromId
Claus Gittinger <cg@exept.de>
parents: 1426
diff changeset
  9822
getBitsFromId:aDrawableId x:srcx y:srcy width:w height:h into:imageBits
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9823
    "get bits from a drawable into the imageBits. The storage for the bits
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9824
     must be big enough for the data to fit. If ok, returns an array with some
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9825
     info and the bits in imageBits. The info contains the depth, bitOrder and
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9826
     number of bytes per scanline. The number of bytes per scanline is not known
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9827
     in advance, since the X-server is free to return whatever it thinks is a good padding."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9828
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9829
    |rawInfo info|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9830
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9831
    ((w <= 0) or:[h <= 0]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9832
	self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9833
	^ nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9834
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9835
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9836
    rawInfo := Array new:8.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9837
		  "1 -> bit order"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9838
		  "2 -> depth"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9839
		  "3 -> bytes_per_line"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9840
		  "4 -> byte_order"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9841
		  "5 -> format"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9842
		  "6 -> bitmap_unit"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9843
		  "7 -> bitmap_pad"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9844
		  "8 -> bits_per_pixel"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9845
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9846
    "/ had to extract the getPixel call into a separate method, to specify
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9847
    "/ unlimitedStack (some implementations use alloca and require huge amounts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9848
    "/ of temporary stack space
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9849
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9850
    (self primGetBitsFrom:aDrawableId x:srcx y:srcy width:w height:h into:imageBits infoInto:rawInfo) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9851
	info := IdentityDictionary new.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9852
	info at:#bitOrder put:(rawInfo at:1).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9853
	info at:#depth put:(rawInfo at:2).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9854
	info at:#bytesPerLine put:(rawInfo at:3).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9855
	info at:#byteOrder put:(rawInfo at:4).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9856
	info at:#format put:(rawInfo at:5).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9857
	info at:#bitmapUnit put:(rawInfo at:6).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9858
	info at:#bitmapPad put:(rawInfo at:7).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9859
	info at:#bitsPerPixel put:(rawInfo at:8).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9860
	^ info
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9861
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9862
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9863
     some error occured - either args are not smallintegers, imageBits is not a ByteArray
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9864
     or is too small to hold the bits
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9865
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9866
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9867
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9868
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9869
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
  9870
    "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
  9871
     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
  9872
     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
  9873
     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
  9874
     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
  9875
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9876
    |rawInfo info|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9877
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9878
    ((w <= 0) or:[h <= 0]) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9879
	self primitiveFailed.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9880
	^ nil
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9881
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9882
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9883
    rawInfo := Array new:8.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9884
		  "1 -> bit order"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9885
		  "2 -> depth"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9886
		  "3 -> bytes_per_line"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9887
		  "4 -> byte_order"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9888
		  "5 -> format"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9889
		  "6 -> bitmap_unit"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9890
		  "7 -> bitmap_pad"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9891
		  "8 -> bits_per_pixel"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9892
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9893
    "/ 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
  9894
    "/ 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
  9895
    "/ of temporary stack space
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9896
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9897
    (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
  9898
	info := IdentityDictionary new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9899
	info at:#bitOrder put:(rawInfo at:1).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9900
	info at:#depth put:(rawInfo at:2).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9901
	info at:#bytesPerLine put:(rawInfo at:3).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9902
	info at:#byteOrder put:(rawInfo at:4).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9903
	info at:#format put:(rawInfo at:5).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9904
	info at:#bitmapUnit put:(rawInfo at:6).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9905
	info at:#bitmapPad put:(rawInfo at:7).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9906
	info at:#bitsPerPixel put:(rawInfo at:8).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9907
	^ info
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9908
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9909
    "
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9910
     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
  9911
     or is too small to hold the bits
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9912
    "
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9913
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9914
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9915
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9916
getPixelX:x y:y from:aDrawableId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9917
    "return the pixel value at x/y; coordinates start at 0/0 for the upper left.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9918
     Nil is returned for invalid coordinates or if any other problem arises."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9919
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9920
    'getPixelX:y:from: not yet implemented' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9921
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9922
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9923
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9924
primGetBitsFrom:aDrawableId x:srcX y:srcY width:w height:h into:imageBits infoInto:info
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9925
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9926
%{  /* xxLIMITEDSTACK */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9927
    int            height, width;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9928
    int            numBytes;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9929
    HWND        hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9930
    HBITMAP hBitmap = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9931
    HDC bDC = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9932
    struct
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9933
    {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9934
	BITMAPINFOHEADER bmiHeader;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9935
	DWORD r;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9936
	DWORD g;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9937
	DWORD b;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9938
    } bitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9939
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9940
    if (__isExternalAddress(aDrawableId)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9941
     && __bothSmallInteger(srcX, srcY)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9942
     && __bothSmallInteger(w, h)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9943
     && __isArray(info)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9944
     && __isByteArray(imageBits))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9945
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9946
	hWnd = _HWNDVal( aDrawableId );
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9947
	DPRINTF(("primGetBits %x\n",hWnd));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9948
	if( hWnd != 0 ) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9949
	    HDC wDC = GetDC(hWnd);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9950
	    bDC = CreateCompatibleDC(__rootDC);
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  9951
	    DPRINTF(("primGetBits srcX %d srcY %d w %d h %d\n",__intVal(srcX),__intVal(srcY),__intVal(w),__intVal(h)));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9952
	    height =  __intVal(h);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9953
	    width  =  __intVal(w);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9954
	    DPRINTF(("width %d height %d\n",width,height));
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  9955
	    hBitmap = CreateCompatibleBitmap(__rootDC,(width + 3 )/ 4 * 4 /*width*/,height);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9956
	    if (!hBitmap)
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  9957
		goto fail;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9958
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9959
	    bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9960
	    bitmap.bmiHeader.biPlanes = 1;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9961
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9962
	    bitmap.bmiHeader.biCompression = BI_RGB;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9963
#else
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  9964
	    if (__depth == 24) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  9965
		bitmap.bmiHeader.biCompression = BI_RGB;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  9966
	    } else if (__depth == 16) {
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9967
# if 0
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  9968
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  9969
		bitmap.b = 0x001f;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  9970
		bitmap.g = 0x07e0;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  9971
		bitmap.r = 0xf800;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9972
# else
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  9973
		bitmap.b = 0;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  9974
		bitmap.g = 0;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  9975
		bitmap.r = 0;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  9976
		bitmap.bmiHeader.biCompression = BI_RGB;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9977
# endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9978
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9979
#endif /* ALWAYSTRUECOLOR */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9980
	    bitmap.bmiHeader.biSizeImage = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9981
	    bitmap.bmiHeader.biXPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9982
	    bitmap.bmiHeader.biYPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9983
	    bitmap.bmiHeader.biClrUsed = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9984
	    bitmap.bmiHeader.biClrImportant = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9985
	    bitmap.bmiHeader.biBitCount = __depth;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9986
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  9987
	    bitmap.bmiHeader.biWidth = (width + 3 )/ 4 * 4; // width;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9988
	    bitmap.bmiHeader.biHeight = -height;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9989
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9990
	    SelectObject(bDC,hBitmap);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9991
	    if (BitBlt(bDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9992
		   0,0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9993
		   width,height,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9994
		   wDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9995
		   __intVal(srcX), __intVal(srcY),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9996
		   SRCCOPY)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9997
		 == 0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9998
		)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9999
	    {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10000
		INFOPRINT((stderr, "WinWorkstation [warning]: in primGetBitsFrom: BitBlt\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10001
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10002
	    ReleaseDC(hWnd,wDC);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10003
	    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
 10004
	    {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10005
		INFOPRINT((stderr, "WinWorkstation [warning]: noinfo returned in primGetBits\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10006
		goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10007
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10008
	    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
 10009
	    numBytes = bitmap.bmiHeader.biSizeImage;
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10010
	    if( numBytes != 0 ) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10011
		char *cp = __ByteArrayInstPtr(imageBits)->ba_element;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10012
		int n = numBytes;
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10013
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10014
		if (numBytes > __byteArraySize(imageBits)) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10015
		    /* imageBits too small */
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10016
		    INFOPRINT((stderr, "WinWorkstation [warning]: primGetBits - provided byteArray too small\n"));
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10017
		    goto fail;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10018
		}
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10019
		DPRINTF(("numBytes %d\n",numBytes));
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10020
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10021
		bitmap.bmiHeader.biHeight = -height;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10022
		if (GetDIBits(bDC,hBitmap,0,height,__ByteArrayInstPtr(imageBits)->ba_element,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10023
		{
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10024
		    INFOPRINT((stderr, "WinWorkstation [warning]: zero bits returned in primGetBits\n"));
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10025
		    goto fail;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10026
		}
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10027
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10028
		/* swap red and blue (windows delivers BGR) */
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10029
		for ( ;n > 0; n -= 3, cp += 3) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10030
		      char b = cp[0];
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10031
		      cp[0] = cp[2];
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10032
		      cp[2] = b;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10033
		}
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10034
	    } else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10035
		INFOPRINT((stderr, "WinWorkstation [warning]: unacceptable bitmap in primGetBits\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10036
		goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10037
	    }
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10038
	} else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10039
	    INFOPRINT((stderr, "WinWorkstation [warning]: unacceptable bitmap in primGetBits\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10040
	    goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10041
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10042
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10043
	__ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10044
	__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(1);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10045
	__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
 10046
	__ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10047
	__ArrayInstPtr(info)->a_element[4] = @symbol(XYPixmap);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10048
	__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10049
	__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(WIN32PADDING);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10050
	__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(bitmap.bmiHeader.biBitCount);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10051
	if (bDC)
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10052
	    DeleteDC(bDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10053
	if (hBitmap)
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10054
	    _DeleteObject(hBitmap);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10055
	RETURN ( true );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10056
    }
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10057
fail: ;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10058
    if (bDC)
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10059
	DeleteDC(bDC);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10060
    if (hBitmap)
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10061
	_DeleteObject(hBitmap);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10062
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10063
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10064
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10065
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10066
primGetBitsFromPixmap:aDrawableId x:srcX y:srcY width:w height:h into:imageBits infoInto:info
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10067
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10068
%{  /* xxLIMITEDSTACK */
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10069
    int            height, width;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10070
    int            numBytes;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10071
    unsigned char* ep = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10072
    HBITMAP        xBitmap;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10073
    HBITMAP hBitmap = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10074
    HDC bDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10075
    HDC xDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10076
    struct
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10077
    {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10078
	BITMAPINFOHEADER bmiHeader;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10079
	DWORD rgb[2];
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10080
    } bitmap;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10081
    BITMAP bitmapInfo;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10082
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10083
    if (__isExternalAddress(aDrawableId)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10084
     && __bothSmallInteger(srcX, srcY)
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10085
     && __bothSmallInteger(w, h)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10086
     && __isArray(info)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10087
     && __isByteArray(imageBits))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10088
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10089
	xBitmap = _HBITMAPVAL( aDrawableId );
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10090
	DPRINTF(("primGetBitsFromPixmap %x\n",xBitmap));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10091
	if( xBitmap != 0 )
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10092
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10093
	    xDC = GetDC(0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10094
	    SelectObject(xDC,xBitmap);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10095
	    GetObject(xBitmap,sizeof(bitmapInfo),&bitmapInfo);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10096
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10097
	    bDC = CreateCompatibleDC(__rootDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10098
	    DPRINTF(("srcX %d srcY %d w %d h %d\n",__intVal(srcX),__intVal(srcY),__intVal(w),__intVal(h)));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10099
	    height =  __intVal(h);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10100
	    width  =  __intVal(w);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10101
	    DPRINTF(("width %d height %d\n",width,height));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10102
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10103
	    hBitmap = CreateCompatibleBitmap(xDC,width,height);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10104
	    if (!hBitmap)
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10105
		goto fail;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10106
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10107
	    SelectObject(bDC,hBitmap);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10108
	    if (BitBlt(bDC,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10109
		   0,0,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10110
		   width,height,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10111
		   xDC,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10112
		   __intVal(srcX), __intVal(srcY),
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10113
		   SRCCOPY)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10114
		 == 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10115
		)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10116
	    {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10117
		 DPRINTF(("ERROR in primGetBitsFromPixmap: BitBlt\n"));
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10118
		 goto fail;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10119
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10120
	    bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10121
	    bitmap.bmiHeader.biPlanes = 1;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10122
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10123
	    bitmap.bmiHeader.biCompression = BI_RGB;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10124
#else
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10125
	    if (__depth == 24) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10126
		/*bitmap.bmiHeader.biCompression = BI_BITFIELDS;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10127
		bitmap.r = 0xff0000;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10128
		bitmap.g = 0x00ff00;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10129
		bitmap.b = 0x0000ff;*/
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10130
		bitmap.bmiHeader.biCompression = BI_RGB;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10131
	    } else if (__depth == 16) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10132
		/*bitmap.bmiHeader.biCompression = BI_RGB;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10133
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10134
		bitmap.b = 0x001f;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10135
		bitmap.g = 0x07e0;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10136
		bitmap.r = 0xf800;*/
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10137
		bitmap.bmiHeader.biCompression = BI_RGB;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10138
	    } else {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10139
		DPRINTF(("primGetBitsFromPixmap: unsupported depth\n"));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10140
		got fail;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10141
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10142
#endif /* ALWAYSTRUECOLOR */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10143
	    bitmap.bmiHeader.biSizeImage = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10144
	    bitmap.bmiHeader.biXPelsPerMeter = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10145
	    bitmap.bmiHeader.biYPelsPerMeter = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10146
	    bitmap.bmiHeader.biClrUsed = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10147
	    bitmap.bmiHeader.biClrImportant = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10148
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10149
	    bitmap.bmiHeader.biWidth = width;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10150
	    bitmap.bmiHeader.biHeight = -height;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10151
	    bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10152
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10153
	    if (GetDIBits(bDC,hBitmap,0,height,0,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10154
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10155
		DPRINTF(("noinfo returned\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10156
		goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10157
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10158
	    DPRINTF(("bitmap info:%d %d %d %d\n",bitmap.bmiHeader.biWidth,bitmap.bmiHeader.biHeight,bitmap.bmiHeader.biBitCount,bitmap.bmiHeader.biSizeImage));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10159
	    numBytes = bitmap.bmiHeader.biSizeImage;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10160
	    if ( numBytes != 0 ) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10161
		if (numBytes > __byteArraySize(imageBits)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10162
		    /* imageBits too small */
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10163
		    DPRINTF(("provided byteArray too small\n"));
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10164
		    goto fail;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10165
		}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10166
		DPRINTF(("numBytes %d\n",numBytes));
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10167
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10168
		bitmap.bmiHeader.biHeight = -height;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10169
		bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel; /*__depth;*/
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10170
		bitmap.rgb[0] = 0;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10171
		bitmap.rgb[1] = 0xffffff;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10172
		if (GetDIBits(xDC,xBitmap,0,height,__ByteArrayInstPtr(imageBits)->ba_element,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10173
		{
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10174
		    DPRINTF(("zero bits returned\n"));
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10175
		    goto fail;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10176
		}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10177
	    } else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10178
		DPRINTF(("unacceptable bitmap\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10179
		goto fail;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10180
	    }
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10181
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10182
	else
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10183
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10184
	    DPRINTF(("unacceptable bitmap\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10185
	    goto fail;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10186
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10187
	__ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10188
	__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(1);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10189
	__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
 10190
	__ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10191
	__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
 10192
	__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10193
	__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(WIN32PADDING);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10194
	__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(bitmap.bmiHeader.biBitCount);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10195
	if (bDC)
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10196
	    DeleteDC(bDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10197
	if (xDC)
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10198
	    ReleaseDC(0,xDC);//DeleteDC(xDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10199
	if (hBitmap)
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10200
	    _DeleteObject(hBitmap);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10201
	RETURN ( true );
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10202
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10203
fail:
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10204
    if (bDC)
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10205
	DeleteDC(bDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10206
    if (xDC)
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10207
	ReleaseDC(0,xDC);//DeleteDC(xDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10208
    if (hBitmap)
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10209
	_DeleteObject(hBitmap);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10210
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10211
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10212
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10213
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10214
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10215
!WinWorkstation methodsFor:'selections'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10216
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10217
getClipboardData
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10218
%{
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10219
    HANDLE hClip;
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10220
    HANDLE hData;
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10221
    OBJ s;
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10222
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10223
    hClip = OpenClipboard(NULL);
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10224
    if (hClip) {
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10225
	hData = GetClipboardData(CF_TEXT);
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10226
	CloseClipboard();
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10227
	INFOPRINT((stderr, "WinWorkstation [info]: clipBoard data is <%s>\n", (char *)hData));
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10228
	s = __MKSTRING( (char *)hData );
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10229
	RETURN(s);
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10230
    }
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10231
    RETURN(nil);
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10232
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10233
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10234
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10235
getSelectionFor:drawableId
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10236
    'WinWorkstation [warning]:getSelectionFor: not yet implemented' errorPrintCR.
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10237
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10238
    ^ nil
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10239
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10240
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10241
setClipboardData:aString  
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10242
%{
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10243
    HANDLE hClip;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10244
    HANDLE hData;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10245
    char *s;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10246
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10247
    if (__isString(aString)) {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10248
	s = __stringVal(aString);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10249
	hClip = OpenClipboard(NULL);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10250
	if (hClip) {
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10251
	    EmptyClipboard();
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10252
	    hData = GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE,strlen(s)+1);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10253
	    if (hData) {
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10254
		char *t = GlobalLock(hData);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10255
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10256
		if (t) {
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10257
		    strcpy(t,s);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10258
		    //printf("setClipboardData:>%s<\n",t);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10259
		    GlobalUnlock(hData);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10260
		    if (SetClipboardData(CF_TEXT,hData) == 0) {
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10261
			DPRINTF(("SetClipboardData error:%d\n",GetLastError()));
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10262
		    }
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10263
		}
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10264
	    }
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10265
	    CloseClipboard();
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10266
	    RETURN(self);
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10267
	}
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10268
	RETURN(nil);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10269
    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10270
%}.
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10271
    self primitiveFailed.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10272
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10273
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10274
!WinWorkstation methodsFor:'style defaults'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10275
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10276
defaultStyleValueFor:aKey
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10277
    "return a default style value, given a key.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10278
     These defaults are used if nothing is specified
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10279
     in the style sheet
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10280
     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
 10281
     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
 10282
     where the systemDefaults are used ..."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10283
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10284
    <resource: #style (#viewSpacing
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10285
		       #borderColor #borderWidth
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10286
		       #viewBackground #shadowColor #lightColor
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10287
		      )>
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10288
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10289
    |clr|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10290
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10291
"/    aKey == #shadowColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10292
"/        ^ Color black
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10293
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10294
"/    aKey == #lightColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10295
"/        ^ Color white
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10296
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10297
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10298
    aKey == #viewBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10299
	clr := self getSystemColor:#COLOR_WINDOW.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10300
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10301
    aKey == #textForegroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10302
	clr := self getSystemColor:#COLOR_WINDOWTEXT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10303
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10304
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10305
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10306
"/    aKey == #scrollerViewBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10307
"/        ^ Color white
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10308
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10309
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10310
"/    aKey == #textBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10311
"/        ^ Color white.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10312
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10313
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10314
    clr notNil ifTrue:[^ clr].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10315
    ^ super defaultStyleValueFor:aKey
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10316
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10317
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10318
!WinWorkstation methodsFor:'window stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10319
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10320
activateWindow:aWindowId
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10321
    "make a window active"
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10322
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10323
%{  /* xxLIMITEDSTACK */
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10324
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10325
    if (__isExternalAddress(aWindowId)) {
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10326
	HWND win = _HWNDVal(aWindowId);
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10327
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10328
	if (win) {
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10329
	    CPRINTF(("activateWindow %x\n",win));
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10330
	    ShowWindowAsync(win, SW_SHOW | SW_SHOWNORMAL);
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10331
	    //ShowWindow(win, SW_SHOW);
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10332
	    //SetWindowPos(_thread_newWinHandle, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW|/*SWP_NOACTIVATE|*/SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER);
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
 10333
	    //enqEvent(ENQ_AT_END, 0,win, WM_SHOWWINDOW, TRUE, 0, 0, 0, 0);
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10334
	}
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10335
	RETURN ( self );
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10336
    }
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10337
%}
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10338
!
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10339
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10340
clearRectangleX:x y:y width:width height:height in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10341
    "clear a rectangular area to viewbackground"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10342
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10343
    DPRINTF(("clearRect\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10344
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10345
    super clearRectangleX:x y:y width:width height:height in:aWindowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10346
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10347
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10348
clearWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10349
    "clear a window to viewbackground"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10350
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10351
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10352
    DPRINTF(("clearWin\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10353
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10354
    super clearWindow:aWindowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10355
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10356
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10357
configureWindow:aWindowId sibling:siblingId stackMode:modeSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10358
    "configure stacking operation of aWindowId w.r.t siblingId"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10359
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10360
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10361
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10362
dropFilesWindow:aWindowId accept:doAccept
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10363
    "window accept Files from Shell"
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10364
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10365
%{  /* xxLIMITEDSTACK (WIN95 only) */
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10366
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10367
    if (__isExternalAddress(aWindowId)) {
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10368
	HWND hWnd = _HWNDVal(aWindowId);
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10369
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10370
	if (hWnd) {
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10371
	    if (doAccept == true)
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10372
		DragAcceptFiles(hWnd,TRUE);
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10373
	    else
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10374
		DragAcceptFiles(hWnd,FALSE);
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10375
	}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10376
	RETURN ( self );
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10377
    }
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10378
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10379
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10380
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10381
lowerWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10382
    "bring a window to back"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10383
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10384
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10385
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10386
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10387
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10388
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10389
	if (win)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10390
	{
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 10391
	    CPRINTF(("lowerWindow %x\n",win));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10392
	    SetWindowPos(win, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE|SWP_NOSIZE);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10393
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10394
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10395
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10396
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10397
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10398
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10399
mapView:aView id:aWindowId iconified:aBoolean atX:x y:y width:w height:h minExtent:minExt maxExtent:maxExt
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10400
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10401
    "make a window visible - either as icon or as a real view - needed for restart"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10402
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10403
    "/ 'mapView:id:iconified:...height: not yet implemented' errorPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10404
%{  /* xxLIMITEDSTACK */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10405
    RECT rec;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10406
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10407
     && __bothSmallInteger(x, y)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10408
     && __bothSmallInteger(w, h)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10409
	HWND win = _HWNDVal(aWindowId);
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10410
	int bw;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10411
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10412
	if (win)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10413
	{
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10414
	    bw = GetWindow_bw(win);
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10415
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10416
	    rec.left = __intVal(x) + bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10417
	    rec.top = __intVal(y) + bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10418
	    rec.right = rec.left + __intVal(w) - bw - bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10419
	    rec.bottom = rec.top + __intVal(h) - bw - bw;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10420
#ifdef ADJUSTWINDOW
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10421
	    AdjustWindowRectEx(&rec,GetWindowLong(win,GWL_STYLE),0,GetWindowLong(win,GWL_EXSTYLE));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10422
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10423
	    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
 10424
			 rec.right - rec.left, rec.bottom - rec.top));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10425
	    SetWindowPos(win, (HWND)0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10426
			 rec.left, rec.top,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10427
			 rec.right - rec.left, rec.bottom - rec.top,
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10428
			 SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOZORDER|SWP_NOOWNERZORDER);
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10429
	    if (aBoolean == true) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10430
		ShowWindow(win, SW_SHOWMINIMIZED);
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
 10431
		enqEvent(ENQ_AT_END, 0,win, WM_SHOWWINDOW, FALSE, 0, 0, 0, 0);
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10432
	    } else {
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
 10433
		enqEvent(ENQ_AT_END, 0,win, WM_SHOWWINDOW, TRUE, 0, 0, 0, 0);
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10434
		//ShowWindow(win, SW_RESTORE);
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10435
		ShowWindow(win, SW_SHOWNOACTIVATE);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10436
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10437
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10438
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10439
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10440
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10441
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10442
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10443
mapWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10444
    "make a window visible"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10445
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10446
%{  /* xxLIMITEDSTACK */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10447
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10448
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10449
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10450
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10451
	if (win) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 10452
	    CPRINTF(("mapWindow %x\n",win));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10453
	    ShowWindow(win, SW_SHOWNOACTIVATE);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10454
	    //ShowWindow(win, SW_SHOW);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 10455
	    SetWindowPos(win, HWND_TOP, 0, 0, 0, 0, SWP_NOSENDCHANGING|/*SWP_SHOWWINDOW|*/SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE/*|SWP_NOZORDER|SWP_NOOWNERZORDER */      );
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
 10456
	    //enqEvent(ENQ_AT_END, 0,win, WM_SHOWWINDOW, TRUE, 0, 0, 0, 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10457
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10458
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10459
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10460
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10461
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10462
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10463
moveResizeWindow:aWindowId x:x y:y width:w height:h
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10464
    "move and resize a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10465
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10466
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10467
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10468
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10469
     && __bothSmallInteger(x, y)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10470
     && __bothSmallInteger(w, h)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10471
	HWND win = _HWNDVal(aWindowId);
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10472
	int bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10473
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10474
	if (win) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10475
	    bw = GetWindow_bw(win);
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10476
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10477
	    rec.left = __intVal(x) + bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10478
	    rec.top = __intVal(y) + bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10479
	    rec.right = rec.left + __intVal(w) - bw - bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10480
	    rec.bottom = rec.top + __intVal(h) - bw - bw;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10481
#ifdef ADJUSTWINDOW
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10482
	    AdjustWindowRectEx(&rec,GetWindowLong(win,GWL_STYLE),0,GetWindowLong(win,GWL_EXSTYLE));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10483
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10484
	    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
 10485
			 rec.right - rec.left, rec.bottom - rec.top));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10486
	    SetWindowPos(win, (HWND)0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10487
			 rec.left, rec.top,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10488
			 rec.right - rec.left, rec.bottom - rec.top,
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10489
			 SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOZORDER|SWP_NOOWNERZORDER);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10490
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10491
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10492
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10493
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10494
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10495
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10496
moveWindow:aWindowId x:x y:y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10497
    "move a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10498
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10499
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10500
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10501
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10502
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10503
     && __bothSmallInteger(x, y)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10504
	HWND win = _HWNDVal(aWindowId);
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10505
	int bw;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10506
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10507
	if (win) {
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10508
	    bw = GetWindow_bw(win);
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10509
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10510
	    rec.left = __intVal(x) + bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10511
	    rec.top = __intVal(y) + bw;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10512
	    rec.right = rec.left + 10;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10513
	    rec.bottom = rec.top + 10;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10514
#ifdef ADJUSTWINDOW
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10515
	    AdjustWindowRectEx(&rec,GetWindowLong(win,GWL_STYLE),0,GetWindowLong(win,GWL_EXSTYLE));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10516
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10517
	    CPRINTF(("move %x x:%d y:%d -> x:%d y:%d\n",win,__intVal(x),__intVal(y),rec.left,rec.top));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10518
	    SetWindowPos(win, (HWND)0,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10519
			 rec.left, rec.top,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10520
			 0, 0,
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10521
			 SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER|SWP_NOOWNERZORDER);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10522
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10523
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10524
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10525
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10526
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10527
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10528
primSetWindowIconId:wiconId maskId:wmaskId width:wiconWidth height:wiconHeight in:aWindowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10529
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10530
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10531
    HBITMAP        xBitMap, maskBitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10532
    ICONINFO       iconInfo;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10533
    int            height, width;
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10534
    HICON          xIcon = (HICON)0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10535
    unsigned char  *allocatedBits = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10536
    unsigned char  fastBits[10000];
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10537
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10538
    DPRINTF(("primSetWindowIconId\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10539
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10540
     && __isExternalAddress(wiconId)
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10541
     && __bothSmallInteger(wiconWidth, wiconHeight)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10542
	HWND win = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10543
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10544
	xBitMap = _HBITMAPVAL( wiconId );
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10545
	if ( xBitMap != 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10546
	    BITMAP bm;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10547
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10548
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10549
		BYTE *ep;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10550
		int privateMask = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10551
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10552
		DPRINTF(("Bitmap w:%d h:%d p:%d d:%d\n",bm.bmWidth,bm.bmHeight,bm.bmPlanes,bm.bmBitsPixel));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10553
		height = __intVal( wiconHeight );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10554
		width  = __intVal( wiconWidth  );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10555
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10556
		if ( __isExternalAddress(wmaskId) ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10557
		    maskBitmap = _HBITMAPVAL( wmaskId );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10558
		} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10559
		    if (wmaskId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10560
			PRINTF(("WinWorkstat [warning]: wmaskId is not an external address\n"));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10561
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10562
		    maskBitmap = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10563
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10564
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10565
		/*
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10566
		 * if there is no mask, generate one
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10567
		 */
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10568
		if (maskBitmap == 0) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10569
		    int nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10570
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10571
		    nBytes = ( width + 31 ) / 8;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10572
		    nBytes = height * nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10573
		    if (nBytes < sizeof(fastBits)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10574
			ep = fastBits;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10575
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10576
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10577
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10578
		    if ( ep == 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10579
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10580
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10581
			memset(ep, 0, nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10582
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10583
			if ( maskBitmap == NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10584
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10585
			} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10586
			    privateMask = 1;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10587
			}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10588
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10589
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10590
		if ( maskBitmap != NULL ) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10591
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10592
		    iconInfo.fIcon = TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10593
		    iconInfo.hbmMask  =maskBitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10594
		    iconInfo.hbmColor = xBitMap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10595
		    xIcon = CreateIconIndirect( &iconInfo );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10596
		    DPRINTF(( "ICON CREATED!!!\n" ));
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10597
		    if (privateMask) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10598
			_DeleteObject( maskBitmap );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10599
		    } 
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10600
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10601
		    PRINTF(( "WinWorkstat [warning]: no mask for icon !\n" ));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10602
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10603
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10604
		if (allocatedBits) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10605
		    free(allocatedBits);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10606
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10607
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10608
	} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10609
	    DPRINTF(("WinWorkstat [warning]: xBitMap is zero \n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10610
	}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10611
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10612
	if (xIcon) {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 10613
#ifndef TOPWINDOWCLASS
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10614
	    HICON yIcon = (HICON)0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10615
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10616
	    yIcon = (HICON)GetClassLong(win, GCL_HICON);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10617
	    SetClassLong(win,GCL_HICON,(DWORD)xIcon);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10618
/* It has to be checked whether this can be deleted!!!!! */
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10619
	    if ( yIcon ) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10620
		if( DestroyIcon( yIcon ) )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10621
		    DPRINTF(( "Old icon deleted\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10622
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 10623
#else
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10624
	    SendMessage(_thread_newWinHandle, WM_SETICON,ICON_SMALL, (LPARAM)xIcon);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10625
	    SendMessage(_thread_newWinHandle, WM_SETICON,ICON_BIG, (LPARAM)xIcon);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 10626
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10627
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10628
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10629
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10630
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10631
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10632
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10633
raiseWindow:aWindowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10634
    "bring a window to front"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10635
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10636
%{  /* xxLIMITEDSTACK (WIN95 only) */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10637
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10638
    if (__isExternalAddress(aWindowId)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10639
	HWND hWnd = _HWNDVal(aWindowId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10640
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10641
	if (hWnd) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 10642
	    CPRINTF(("raiseWindow %x\n",hWnd));
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10643
#if 0
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10644
	    SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, /*SWP_NOOWNERZORDER  |*/SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOMOVE|SWP_NOSIZE);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10645
#else
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10646
	    BringWindowToTop(hWnd);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10647
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10648
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10649
	RETURN ( self );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10650
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10651
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10652
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10653
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10654
resizeWindow:aWindowId width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10655
    "resize a window"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10656
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10657
%{  /* xxLIMITEDSTACK (WIN95 only) */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10658
    RECT rec;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10659
    if (__isExternalAddress(aWindowId)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10660
     && __bothSmallInteger(w, h)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10661
	HWND hWnd = _HWNDVal(aWindowId);
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10662
	int bw;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10663
2593
1d2dad16f32c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2554
diff changeset
 10664
	if (hWnd) {
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10665
	    bw = GetWindow_bw(hWnd);
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10666
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10667
	    rec.left = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10668
	    rec.top = 0;
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10669
	    rec.right = __intVal(w) - bw - bw;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10670
	    rec.bottom = __intVal(h) - bw - bw;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10671
#ifdef ADJUSTWINDOW
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10672
	    AdjustWindowRectEx(&rec,GetWindowLong(hWnd,GWL_STYLE),0,GetWindowLong(hWnd,GWL_EXSTYLE));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10673
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10674
	    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
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10675
	    SetWindowPos(hWnd, (HWND)0,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10676
			 0, 0,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10677
			 rec.right - rec.left, rec.bottom - rec.top,
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10678
			 SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER|SWP_NOOWNERZORDER);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10679
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10680
	RETURN ( self );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10681
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10682
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10683
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10684
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10685
setBackingStore:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10686
    "turn on/off backing-store for a window"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10687
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10688
    'WinWorkstation [info]: setBackingStore:in: not yet implemented' errorPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10689
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10690
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10691
setBitGravity:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10692
    "set bit gravity for a window"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10693
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10694
    "/ 'setBitGravity:in: not yet implemented' errorPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10695
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10696
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10697
setCursor:aCursorId in:aWindowId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10698
    "define a windows cursor
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10699
     Ignored here, since in windows, an application
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10700
     has to manage the cursor itself."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10701
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10702
%{  /* xxLIMITEDSTACK (WIN95 only) */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 10703
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 10704
    HCURSOR newCursor;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 10705
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 10706
    if (ISCONNECTED
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 10707
     && __isExternalAddress(aWindowId)
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 10708
     && __isExternalAddress(aCursorId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10709
	HWND win = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10710
	POINT p;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10711
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
 10712
	/*printf("setCursor:in:\n");*/
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10713
	SetWindow_Cursor(win, _HCURSORVal(aCursorId));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10714
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10715
	/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10716
	 * if the pointer is currently in that window ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10717
	 */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10718
	GetCursorPos(&p);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10719
	if (WindowFromPoint(p) == win) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10720
#ifdef SET_CURSOR_IN_WINTHREAD
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10721
	    PostMessage(win, WM_THREADSETCURSOR, 0, (INT)_HCURSORVal(aCursorId));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10722
#else
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10723
	    SetCursor(_HCURSORVal(aCursorId));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10724
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10725
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 10726
	RETURN ( self );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 10727
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10728
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10729
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10730
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10731
setIconName:aString in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10732
    "define a windows iconname"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10733
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10734
%{  /* xxLIMITEDSTACK (WIN95 only) */
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10735
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10736
#if 0
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10737
    if (__isExternalAddress(aWindowId)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10738
     && (__isString(aString) || __isSymbol(aString))) {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10739
	HWND win = _HWNDVal(aWindowId);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10740
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10741
	SetWindowText(win, __stringVal(aString));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10742
	RETURN (self);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10743
    }
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10744
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10745
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10746
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10747
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10748
setSaveUnder:yesOrNo in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10749
    "turn on/off save-under for a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10750
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10751
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10752
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10753
setTransient:aWindowId for:aMainWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10754
    "set aWindowId to be a transient of aMainWindow"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10755
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10756
%{  /* NOCONTEXT */
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10757
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10758
    if (__isExternalAddress(aWindowId)) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10759
	HWND w;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10760
	HWND cw = _HWNDVal(aWindowId);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10761
	if ((aMainWindowId == nil) || (aMainWindowId == __MKSMALLINT(0))) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10762
	    w = (HWND) 0;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10763
	} else {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10764
	    if (__isExternalAddress(aMainWindowId)) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10765
		w = _HWNDVal(aMainWindowId);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10766
	    } else {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10767
		goto getOutOfHere;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10768
	    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10769
	}
2417
1e40a40e56e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2416
diff changeset
 10770
	CPRINTF(("setTransient:%x for:%x\n",cw,w));
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10771
	//SetParent(cw, w);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10772
	RETURN ( self );
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10773
    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10774
 getOutOfHere: ;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10775
%}.
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10776
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10777
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10778
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10779
setWindowBackground:aColorIndex in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10780
    "set the windows background color. This is the color with which
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10781
     the view is filled whenever exposed. Do not confuse this with
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10782
     the background drawing color, which is used with opaque drawing."
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10783
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10784
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10785
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10786
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10787
     && (__isSmallInteger(aColorIndex))) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10788
	HWND hWnd = _HWNDVal(aWindowId);
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10789
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10790
	/*HBRUSH hBrush = CreateSolidBrush(st2RGB(__intVal(aColorIndex),0));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10791
	if (GetWindow_bgBrush(hWnd))
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10792
	    _DeleteObject(GetWindow_bgBrush(hWnd));*/
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10793
	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
 10794
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10795
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10796
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10797
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10798
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10799
setWindowBackgroundPixmap:aPixmapId in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10800
    "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
 10801
     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
 10802
     Do not confuse this with the background drawing color, which is used
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10803
     with opaque drawing."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10804
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10805
%{  /* NOCONTEXT */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10806
    DPRINTF(("WinWorkstation [info]: setWindowBackgroundPixmap:in: not yet implemented\n"));
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10807
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10808
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10809
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10810
setWindowBorderColor:aColorIndex in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10811
    "set the windows border color"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10812
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10813
%{  /* NOCONTEXT */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10814
    DPRINTF(("WinWorkstation [info]: setWindowBorderColor:in: not yet implemented\n"));
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10815
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10816
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10817
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10818
setWindowBorderPixmap:aPixmapId in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10819
    "set the windows border pattern"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10820
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10821
%{  /* NOCONTEXT */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10822
    DPRINTF(("WinWorkstation [info]: setWindowBorderPixmap:in: not yet implemented\n"));
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10823
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10824
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10825
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10826
setWindowBorderWidth:aNumber in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10827
    "set the windows border width"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10828
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10829
%{  /* NOCONTEXT */
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10830
    int bw = (aNumber == __MKSMALLINT(0)) ? 0 : 1;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10831
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10832
    if (__isExternalAddress(aWindowId)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10833
	HWND win = _HWNDVal(aWindowId);
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10834
	int gwl;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10835
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10836
	gwl = GetWindowLong(win, GWL_STYLE);
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10837
	if (gwl & WS_CHILD) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10838
	    SetWindow_bw(win, bw);
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10839
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10840
	    if (bw) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10841
		gwl |= WS_BORDER;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10842
	    } else {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10843
		gwl &= ~WS_BORDER;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10844
	    }
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10845
	    SetWindowLong(win, GWL_STYLE, gwl);
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 10846
#if 0
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 10847
	    PostMessage(win,WM_NCPAINT,0,0);
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 10848
#endif
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10849
	}
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 10850
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10851
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10852
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10853
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10854
setWindowClass:wClass name:wName in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10855
    "define class and name of a window.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10856
     This may be used by the window manager to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10857
     select client specific resources."
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10858
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10859
%{  /* NOCONTEXT */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10860
    DPRINTF(("WinWorkstation [info]: setWindowClass:name:in: not yet implemented\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10861
%}.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10862
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10863
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10864
setWindowGravity:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10865
    "set window gravity for a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10866
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10867
%{  /* NOCONTEXT */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10868
    DPRINTF(("WinWorkstation [info]: setWindowGravity:in: not yet implemented\n"));
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10869
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10870
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10871
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10872
setWindowIcon:aForm in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10873
    "define a bitmap to be used as icon"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10874
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10875
    self
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10876
	setWindowIcon:aForm 
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10877
	mask:nil 
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10878
	in:aWindowId
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10879
!
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10880
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10881
setWindowIcon:aForm mask:aMaskForm in:aWindowId
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10882
    "set a windows icon & iconMask"
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10883
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10884
    |wiconId wmaskId wiconHeight wiconWidth|
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10885
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10886
    aForm notNil ifTrue:[
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10887
	wiconId := aForm id.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10888
	wiconHeight := aForm height.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10889
	wiconWidth  := aForm width.
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10890
	aMaskForm notNil ifTrue:[
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10891
	    wmaskId := aMaskForm id
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10892
	].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10893
	self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10894
	    primSetWindowIconId:wiconId
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 10895
	    maskId:wmaskId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10896
	    width:wiconWidth
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10897
	    height:wiconHeight
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10898
	    in:aWindowId
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10899
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10900
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10901
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10902
setWindowIconWindow:aView in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10903
    "define a window to be used as icon"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10904
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10905
    'WinWorkstation [info]: setWindowIconWindow:in: not yet implemented' infoPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10906
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10907
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10908
setWindowName:aString in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10909
    "define a windows name"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10910
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10911
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10912
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10913
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10914
     && (__isString(aString) || __isSymbol(aString))) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10915
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10916
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10917
	SetWindowText(win, __stringVal(aString));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10918
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10919
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10920
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10921
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10922
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10923
unmapWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10924
    "make a window invisible"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10925
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10926
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10927
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10928
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10929
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10930
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10931
	if (win) {
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10932
	    CPRINTF(("unmapWindow %x\n",win));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10933
	    ShowWindow(win, SW_HIDE);
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10934
	    CPRINTF(("unmapWindow1 %x\n",win));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
 10935
	    //enqEvent(ENQ_AT_END, 0, win, WM_SHOWWINDOW, FALSE, 0, 0, 0, 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10936
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10937
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10938
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10939
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10940
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10941
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10942
!WinWorkstation class methodsFor:'documentation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10943
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10944
version
2602
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
 10945
    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.99 1999-04-28 17:58:12 cg Exp $'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10946
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10947
WinWorkstation initialize!