WinWorkstation.st
author Claus Gittinger <cg@exept.de>
Tue, 04 May 1999 19:28:29 +0200
changeset 2639 8b2deda94ef3
parent 2633 35a113086b6f
child 2641 e37f0109ecf7
permissions -rw-r--r--
support for view-bg-pixmaps
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
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
    15
		eventTrace eventBuffer isWin95'
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
    16
	classVariableNames:'BeepDuration NativeWindows NativeWindowClassTable
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
    17
		StandardColorValues IgnoreSysColorChanges IgnoreFontChanges'
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    18
	poolDictionaries:''
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    19
	category:'Interface-Graphics'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    20
!
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
!WinWorkstation primitiveDefinitions!
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    23
%{
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
    24
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    25
#define COUNT_RESOURCES       /* */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    26
#define COUNT_BMP_RESOURCES   /* */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    27
#define DEBUG_DELETEOBJECT    /* */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    28
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
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
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
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
    36
#define CACHE_LAST_DC                   /* remember DC in gcData */
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
    37
#define CACHE_LAST_PEN                  /* remember pen in gcData */
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
    38
#define CACHE_LAST_BRUSH                /* remember brush in gcData */
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
    39
#define CACHE_LAST_WM_PAINT_BRUSH       /* remember last viewBackground brush */
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
    40
#define xxNUM_PEN_CACHED  5
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
    41
#define xxKEEP_BG_BRUSH                 /* keep viewBackground brush instead of bgColor */
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
    42
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    43
#undef INT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    44
#define INT WIN_INT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    45
#undef Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    46
#define Array WIN_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    47
#undef Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    48
#define Number WIN_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    49
#undef Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    50
#define Method WIN_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    51
#undef Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    52
#define Point WIN_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    53
#undef Rectangle
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    54
/* #define Rectangle WIN_Rectangle*/
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    55
#undef True
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    56
#define True WIN_True
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    57
#undef False
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    58
#define False WIN_False
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    59
#undef Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    60
#define Block WIN_Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    61
#undef Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    62
#define Context WIN_Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    63
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    64
#undef xxCONTEXT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    65
#define xxCONTEXT        WIN_CONTEXT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    66
#undef _xxCONTEXT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    67
#define _xxCONTEXT       _WIN_CONTEXT
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    68
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    69
2328
478ec9b5cbe1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2327
diff changeset
    70
#include <stdio.h>
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    71
/* #include <malloc.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    72
/* #include <math.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    73
/* #include <string.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    74
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    75
/*#include <stdarg.h>   */
2328
478ec9b5cbe1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2327
diff changeset
    76
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    77
#ifdef __BORLANDC__
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    78
# define NOATOM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    79
# define NOGDICAPMASKS
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    80
# define NOMETAFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    81
# define NOMINMAX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    82
# define NOOPENFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    83
# define NOSOUND
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    84
# define NOWH
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    85
# define NOCOMM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    86
# define NOKANJI
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    87
# define NOCRYPT
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    88
# define NOMCX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    89
# define WIN32_LEAN_AND_MEAN
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    90
# include <windows.h>
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
    91
# include <shellapi.h>
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    92
# include <sys\timeb.h>
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
    93
# include <dir.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    94
#else
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    95
# define _USERENTRY /**/
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    96
# define NOATOM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    97
# define NOGDICAPMASKS
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    98
# define NOMETAFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    99
# define NOMINMAX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   100
# define NOOPENFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   101
# define NOSOUND
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   102
# define NOWH
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   103
# define NOCOMM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   104
# define NOKANJI
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   105
# define NOCRYPT
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   106
# define NOMCX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   107
# define WIN32_LEAN_AND_MEAN
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   108
# include <windows.h>
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   109
# include <sys\timeb.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   110
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   111
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   112
#include <process.h>
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   113
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   114
#ifdef __DEF_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   115
# undef Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   116
# define Array __DEF_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   117
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   118
#ifdef __DEF_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   119
# undef Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   120
# define Number __DEF_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   121
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   122
#ifdef __DEF_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   123
# undef Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   124
# define Method __DEF_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   125
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   126
#ifdef __DEF_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   127
# undef Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   128
# define Point __DEF_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   129
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   130
#ifdef __DEF_Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   131
# undef Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   132
# define Block __DEF_Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   133
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   134
#ifdef __DEF_Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   135
# undef Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   136
# define Context __DEF_Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   137
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   138
#undef INT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   139
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   140
#define INT int
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   141
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   142
/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   143
 * some defines - tired of typing ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   144
 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   145
#define _HANDLEVal(o)        (HANDLE)(__MKCP(o))
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   146
#define _HBITMAPVAL(o)       (HBITMAP)(__MKCP(o))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   147
#define _HWNDVal(o)          (HWND)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   148
#define _HPALETTEVal(o)      (HPALETTE)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   149
#define _HCURSORVal(o)       (HCURSOR)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   150
#define _HGDIOBJVal(o)       (HGDIOBJ)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   151
#define _LOGPALETTEVal(o)    (LOGPALETTE *)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   152
#define _COLORREFVal(o)      (COLORREF)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   153
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   154
#define _GCDATA(o)           ((struct gcData *)(__MKCP(o)))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   155
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   156
#ifdef LATER
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   157
  /* 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
   158
   * 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
   159
   * 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
   160
   */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   161
# define __rootDC             (HDC)(__MKCP(__INST(rootDC)))
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   162
#endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   163
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   164
#define ISCONNECTED         1
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   165
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   166
struct gcData {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   167
    HWND        hWnd;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   168
    HBITMAP     hBitmap;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   169
    HBITMAP     save_hBitmap;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   170
    HDC         _hDC;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   171
    HBITMAP     hMask;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   172
    short       clipX;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   173
    short       clipY;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   174
    short       clipW;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   175
    short       clipH;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   176
    short       clipping;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   177
    char        clipByChildren;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   178
    char        bkMode;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   179
    short       bitmapColorBitCount;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   180
    short       maskOrgX;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   181
    short       maskOrgY;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   182
    short       lineWidth;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   183
    short       fontAscent;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   184
    int         lStyle;   /* is lineStyle | joinStyle | capStyle */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   185
    int         rop2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   186
    int         bitbltrop2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   187
    COLORREF    fgColor;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   188
    COLORREF    bgColor;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   189
    HFONT       hFont;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   190
    HFONT       save_hFont;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   191
    HPEN        hPen;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   192
    HPEN        save_hPen;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   193
    HBRUSH      hBrush;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   194
    HBRUSH      save_hBrush;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   195
};
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   196
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   197
/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   198
 * some synthetic values
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   199
 */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   200
/*****************************************************************
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   201
 * EVENT DEFINITIONS
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   202
 *****************************************************************/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   203
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   204
/* 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
   205
   to Grab requests.  Not to be confused with event names.  */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   206
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   207
#define NoEventMask                     0L
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   208
#define KeyPressMask                    (1L<<0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   209
#define KeyReleaseMask                  (1L<<1)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   210
#define ButtonPressMask                 (1L<<2)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   211
#define ButtonReleaseMask               (1L<<3)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   212
#define EnterWindowMask                 (1L<<4)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   213
#define LeaveWindowMask                 (1L<<5)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   214
#define PointerMotionMask               (1L<<6)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   215
#define PointerMotionHintMask           (1L<<7)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   216
#define Button1MotionMask               (1L<<8)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   217
#define Button2MotionMask               (1L<<9)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   218
#define Button3MotionMask               (1L<<10)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   219
#define Button4MotionMask               (1L<<11)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   220
#define Button5MotionMask               (1L<<12)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   221
#define ButtonMotionMask                (1L<<13)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   222
#define KeymapStateMask                 (1L<<14)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   223
#define ExposureMask                    (1L<<15)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   224
#define VisibilityChangeMask            (1L<<16)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   225
#define StructureNotifyMask             (1L<<17)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   226
#define ResizeRedirectMask              (1L<<18)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   227
#define SubstructureNotifyMask          (1L<<19)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   228
#define SubstructureRedirectMask        (1L<<20)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   229
#define FocusChangeMask                 (1L<<21)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   230
#define PropertyChangeMask              (1L<<22)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   231
#define ColormapChangeMask              (1L<<23)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   232
#define OwnerGrabButtonMask             (1L<<24)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   233
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   234
/* 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
   235
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
   236
are reserved in the protocol for errors and replies. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   237
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   238
#define KeyPress                2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   239
#define KeyRelease              3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   240
#define ButtonPress             4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   241
#define ButtonRelease           5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   242
#define MotionNotify            6
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   243
#define EnterNotify             7
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   244
#define LeaveNotify             8
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   245
#define FocusIn                 9
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   246
#define FocusOut                10
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   247
#define KeymapNotify            11
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   248
#define Expose                  12
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   249
#define GraphicsExpose          13
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   250
#define NoExpose                14
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   251
#define VisibilityNotify        15
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   252
#define CreateNotify            16
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   253
#define DestroyNotify           17
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   254
#define UnmapNotify             18
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   255
#define MapNotify               19
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   256
#define MapRequest              20
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   257
#define ReparentNotify          21
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   258
#define ConfigureNotify         22
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   259
#define ConfigureRequest        23
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   260
#define GravityNotify           24
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   261
#define ResizeRequest           25
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   262
#define CirculateNotify         26
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   263
#define CirculateRequest        27
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   264
#define PropertyNotify          28
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   265
#define SelectionClear          29
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   266
#define SelectionRequest        30
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   267
#define SelectionNotify         31
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   268
#define ColormapNotify          32
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   269
#define ClientMessage           33
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   270
#define MappingNotify           34
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   271
#define LASTEvent               35      /* must be bigger than any event # */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   272
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   273
/*#define Button1MotionMask      1
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   274
#define Button2MotionMask       2
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   275
#define Button3MotionMask       4
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   276
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   277
#define Button1Mask             Button1MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   278
#define Button2Mask             Button2MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   279
#define Button3Mask             Button3MotionMask*/
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   280
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   281
/* 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
   282
   state in various key-, mouse-, and button-related events. */
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
#define ShiftMask               (1<<0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   285
#define LockMask                (1<<1)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   286
#define ControlMask             (1<<2)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   287
#define Mod1Mask                (1<<3)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   288
#define Mod2Mask                (1<<4)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   289
#define Mod3Mask                (1<<5)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   290
#define Mod4Mask                (1<<6)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   291
#define Mod5Mask                (1<<7)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   292
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   293
/* modifier names.  Used to build a SetModifierMapping request or
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   294
   to read a GetModifierMapping request.  These correspond to the
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   295
   masks defined above. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   296
#define ShiftMapIndex           0
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   297
#define LockMapIndex            1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   298
#define ControlMapIndex         2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   299
#define Mod1MapIndex            3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   300
#define Mod2MapIndex            4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   301
#define Mod3MapIndex            5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   302
#define Mod4MapIndex            6
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   303
#define Mod5MapIndex            7
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   304
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
/* 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
   307
   with button names below. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   308
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   309
#define Button1Mask            Button1MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   310
#define Button2Mask            Button2MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   311
#define Button3Mask            Button3MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   312
#define Button4Mask            Button4MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   313
#define Button5Mask            Button5MotionMask
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   314
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   315
#define AnyModifier             (1<<15)  /* used in GrabButton, GrabKey */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   316
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   317
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   318
/* 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
   319
   and ButtonRelease events.  Not to be confused with button masks above.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   320
   Note that 0 is already defined above as "AnyButton".  */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   321
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   322
#define Button1                 1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   323
#define Button2                 2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   324
#define Button3                 3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   325
#define Button4                 4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   326
#define Button5                 5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   327
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   328
#define CAPTURE_NONE     0
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   329
#define CAPTURE_IMPLICIT 7
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   330
#define CAPTURE_EXPLICIT 8
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   331
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   332
#define BK_UNDEF         0
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   333
#define BK_TRANSPARENT   1
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   334
#define BK_OPAQUE        2
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   335
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   336
#define GRAVITY_NONE        0
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   337
#define GRAVITY_S           1
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   338
#define GRAVITY_SW          2
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   339
#define GRAVITY_SE          3
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   340
#define GRAVITY_N           4
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   341
#define GRAVITY_NW          5
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   342
#define GRAVITY_NE          6
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   343
#define GRAVITY_E           7
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   344
#define GRAVITY_W           8
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   345
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   346
/*#define ControlMask            8
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   347
#define ShiftMask              16*/
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   348
#define LeftAltMask            Mod1Mask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   349
#define RightAltMask           Mod2Mask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   350
#define TRANSLATED_KEY         Mod5Mask
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   351
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   352
#define WIN32PADDING 32
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   353
/*
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   354
 * synthetic events
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   355
 */
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   356
#define __WM_MOUSEENTER        0x10001
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   357
#define __WM_MOUSELEAVE        0x10002
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   358
#define __WM_GEXPOSE           0x10003
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   359
#define __WM_NOGEXPOSE         0x10004
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   360
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   361
static int AltMask = RightAltMask;
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   362
static int MetaMask = LeftAltMask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   363
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   364
#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
   365
#define BlackPixel     RGB(0, 0, 0)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   366
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   367
/*#undef DEBUG*/
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   368
#ifdef DEBUG
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   369
# define PRINTF(x)              { printf x;}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   370
# define CPRINTF(x)             { if (__debug__) printf x;}
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   371
# define RESPRINTF(x)           /*{ if (__debug__) printf x;}*/
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   372
# define RES1PRINTF(x)          /*{ if (__debug__) printf x;}*/
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   373
# 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
   374
# define TH_DPRINTF(x)          /*{ if (__debug__) printf x;}*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   375
# define POSTPRINTF(x)          { if (__debug__) printf x;}
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   376
# define DPRINTF(x)             { if (__debug__) printf x;}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   377
# define DDPRINTF(x)            /*{ if (__debug__) printf x;}*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   378
# define EVENT_PRINTF(x)        /*{ if (__debug__) printf x;}*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   379
# define EVENT_PRINTF2(x)       /*{ if (__debug__) printf x;}*/
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   380
# define EVENT_PRINTF3(x)       /* */
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   381
# define UNHANDLED_EVENT_PRINTF(x)  { if (__debug__) printf x;}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   382
#else
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   383
# define PRINTF(x)              /* */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   384
# define CPRINTF(x)             /* */
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   385
# define RES_BMP_PRINTF(x)      /* */
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   386
# define RESPRINTF(x)           /* */
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   387
# define RES1PRINTF(x)          /* */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   388
# define TH_DPRINTF(x)          /* */
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   389
# define POSTDPRINTF(x)         /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   390
# define DPRINTF(x)             /* */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   391
# define DDPRINTF(x)            /* */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   392
# define EVENT_PRINTF(x)        /* */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   393
# define EVENT_PRINTF2(x)       /* */
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   394
# define EVENT_PRINTF3(x)       /* */
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   395
# define UNHANDLED_EVENT_PRINTF(x)        /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   396
#endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   397
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   398
#define INFOPRINT(__x__)                 \
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   399
    if (@global(InfoPrinting) == true) { \
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   400
	__win32_fprintf __x__;           \
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   401
    }
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   402
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   403
#define BR_SOLID       0
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   404
#define BR_PATTERN     1
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   405
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   406
#define LINE_SOLID     0
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   407
#define LINE_DASH      1
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   408
#define LINE_DDASH     2
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   409
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   410
#ifdef KEEP_STD_CURSORS
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   411
# define _C_ARROW       1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   412
# define _C_CROSS       2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   413
# define _C_IBEAM       3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   414
# define _C_ICON        4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   415
# define _C_NO          5
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   416
# define _C_SIZE        6
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   417
# define _C_SIZEALL     7
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   418
# define _C_SIZENESW    8
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   419
# define _C_SIZENS      9
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   420
# define _C_SIZENWSE    10
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   421
# define _C_UPARROW     11
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   422
# define _C_WAIT        12
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   423
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   424
 static HCURSOR H_C_ARROW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   425
 static HCURSOR H_C_CROSS = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   426
 static HCURSOR H_C_IBEAM = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   427
 static HCURSOR H_C_ICON = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   428
 static HCURSOR H_C_NO = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   429
 static HCURSOR H_C_SIZE = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   430
 static HCURSOR H_C_SIZEALL = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   431
 static HCURSOR H_C_SIZENESW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   432
 static HCURSOR H_C_SIZENS = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   433
 static HCURSOR H_C_SIZENWSE = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   434
 static HCURSOR H_C_UPARROW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   435
 static HCURSOR H_C_WAIT = (HCURSOR)0;
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
   436
 static HCURSOR H_C_APPSTARTING = (HCURSOR)0;
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   437
#endif /* KEEP_STD_CURSORS */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   438
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   439
#ifdef EXIT_WITH_3_CTRL_Cs
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   440
static int c_count;            /* CTRL-C count */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   441
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   442
static int evRootX, evRootY;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   443
static int multiClickState;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   444
static UINT lastMSGTime;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   445
static UINT multiClickTime;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   446
static UINT nextMultiClickTime;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   447
static int destroyWin;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   448
static int __modifiers;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   449
static HDC __tmpDC;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   450
static int __isWinNT;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   451
static int __logPixelSY;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   452
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
   453
static int            lastGcOwnerThreadID = 0;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   454
#ifndef __rootDC
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   455
 static HDC __rootDC;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   456
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   457
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   458
#ifdef NUM_PEN_CACHED
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   459
static HPEN __penCache[NUM_PEN_CACHED];
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   460
#endif
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   461
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   462
/*
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   463
 * globally cached - never released
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   464
 */
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   465
static HPEN __blackPen = 0;
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   466
static HPEN __whitePen = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   467
static HPEN __nullPen = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   468
static HBRUSH __blackBrush = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   469
static HBRUSH __whiteBrush = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   470
2620
519011e49878 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2619
diff changeset
   471
static HPEN __bgPen = 0;
519011e49878 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2619
diff changeset
   472
static int __bgPenColor = 0;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   473
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   474
#define WM_THREADCREATEWINDOW   WM_USER + 0x101
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   475
#define WM_THREADDESTROYWINDOW  WM_USER + 0x102
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   476
#define WM_THREADSETFOCUS       WM_USER + 0x103
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   477
#define WM_THREADSETCAPTURE     WM_USER + 0x104
2247
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   478
#define WM_THREADSETCURSOR      WM_USER + 0x105
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   479
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   480
#define hasEventQueued() (eventQueueHead != NULL)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   481
#define EVENT_THREAD_STACKSIZE  (4096*4)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   482
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   483
typedef int (*intf)(int);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   484
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   485
/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   486
 * 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
   487
 */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   488
#define LI_TOPWIN       0x0001
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   489
#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
   490
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   491
typedef struct {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   492
	HCURSOR hCursor;
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
   493
	HBRUSH   viewBgBrush;  /* if that is nil, it has a solid bg color */
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   494
	COLORREF viewBgColor;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   495
	int     flag;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   496
	short   minWidth;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   497
	short   maxWidth;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   498
	short   minHeight;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   499
	short   maxHeight;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   500
	int     eventMask;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   501
	short   bw;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   502
	short   viewGravity;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   503
} localWindowInfo;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   504
typedef localWindowInfo *plocalWindowInfo;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   505
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   506
typedef struct createWindowInfo {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   507
	localWindowInfo *localWindowInfo;  /* in param */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   508
	HANDLE          newWinHandle;      /* out param */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   509
	char            *windowName;       /* in params */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   510
	char            *className;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   511
	int             winStyleBits;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   512
	int             winStyleBitsEx;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   513
	HANDLE          parentHandle;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   514
	int             x;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   515
	int             y;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   516
	int             dx;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   517
	int             dy;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   518
	HANDLE          hCreateEvent;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   519
	int             xxx;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   520
} createWindowInfo;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   521
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   522
#define N_WINDOW_PRIVATE (sizeof(plocalWindowInfo))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   523
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   524
#define GETLOCALWINDOWINFOPTR(__hWnd__) \
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   525
	((localWindowInfo *)GetWindowLong(__hWnd__, 0))
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   526
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   527
#define SETLOCALWINDOWINFOPTR(__hWnd__,__ptr__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   528
	SetWindowLong(__hWnd__, 0 , (DWORD)__ptr__)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   529
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   530
#define SetWindow_Cursor(__hWnd__, __hCurs__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   531
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor = __hCurs__) : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   532
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   533
#define GetWindow_Cursor(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   534
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   535
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   536
#define SetWindow_viewBgColor(__hWnd__, __viewBgColor__) \
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   537
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgColor = __viewBgColor__) : 0)
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   538
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   539
#define GetWindow_viewBgColor(__hWnd__) \
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   540
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgColor : 0)
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   541
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   542
#define SetWindow_viewBgBrush(__hWnd__, __viewBgBrush__) \
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   543
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgBrush = __viewBgBrush__) : 0)
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   544
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   545
#define GetWindow_viewBgBrush(__hWnd__) \
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   546
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgBrush : 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   547
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   548
#define SetWindow_bw(__hWnd__, __bw__) \
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   549
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->bw = __bw__) : 0)
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   550
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   551
#define GetWindow_bw(__hWnd__) \
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   552
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->bw : 0)
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   553
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   554
#define GetWindow_paintInfoPtr(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   555
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->paintInfo) : 0)
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   556
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   557
#define GetWindow_sizeInfoPtr(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   558
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->sizeInfo) : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   559
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   560
#define SetWindow_flag(__hWnd__, __flag__) \
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   561
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->flag = __flag__) : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   562
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   563
#define GetWindow_flag(__hWnd__) \
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   564
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->flag : 0)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   565
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   566
#define GetWindow_eventMask(__hWnd__) \
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   567
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->eventMask) : 0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   568
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   569
struct queuedEvent {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   570
	struct queuedEvent     *ev_next;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   571
	int                     count;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   572
	int                     ev_flag;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   573
	HWND                    ev_hWnd;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   574
	UINT                    ev_message;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   575
	UINT                    ev_wParam;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   576
	int                     ev_arg1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   577
	int                     ev_arg2;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   578
	int                     ev_arg3;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   579
	int                     ev_arg4;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   580
};
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   581
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   582
#define ev_x    ev_arg1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   583
#define ev_y    ev_arg2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   584
#define ev_w    ev_arg3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   585
#define ev_h    ev_arg4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   586
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   587
#define ev_keyCode   ev_wParam
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   588
#define ev_scanCode  ev_arg3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   589
#define ev_modifiers ev_arg4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   590
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   591
#define EV_CHUNK_CNT    10000
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   592
#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
   593
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   594
#define BITBLT_COPY             SRCCOPY
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   595
#define BITBLT_COPYINVERTED     NOTSRCCOPY
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   596
#define BITBLT_XOR              SRCINVERT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   597
#define BITBLT_AND              SRCAND
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   598
#define BITBLT_OR               SRCPAINT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   599
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   600
/*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   601
 * need threadSafe printf versions
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   602
 */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   603
#define printf  __win32_printf
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   604
#define fprintf __win32_fprintf
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   605
#define fflush  __win32_fflush
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   606
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   607
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   608
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   609
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   610
!WinWorkstation primitiveVariables!
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   611
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   612
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   613
static int firstInstance = 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   614
static char *app_name = "ST/X";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   615
static char *app_nameroot = "ST/X:Root";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   616
static int __debug__ = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   617
static int __depth;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   618
static int __realDepth;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   619
static HWND __rootWin = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   620
static HWND __rootWinSpezial = NULL;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   621
#if 0
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   622
static HDESK __rootDesk;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   623
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   624
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   625
static int __activateOnClick = 1;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   626
static int __currentCapture = CAPTURE_NONE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   627
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   628
static HANDLE __currentPointerView = (HANDLE)0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   629
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   630
/* MessageDispatchThread */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   631
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   632
#ifndef WIN32THREADS
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   633
static DWORD _masterThreadId;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   634
static HANDLE _masterThread;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   635
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   636
static DWORD _dispatchThreadId = 0;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
   637
#ifdef LOCK_DEBUG
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   638
static int lockcountQ = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   639
static int lockcountF = 0;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
   640
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   641
static HANDLE hEventQMutex;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   642
static HANDLE hEventFreeListMutex;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   643
static HANDLE hCreateEvent;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   644
static HANDLE hInputEvent;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   645
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   646
#ifdef COUNT_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   647
 static int __cnt_gcData;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   648
 static int __cnt_createWindows;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   649
 static int __cnt_cur;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   650
 static int __cnt_font;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   651
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   652
#ifdef COUNT_BMP_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   653
 static int __cnt_bmpdc;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   654
 static int __cnt_bitmap;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   655
#endif
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
   656
static struct queuedEvent *eventFreeList = (struct queuedEvent *)0;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
   657
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
   658
/*
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
   659
 * up to NUMQUICKFREE events can be allocated and freed without
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
   660
 * a need to access the Mutex
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
   661
 */
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
   662
#define NUMQUICKFREE    10
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
   663
static struct queuedEvent *quickFreeEvent[NUMQUICKFREE];
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
   664
static struct queuedEvent *eventQueueHead = (struct queuedEvent *)0;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
   665
static struct queuedEvent *eventQueueTail = (struct queuedEvent *)0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   666
static int eventsendcount = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   667
static int eventempfcount = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   668
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   669
#ifdef CACHE_LAST_WM_PAINT_BRUSH
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   670
 static HBRUSH wm_paint_brush = (HBRUSH) 0;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   671
 static HWND   wm_paint_brush_hwnd = (HWND) 0;
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   672
 static HWND   wm_paint_brush_clr = (HWND) 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   673
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   674
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   675
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   676
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   677
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   678
!WinWorkstation primitiveFunctions!
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   679
%{
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   680
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   681
#ifdef xxWIN32THREADS
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   682
extern void __suspendAktThread();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   683
extern void __resumeAktThread();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   684
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   685
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   686
__debugEvent__() {}
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   687
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   688
#ifdef DEBUGMASK
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   689
static void
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   690
printMask(int mask) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   691
    if (mask & KeyPressMask)        printf("KeyPressMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   692
    if (mask & KeyReleaseMask)      printf("KeyReleaseMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   693
    if (mask & ButtonPressMask)     printf("ButtonPressMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   694
    if (mask & ButtonReleaseMask)   printf("ButtonReleaseMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   695
    if (mask & ButtonMotionMask)    printf("ButtonMotionMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   696
    if (mask & PointerMotionMask)   printf("PointerMotionMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   697
    if (mask & ExposureMask)        printf("ExposureMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   698
    if (mask & FocusChangeMask)     printf("FocusChangeMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   699
    if (mask & EnterWindowMask)     printf("EnterWindowMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   700
    if (mask & LeaveWindowMask)     printf("LeaveWindowMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   701
    if (mask & KeymapStateMask)     printf("KeymapStateMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   702
    if (mask & VisibilityChangeMask)printf("VisibilityChangeMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   703
    if (mask & StructureNotifyMask) printf("StructureNotifyMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   704
    if (mask & ResizeRedirectMask)  printf("ResizeRedirectMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   705
    if (mask & PropertyChangeMask)  printf("PropertyChangeMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   706
    if (mask & ColormapChangeMask)  printf("ColormapChangeMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   707
}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   708
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   709
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   710
static int
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   711
st2RGB(color, gcData)
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   712
    int color;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   713
    struct gcData *gcData;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   714
{
2418
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   715
    int ir,ig,ib;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   716
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   717
    if (gcData) {
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   718
	if (gcData->bitmapColorBitCount == 1) {
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   719
	  if (color)
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   720
	      return WhitePixel;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   721
	  else
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   722
	      return BlackPixel;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   723
	}
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   724
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   725
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   726
    return (color & 0xffffff);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   727
#else
2418
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   728
    if (__depth < 15) {
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   729
	return 0;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   730
    } else {
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   731
	if ((__depth == 16) || (__depth == 15)) {
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   732
	    ib = (color & 0x1f) << 3;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   733
	    ig = ((color >> 5) & 0x3f) << 2;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   734
	    ir = ((color >> 11) & 0x1f) << 3;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   735
	    ir |= 7;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   736
	    ig |= 3;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   737
	    ib |= 7;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   738
	    return RGB(ir,ig,ib);
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   739
	}
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   740
	return (color & 0xffffff);
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   741
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   742
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   743
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   744
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   745
static int
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   746
RGB2st(r, g, b)
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   747
    int r, g, b;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   748
{
2418
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   749
    int ir,ig,ib,id;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   750
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   751
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   752
    ir = (r >> 8) & 0xff;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   753
    ig = (g >> 8) & 0xff;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   754
    ib = (b >> 8) & 0xff;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   755
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   756
    id = RGB( ir, ig, ib);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   757
#else
2418
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   758
    if (__depth < 15) {
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   759
	id = 0;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   760
    } else {
2418
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   761
	if ((__depth == 16) || (__depth == 15)) {
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   762
	    ir = (r >> 11) & 0x1f;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   763
	    ig = (g >> 10) & 0x3f;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   764
	    ib = (b >> 11) & 0x1f;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   765
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   766
	    id = ( ir << 11 ) | ( ig << 5 ) | ib;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   767
	} else {
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   768
	    ir = (r >> 8) & 0xff;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   769
	    ig = (g >> 8) & 0xff;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   770
	    ib = (b >> 8) & 0xff;
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   771
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   772
	    id = RGB( ir, ig, ib);
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   773
	}
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   774
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   775
#endif
2418
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   776
    return id;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   777
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   778
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   779
#ifdef DEBUG_DELETEOBJECT
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   780
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   781
static int
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   782
_DeleteObject(o, lineNr)
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   783
    HANDLE o;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   784
{
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   785
    int r = DeleteObject(o);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   786
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   787
    if (r == 0)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   788
	fprintf(stderr, "WinWorkstation: ERROR in DeleteObject %x [%d]\n", o, lineNr);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   789
    return r;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   790
}
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   791
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   792
#else
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   793
# define _DeleteObject(o,lnr)  DeleteObject(o)
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   794
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   795
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   796
static struct gcData *
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   797
newGcData() {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   798
    struct gcData *gcData = (struct gcData *)malloc(sizeof(struct gcData));
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   799
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   800
    if (! gcData) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
   801
	fprintf(stderr, "WinWorkstat [warning]: failed to allocate gcData\n");
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   802
	return 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   803
    }
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   804
    memset(gcData, 0, sizeof(struct gcData));
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   805
    gcData->fgColor = 0xffffff;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   806
    /* gcData->bgColor = 0; - not needed - memset does it */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   807
    gcData->clipping = FALSE;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   808
    gcData->clipByChildren = TRUE;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   809
    gcData->bitbltrop2 = BITBLT_COPY;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   810
    gcData->lineWidth = 1;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   811
    gcData->lStyle = PS_SOLID | PS_JOIN_MITER | PS_ENDCAP_FLAT;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   812
    /* 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
   813
    /* 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
   814
    /* gcData->hBrush = 0; - not needed - memset does it */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   815
    return gcData;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   816
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   817
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   818
#ifdef CACHE_LAST_DC
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   819
# 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
   820
    if (lastGcData == __gcData__) {  \
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   821
	_releaseDC(lastGcData);      \
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   822
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   823
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   824
# 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
   825
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   826
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   827
#ifdef NUM_PEN_CACHED
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   828
# define FLUSH_MULTIPEN_CACHE(__gcData__) \
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   829
    {          \
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   830
	int i; \
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   831
	for (i=0; i<NUM_PEN_CACHED;i++) { \
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   832
	    if (__penCache[i] == __gcData__) { \
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   833
		_DeleteObject(__penCache[i], __LINE__); \
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   834
		__penCache[i] = 0; \
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   835
		break;  \
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   836
	    } \
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   837
	} \
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   838
    }
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   839
#else
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   840
# define FLUSH_MULTIPEN_CACHE(__gcData__)  /* NOTHING */
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   841
#endif
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   842
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   843
#ifdef CACHE_LAST_PEN
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   844
# 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
   845
    if (__gcData__->hPen) {           \
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   846
	if (__gcData__->save_hPen) {  \
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   847
	    SelectObject(__gcData__->_hDC, __gcData__->save_hPen); \
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   848
	    __gcData__->save_hPen = 0;   \
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   849
	} \
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   850
	if ((__gcData__->hPen != __blackPen) \
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   851
	 && (__gcData__->hPen != __whitePen)) { \
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   852
	    _DeleteObject(__gcData__->hPen, __LINE__); \
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   853
	} \
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   854
	__gcData__->hPen = 0; \
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   855
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   856
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   857
# 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
   858
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   859
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   860
#ifdef CACHE_LAST_BRUSH
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   861
# 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
   862
    if (__gcData__->hBrush) {           \
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   863
	if (__gcData__->save_hBrush) {  \
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   864
	    SelectObject(__gcData__->_hDC, __gcData__->save_hBrush); \
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   865
	    __gcData__->save_hBrush = 0;   \
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   866
	} \
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   867
	if ((__gcData__->hBrush != __blackBrush) \
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   868
	 && (__gcData__->hBrush != __whiteBrush)) { \
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   869
	    _DeleteObject(__gcData__->hBrush, __LINE__); \
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   870
	} \
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   871
	__gcData__->hBrush = 0; \
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   872
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   873
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   874
# 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
   875
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   876
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   877
static void
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   878
_releaseDC(gcData)
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   879
    struct gcData *gcData;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   880
{
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   881
    HDC hDC = gcData->_hDC;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   882
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   883
    if (gcData->save_hPen) {
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   884
	SelectObject(hDC, gcData->save_hPen);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   885
	gcData->save_hPen = 0;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   886
    }
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   887
    if (gcData->save_hBrush) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   888
	SelectObject(hDC, gcData->save_hBrush);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   889
	gcData->save_hBrush = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   890
    }
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   891
    if (gcData->save_hFont) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   892
	SelectObject(hDC, gcData->save_hFont);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   893
	gcData->save_hFont = 0;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   894
    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   895
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   896
    if (gcData->hWnd) {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   897
	if (hDC) {
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   898
	    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
   899
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   900
    } else if (gcData->hBitmap) {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   901
	SelectObject(hDC, gcData->save_hBitmap);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   902
	DeleteDC(hDC);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   903
    }
2383
9a5be0903b57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2378
diff changeset
   904
    gcData->_hDC = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   905
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   906
#ifdef CACHE_LAST_PEN
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   907
    if (gcData->hPen) {
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   908
	if ((gcData->hPen != __blackPen)
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   909
	 && (gcData->hPen != __whitePen)) {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   910
	    _DeleteObject(gcData->hPen, __LINE__);
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
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
	gcData->hPen = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   913
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   914
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   915
#ifdef CACHE_LAST_BRUSH
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   916
    if (gcData->hBrush) {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   917
	if ((gcData->hBrush != __blackBrush)
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   918
	 && (gcData->hBrush != __whiteBrush)) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   919
	    _DeleteObject(gcData->hBrush, __LINE__);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
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
	gcData->hBrush = 0;
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
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   924
#ifdef CACHE_LAST_DC
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   925
    if (lastGcData == gcData) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   926
	lastGcData = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   927
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   928
#endif
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   929
}
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   930
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   931
static HDC
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   932
_getDC(gcData)
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   933
    struct gcData *gcData;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   934
{
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   935
    HDC hDC;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   936
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   937
#ifdef CACHE_LAST_DC
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
   938
    int currThreadId = GetCurrentThreadId();
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
   939
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   940
    if (lastGcData) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   941
	if ((lastGcData == gcData) 
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
   942
	 && (lastGcOwnerThreadID == currThreadId) 
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
   943
	) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   944
	    //printf(".");
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   945
	    return gcData->_hDC;
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   946
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   947
	_releaseDC(lastGcData);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   948
    }
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   949
#endif
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   950
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   951
    hDC = 0;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   952
    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
   953
	if (__isWinNT && (gcData->hWnd == __rootWin)) {
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   954
	    hDC = gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_WINDOW);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   955
	    //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
   956
	} else {
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   957
	    if (gcData->clipByChildren) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   958
		//gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_CLIPCHILDREN);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   959
		hDC = 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
   960
	    } else
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   961
		hDC = gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_PARENTCLIP);
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   962
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   963
    } else if (gcData->hBitmap) {
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   964
	hDC = gcData->_hDC = CreateCompatibleDC(__tmpDC);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   965
	gcData->save_hBitmap = SelectObject(gcData->_hDC,gcData->hBitmap);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   966
    }
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   967
    gcData->bkMode = BK_UNDEF;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   968
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   969
    if (hDC) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   970
#if 0
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   971
	SetTextColor(hDC, gcData->bgColor);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   972
	SetBkColor(hDC, gcData->fgColor);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   973
#else
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   974
	SetTextColor(hDC, gcData->fgColor);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   975
	SetBkColor(hDC, gcData->bgColor);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   976
#endif
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
   977
	if (gcData->rop2) 
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   978
	    SetROP2(hDC, gcData->rop2);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   979
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   980
	if (gcData->clipping) {
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   981
	    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
   982
					  gcData->clipX + gcData->clipW,
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   983
					  gcData->clipY + gcData->clipH );
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   984
	    if (region == NULL ) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   985
		DPRINTF((" clipping region creation failed!\n"));
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   986
	    } else {
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   987
		if (SelectClipRgn(hDC, region) == ERROR ) {
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   988
		    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
   989
		}
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   990
		/*printf("%x c\n",hDC);*/
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   991
		_DeleteObject(region, __LINE__);
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   992
	    }
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   993
	}
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   994
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   995
	if (gcData->hFont) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   996
	    HFONT prevFont;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   997
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   998
	    prevFont = SelectObject(hDC, gcData->hFont);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   999
	    if (! gcData->save_hFont) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1000
		gcData->save_hFont = prevFont;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1001
	    }
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1002
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1003
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1004
#ifdef CACHE_LAST_DC
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1005
    lastGcData = gcData;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  1006
    lastGcOwnerThreadID = currThreadId;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1007
#endif
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1008
    return hDC;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1009
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1010
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1011
static HBRUSH
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1012
GcDataGetBrush(hDC, gcData)
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1013
    HDC hDC;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1014
    struct gcData *gcData;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1015
{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1016
    HBRUSH hBrush = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1017
    HBRUSH prevBrush;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1018
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1019
#ifdef CACHE_LAST_BRUSH
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1020
    if (hBrush = gcData->hBrush) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1021
	if (! gcData->save_hBrush) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1022
	    gcData->save_hBrush = SelectObject(gcData->_hDC, hBrush);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1023
	}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1024
	return hBrush;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1025
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1026
#endif
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1027
    if (gcData->hMask) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1028
	hBrush = CreatePatternBrush(gcData->hMask);
2340
0712b35328f6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  1029
	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
  1030
	RESPRINTF(("CreatePatternBrush %x\n",gcData->hMask));
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1031
    } else {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1032
	if (gcData->fgColor == BlackPixel) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1033
	    hBrush = __blackBrush;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1034
	} else {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1035
	    if (gcData->fgColor == WhitePixel) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1036
		hBrush = __whiteBrush;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1037
	    } else {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1038
		hBrush = CreateSolidBrush(gcData->fgColor);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1039
		RESPRINTF(("CreateSolidBrush %x\n",gcData->fgColor));
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1040
	    }
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1041
	}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1042
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1043
    gcData->hBrush = hBrush;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1044
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1045
    prevBrush = SelectObject(gcData->_hDC, hBrush);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1046
    if (! gcData->save_hBrush) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1047
	gcData->save_hBrush = prevBrush;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1048
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1049
    return hBrush;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1050
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1051
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1052
#ifdef CACHE_LAST_BRUSH
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1053
# define GcDataReleaseBrush(hDC, gcData)  /* nothing*/
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1054
#else
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1055
static void
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1056
GcDataReleaseBrush(hDC, gcData)
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1057
    HDC hDC;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1058
    struct gcData *gcData;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1059
{
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1060
    HBRUSH hBrush;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1061
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1062
    hBrush = gcData->hBrush;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1063
    if (gcData->save_hBrush) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1064
	SelectObject(hDC, gcData->save_hBrush);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1065
	gcData->save_hBrush = NULL;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1066
    }
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1067
    if ((hBrush != __blackBrush) && (hBrush != __whiteBrush)) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1068
	_DeleteObject(hBrush, __LINE__); 
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1069
    }
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1070
    gcData->hBrush = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1071
}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1072
#endif
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1073
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1074
static HPEN
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1075
GcDataGetPen(hDC, gcData)
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1076
    HDC hDC;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1077
    struct gcData *gcData;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1078
{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1079
    HPEN hPen = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1080
    HPEN prevPen;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1081
    LOGBRUSH Brush;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1082
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1083
#ifdef CACHE_LAST_PEN
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1084
    if (hPen = gcData->hPen) {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1085
	if (! gcData->save_hPen) {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1086
	    gcData->save_hPen = SelectObject(gcData->_hDC, hPen);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1087
	}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1088
	return hPen;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1089
    }
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1090
#endif
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1091
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1092
    if (((gcData->lStyle & PS_STYLE_MASK) == PS_SOLID)
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1093
     && (gcData->hMask == 0)
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1094
     && (gcData->lineWidth <= 1)) {
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1095
	if (gcData->fgColor == BlackPixel) {
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1096
#ifdef CACHE_LAST_PEN
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1097
	    gcData->hPen = __blackPen;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1098
	    prevPen = SelectObject(hDC, __blackPen);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1099
	    if (! gcData->save_hPen) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1100
		gcData->save_hPen = prevPen;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1101
	    }
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1102
#endif
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1103
	    return __blackPen;
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1104
	} else if (gcData->fgColor == WhitePixel) {
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1105
#ifdef CACHE_LAST_PEN
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1106
	    gcData->hPen = __whitePen;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1107
	    prevPen = SelectObject(hDC, __whitePen);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1108
	    if (! gcData->save_hPen) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1109
		gcData->save_hPen = prevPen;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1110
	    }
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1111
#endif
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1112
	    return __whitePen;
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1113
	}
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1114
    }
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1115
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1116
    if (__isWinNT) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1117
	/*
2627
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1118
	 * NT supports masked drawing with any lineStyle,
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1119
	 * and also non-solid lines with any lineWidth.
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1120
	 */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1121
	if (gcData->hMask) {
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1122
	    Brush.lbStyle = BS_PATTERN;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1123
	    Brush.lbHatch = (DWORD)gcData->hMask;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1124
	    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
  1125
	} else {
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1126
	    Brush.lbStyle = BS_SOLID;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1127
	    Brush.lbHatch = 0;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1128
	    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
  1129
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1130
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1131
	hPen = ExtCreatePen(PS_GEOMETRIC | gcData->lStyle,
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1132
			    gcData->lineWidth,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1133
			    &Brush,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1134
			    0, 0);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1135
	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
  1136
			gcData->lStyle,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1137
			gcData->lineWidth,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1138
			gcData->fgColor, gcData->hMask));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1139
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1140
	if (gcData->hMask) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1141
	    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
  1142
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1143
    } else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1144
	/*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1145
	 * W95 only supports masked drawing with SOLID lines
2627
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1146
	 * also, we should use COSMETIC pens if possible
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1147
	 * with non-solid lineStyles.
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1148
	 */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1149
	if ((gcData->lStyle & PS_STYLE_MASK) == PS_SOLID) {
2627
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1150
	    int ps = PS_GEOMETRIC;
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1151
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1152
	    if (gcData->hMask) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1153
		Brush.lbStyle = BS_PATTERN;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1154
		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
  1155
		Brush.lbColor = gcData->fgColor;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1156
	    } else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1157
		Brush.lbStyle = BS_SOLID;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1158
		Brush.lbHatch = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1159
		Brush.lbColor = gcData->fgColor;
2627
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1160
		if (gcData->lineWidth <= 1) {
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1161
		    ps = PS_COSMETIC;
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1162
		}
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1163
	    }
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1164
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1165
	    hPen = ExtCreatePen(ps | gcData->lStyle,
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1166
				gcData->lineWidth,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1167
				&Brush,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1168
				0, 0);
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1169
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1170
	    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
  1171
			    gcData->lStyle,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1172
			    gcData->lineWidth,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1173
			    gcData->fgColor, gcData->hMask));
2627
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1174
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1175
	    if (gcData->hMask) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1176
		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
  1177
	    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1178
	} else {
2627
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1179
	    int lw = gcData->lineWidth;
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1180
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1181
	    if (lw == 1) {
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1182
		lw = 0;
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1183
	    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1184
	    /*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1185
	     * 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
  1186
	     */
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1187
	    hPen = CreatePen((gcData->lStyle & PS_STYLE_MASK),
2627
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1188
			     lw,
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1189
			     gcData->fgColor);
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1190
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1191
	    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
  1192
				(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
  1193
				gcData->lineWidth,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1194
				gcData->fgColor));
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1195
2383
9a5be0903b57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2378
diff changeset
  1196
	    //
9a5be0903b57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2378
diff changeset
  1197
	    // CG: wrong; must set to opaque, if doubleDashed
9a5be0903b57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2378
diff changeset
  1198
	    //    
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1199
	    SetBkMode(hDC, TRANSPARENT);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1200
	    gcData->bkMode = BK_TRANSPARENT;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1201
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1202
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1203
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1204
    gcData->hPen = hPen;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1205
    prevPen = SelectObject(hDC, hPen);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1206
    if (! gcData->save_hPen) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1207
	gcData->save_hPen = prevPen;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1208
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1209
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1210
    return hPen;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1211
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1212
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1213
#ifdef CACHE_LAST_PEN
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1214
# define GcDataReleasePen(hDC, gcData)  /* nothing*/
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1215
#else
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1216
static void
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1217
GcDataReleasePen(hDC, gcData)
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1218
    HDC hDC;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1219
    struct gcData *gcData;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1220
{
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1221
    HPEN hPen;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1222
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1223
    if (gcData->save_hPen) {
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1224
	SelectObject(hDC, gcData->save_hPen);
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1225
	gcData->save_hPen = NULL;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1226
    }
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1227
    hPen = gcData->hPen;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1228
    if ((hPen != __blackPen) && (hPen != __whitePen)) {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1229
	_DeleteObject(hPen, __LINE__); 
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1230
    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1231
    gcData->hPen = 0;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1232
}
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1233
#endif /* CACHE_LAST_PEN */
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1234
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1235
static int
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1236
lockEventQ() {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1237
    DWORD dwWaitResult;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1238
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1239
    /* Request ownership of mutex. */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1240
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1241
    dwWaitResult = WaitForSingleObject(
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1242
					hEventQMutex,   /* handle of mutex */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1243
					5000L);         /* time-out interval ms */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1244
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1245
#ifdef LOCK_DEBUG
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1246
    lockcountQ++;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1247
    if (lockcountQ != 1) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1248
	fprintf(stderr, "WinWorkstation: lockcountQ (%d) != 1\n", lockcountQ);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1249
	lockcountQ = 1;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1250
    }
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1251
#endif
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1252
    switch (dwWaitResult) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1253
	// The thread got mutex ownership.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1254
	case WAIT_OBJECT_0:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1255
	    break;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1256
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1257
	// Cannot get mutex ownership due to time-out.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1258
	case WAIT_TIMEOUT:
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1259
	    fprintf(stderr, "WinWorkstation: lockEventQ timeout\n");
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1260
	    return FALSE;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1261
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1262
	// Got ownership of the abandoned mutex object.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1263
	default:
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1264
	    fprintf(stderr, "WinWorkstation: lockEventQ abandoned\n");
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1265
	    return FALSE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1266
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1267
    return TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1268
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1269
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1270
static void
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1271
unlockEventQ() {
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1272
#ifdef LOCK_DEBUG
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1273
    lockcountQ--;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1274
    if (lockcountQ != 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1275
	fprintf(stderr, "WinWorkstation: lockcountQ (%d) != 0\n", lockcountQ);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1276
	lockcountQ = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1277
    }
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1278
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1279
    /* Release ownership of the mutex object. */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1280
    if (! ReleaseMutex(hEventQMutex)) {
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1281
       /* Deal with error. */
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1282
       printf("unlock Error\n");
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1283
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1284
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1285
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1286
static int
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1287
lockEventFreeList() {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1288
    DWORD dwWaitResult;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1289
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1290
    /* Request ownership of mutex. */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1291
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1292
    dwWaitResult = WaitForSingleObject(
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1293
					hEventFreeListMutex, /* handle of mutex */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1294
					5000L);              /* time-out interval ms */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1295
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1296
#ifdef LOCK_DEBUG
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1297
    lockcountF++;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1298
    if (lockcountF != 1) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1299
	fprintf(stderr, "WinWorkstation: lockcountF (%d) != 1\n", lockcountF);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1300
	lockcountF = 1;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1301
    }
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1302
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1303
    switch (dwWaitResult) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1304
	// The thread got mutex ownership.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1305
	case WAIT_OBJECT_0:
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1306
	    break;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1307
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1308
	// Cannot get mutex ownership due to time-out.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1309
	case WAIT_TIMEOUT:
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1310
	    fprintf(stderr, "WinWorkstation: lockEventF timeout\n");
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1311
	    return FALSE;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1312
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1313
	// Got ownership of the abandoned mutex object.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1314
	default:
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1315
	    fprintf(stderr, "WinWorkstation: lockEventF abandoned\n");
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1316
	    return FALSE;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1317
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1318
    return TRUE;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1319
}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1320
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1321
static void
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1322
unlockEventFreeList() {
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1323
#ifdef LOCK_DEBUG
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1324
    lockcountF--;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1325
    if (lockcountF != 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1326
	fprintf(stderr, "WinWorkstation: lockcountF (%d) != 0\n", lockcountF);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1327
	lockcountF = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1328
    }
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1329
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1330
    /* Release ownership of the mutex object. */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1331
    if (! ReleaseMutex(hEventFreeListMutex)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1332
       /* Deal with error. */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1333
       printf("unlock Error\n");
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1334
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1335
}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1336
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1337
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1338
static int
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1339
initqueue() {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1340
    struct queuedEvent *bulk;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1341
    int i;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1342
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1343
    bulk = (struct queuedEvent *) malloc(EV_CHUNK_SZ);
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1344
    if (bulk == 0) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  1345
	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
  1346
	return 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1347
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1348
    for (i=1; i<EV_CHUNK_CNT; i++) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1349
	bulk[i-1].ev_next = &(bulk[i]);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1350
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1351
    bulk[EV_CHUNK_CNT-1].ev_next = (struct queuedEvent *)0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1352
    eventFreeList = bulk;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1353
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1354
    for (i=0; i<NUMQUICKFREE; i++) {
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1355
	quickFreeEvent[i] = (struct queuedEvent *)0;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1356
    }
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1357
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1358
    return 1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1359
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1360
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1361
#define ENQ_AT_END      0
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1362
#define ENQ_AT_FRONT    1
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1363
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1364
static void
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1365
enqEvent(atFront, flag, hWnd, message, wParam, arg1, arg2, arg3, arg4)
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1366
    HWND hWnd;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1367
    UINT message;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1368
    UINT wParam;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1369
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1370
    struct queuedEvent *ev = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1371
    int repeatCount = 0;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1372
    int needSetEvent, i;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1373
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1374
    /*
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1375
     * get an event ...
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1376
     */
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1377
    for (;;) {
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1378
	for (i=0; i<NUMQUICKFREE; i++) {
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1379
	    if (ev = quickFreeEvent[i]) {
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1380
		quickFreeEvent[i] = (struct queuedEvent *)0;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1381
		break;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1382
	    }
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1383
	}
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1384
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1385
	if (ev) {
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1386
	    break;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1387
	}
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1388
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1389
	if (! lockEventFreeList()) {
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1390
	    fprintf(stderr, "WinWorkstation: could not lock evFreeList\n");
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1391
	    return;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1392
	}
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1393
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1394
	ev = eventFreeList;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1395
	if (ev) {
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1396
	    eventFreeList = ev->ev_next;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1397
	    unlockEventFreeList();
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1398
	    break;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1399
	}
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1400
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1401
	unlockEventFreeList();
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1402
	SetEvent(hInputEvent);
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1403
	if (repeatCount++ >= 5) {
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1404
	    fprintf(stderr, "WinWorkstation: event throw away\n");
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1405
	    /* throw away sorry */
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1406
	    return;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1407
	}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1408
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1409
	fprintf(stderr, "WinWorkstation: wait for event memory\n");
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1410
	Sleep(2);
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1411
    }
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1412
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1413
    ev->ev_flag = flag;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1414
    ev->ev_hWnd = hWnd;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1415
    ev->ev_message = message;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1416
    ev->ev_wParam = wParam;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1417
    ev->ev_arg1 = arg1;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1418
    ev->ev_arg2 = arg2;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1419
    ev->ev_arg3 = arg3;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1420
    ev->ev_arg4 = arg4;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1421
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1422
    lockEventQ();
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1423
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1424
    needSetEvent = (eventQueueHead == NULL);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1425
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1426
    if (atFront) {
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1427
	ev->count = -1;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1428
	ev->ev_next = eventQueueHead;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1429
	eventQueueHead = ev;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1430
	if (eventQueueTail == 0) {
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1431
	    eventQueueTail = ev;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1432
	}
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1433
    } else {
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1434
	ev->count = eventsendcount++;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1435
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1436
	ev->ev_next = (struct queuedEvent *)0;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1437
	if (eventQueueTail) {
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1438
	    eventQueueTail->ev_next = ev;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1439
	} else {
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1440
	    eventQueueHead = ev;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1441
	}
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1442
	eventQueueTail = ev;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1443
    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1444
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1445
    unlockEventQ();
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1446
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1447
    if (needSetEvent) {
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1448
	SetEvent(hInputEvent);
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1449
    }
2511
5795501d41cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2508
diff changeset
  1450
2337
79f957096b99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2336
diff changeset
  1451
#if 0
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1452
    SetThreadPriority(_masterThread,THREAD_PRIORITY_HIGHEST);
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1453
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1454
}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1455
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1456
static int
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1457
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
  1458
{
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1459
    struct queuedEvent *ev = NULL;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1460
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1461
    if (mask != ~0) {
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1462
	PRINTF(("deqEvent mask:%x\n",mask));
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1463
    }
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1464
    if (hWnd) {
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1465
	PRINTF(("deqEvent hWnd:%x\n",hWnd));
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1466
    }
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1467
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1468
  again: ;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1469
    if (lockEventQ()) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1470
	TH_DPRINTF(("TDEQ\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1471
	ev = eventQueueHead;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1472
	if (ev != NULL) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1473
	    eventQueueHead = ev->ev_next;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1474
	    if (! eventQueueHead) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1475
		eventQueueTail = (struct queuedEvent *)0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1476
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1477
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1478
	unlockEventQ();
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1479
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1480
	if (ev != NULL) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1481
	    if (ev->count != -1) {
2630
f1c54987ea84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2629
diff changeset
  1482
		static int anyGoodEventReceived = 1;
f1c54987ea84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2629
diff changeset
  1483
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1484
		if (eventempfcount != ev->count) {
2630
f1c54987ea84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2629
diff changeset
  1485
		    if (anyGoodEventReceived) {    
f1c54987ea84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2629
diff changeset
  1486
			fprintf(stderr, "WinWorkstation [warning]: lost event (eventcount error %d <-> %d)\n",
f1c54987ea84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2629
diff changeset
  1487
					 eventempfcount, ev->count);
f1c54987ea84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2629
diff changeset
  1488
		    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1489
		    eventempfcount = ev->count;
2630
f1c54987ea84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2629
diff changeset
  1490
		    anyGoodEventReceived = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1491
		} else {
2630
f1c54987ea84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2629
diff changeset
  1492
		    anyGoodEventReceived = 1;
f1c54987ea84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2629
diff changeset
  1493
		}
f1c54987ea84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2629
diff changeset
  1494
		eventempfcount++;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1495
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1496
	    if (ev->ev_message == WM_DESTROY) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1497
		if (ev->ev_arg2) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1498
		    free((char*)ev->ev_arg2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1499
		    ev->ev_arg2 = 0;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1500
		}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1501
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1502
#ifdef TOPWINDOWCLASS
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1503
		if (ev->ev_arg1) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1504
		    if (UnregisterClass((char*)ev->ev_arg1,(HANDLE) __getHInstance())) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1505
			/*printf("UnregisterClass %s ok.\n",(char*)ev->ev_arg1);*/
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1506
			free((char*)ev->ev_arg1);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1507
			ev->ev_arg1 = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1508
		    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1509
			/* noch einmal in die queue */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1510
			if (ev->ev_arg2++ < 100) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1511
			    lockEventQ();
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1512
			    ev->ev_next = (struct queuedEvent *)0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1513
			    ev->count = eventsendcount++;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1514
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1515
			    if (eventQueueTail) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1516
				eventQueueTail->ev_next = ev;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1517
			    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1518
				eventQueueHead = ev;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1519
			    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1520
			    eventQueueTail = ev;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1521
			    unlockEventQ();
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1522
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1523
			    if (ev->ev_arg2 > 98) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1524
				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
  1525
				sleep(1);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1526
			    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1527
				sleep(0);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1528
			    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1529
			    goto again;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1530
			} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1531
			    /* fail evtl. später ändern und in st verzögert aufrufen */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1532
			    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
  1533
			    free((char*)ev->ev_arg1);
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1534
			    ev->ev_arg1 = 0;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1535
			}
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1536
		    }
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1537
		}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1538
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1539
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1540
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1541
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1542
	if (ev) {
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1543
	    int i;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1544
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1545
	    *ret_ev = *ev;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1546
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1547
	    for (i=0; i<NUMQUICKFREE; i++) {
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1548
		if (quickFreeEvent[i] == 0) {
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1549
		    quickFreeEvent[i] = ev;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1550
		    break;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1551
		}
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1552
	    }
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1553
	    if (i == NUMQUICKFREE) {
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1554
		lockEventFreeList();
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1555
		ev->ev_next = eventFreeList;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1556
		eventFreeList = ev;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1557
		unlockEventFreeList();
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1558
	    }
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1559
	}
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1560
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1561
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1562
#if 0
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1563
    if (!ev)
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1564
	SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_NORMAL);
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1565
#endif
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1566
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1567
    return (ev != 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1568
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1569
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1570
static
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1571
getModifiers()
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1572
{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1573
    int modifiers = 0;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1574
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1575
    if (GetKeyState(VK_SHIFT) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1576
	modifiers |= ShiftMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1577
    if (GetKeyState(VK_CONTROL) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1578
	modifiers |= ControlMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1579
#if 0
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1580
    if (GetKeyState(VK_RMENU) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1581
	modifiers |= RightAltMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1582
    if (GetKeyState(VK_LMENU) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1583
	modifiers |= LeftAltMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1584
#else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1585
    if (GetKeyState(VK_MENU) & 0x8000)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1586
	modifiers |= LeftAltMask;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1587
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1588
    if (GetKeyState(VK_LBUTTON) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1589
	modifiers |= Button1Mask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1590
    if (GetKeyState(VK_MBUTTON) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1591
	modifiers |= Button2Mask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1592
    if (GetKeyState(VK_RBUTTON) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1593
	modifiers |= Button3Mask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1594
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1595
    __modifiers = modifiers;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1596
    return modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1597
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1598
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1599
#ifdef HANDLE_VIEWGRAVITY /* not yet */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1600
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1601
struct gravityCallBackInfo {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1602
    HWND parent;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1603
    int  currX, currY, currW, currH;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1604
    int  newX, newY, newW, newH;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1605
};
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1606
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1607
static BOOL CALLBACK
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1608
gravityEnumeratorCallBack(hChild, iP)
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1609
    HWND hChild;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1610
    struct gravityCallBackInfo *iP;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1611
{
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1612
    localWindowInfo *lI;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1613
    int gravity;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1614
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1615
    if (lI = GETLOCALWINDOWINFOPTR(hChild)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1616
	if ((gravity = lI->viewGravity) != GRAVITY_NONE) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1617
	    switch (gravity) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1618
		case GRAVITY_S:
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1619
		    fprintf(stderr, "South gravity\n");
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1620
		    break;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1621
		default:
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1622
		    fprintf(stderr, "other gravity\n");
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1623
		    break;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1624
	    }
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1625
	}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1626
    }
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1627
    return TRUE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1628
}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1629
#endif /* HANDLE_VIEWGRAVITY */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1630
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1631
static
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1632
winEventProcessing(hWnd, message, wParam, lParam, pDefault)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1633
    HWND hWnd;                /* window handle                   */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1634
    UINT message;             /* type of message                 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1635
    UINT wParam;              /* additional information          */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1636
    LONG lParam;              /* additional information          */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1637
    int *pDefault;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1638
{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1639
    LPMINMAXINFO lpmmi;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1640
    WINDOWPOS *posStruct;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1641
    RECT upd;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1642
    int modifiers;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1643
    int curButton;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1644
    int x, y, w, h;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1645
    int isNative = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1646
    PAINTSTRUCT ps;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1647
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1648
/*
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1649
    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
  1650
			hWnd, message, wParam, lParam));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1651
*/
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1652
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1653
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1654
    /*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1655
     * messages which are enqueued to be handled by the view thread
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1656
     */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1657
    switch (message) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1658
	case WM_CREATE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1659
	    {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1660
		CREATESTRUCT *lpcs = (LPCREATESTRUCT) lParam; // structure with creation data
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1661
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1662
		SETLOCALWINDOWINFOPTR(hWnd, lpcs->lpCreateParams);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1663
#ifdef SUPERDEBUG
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1664
		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
  1665
		    PRINTF(("SETLOCALWINDOWINFOPTR ERROR\n"));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1666
		}
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1667
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1668
		*pDefault = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1669
#ifdef COUNT_RESOURCES
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1670
		__cnt_createWindows++;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1671
		RESPRINTF(("CreateWindows %d\n",__cnt_createWindows));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1672
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1673
		DPRINTF(("WM_CREATE\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1674
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1675
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1676
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1677
	case WM_THREADDESTROYWINDOW:
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1678
	    {
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1679
		HBRUSH br;
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1680
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1681
		if (br = GetWindow_viewBgBrush(hWnd)) {
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1682
		    SetWindow_viewBgBrush(hWnd, 0);
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1683
		    _DeleteObject(br, __LINE__);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1684
		}
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1685
	    }
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1686
	    if (! DestroyWindow(hWnd)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1687
		DPRINTF(("DestroyWindow ERROR\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1688
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1689
	    *pDefault = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1690
	    return 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1691
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1692
	case WM_CLOSE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1693
	    DPRINTF(("WM_CLOSE\n"));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1694
	    if (! destroyWin) {
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1695
		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
  1696
	    } else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1697
		destroyWin = 0;
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1698
		{
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1699
		    HBRUSH br;
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1700
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1701
		    if (br = GetWindow_viewBgBrush(hWnd)) {
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1702
			SetWindow_viewBgBrush(hWnd, 0);
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1703
			_DeleteObject(br, __LINE__);
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1704
		    }
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1705
		}
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1706
		if (! DestroyWindow(hWnd)) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1707
		    DPRINTF(("DestroyWindow ERROR\n"));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1708
		}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1709
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1710
	    *pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1711
	    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1712
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1713
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1714
	case WM_DESTROY:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1715
	    {
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1716
		char *n = 0;
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1717
		localWindowInfo *lI;
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1718
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1719
		DPRINTF(("WM_DESTROY\n"));
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1720
		lI = GETLOCALWINDOWINFOPTR(hWnd);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1721
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1722
#ifdef TOPWINDOWCLASS
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1723
		if (lI) {
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1724
		    if (lI->flag & LI_TOPWIN) {
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1725
			n = (char*) malloc(200);
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1726
			GetClassName(hWnd,n,200);
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1727
		    }
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1728
		    /* free all resources */
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1729
		    /*if (GetWindow_bgBrush(hWnd))
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1730
		     *    _DeleteObject(GetWindow_bgBrush(hWnd), __LINE__);
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1731
		     */
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1732
		    /* freeing now done in other thread */
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1733
		    //free(GETLOCALWINDOWINFOPTR(hWnd));
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1734
		}
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1735
#endif
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1736
		SETLOCALWINDOWINFOPTR(hWnd, 0);
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1737
		enqEvent(ENQ_AT_END, 0, hWnd, message, wParam, (int)n, (int)lI, 0, 0);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1738
#ifdef COUNT_RESOURCES
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1739
		__cnt_createWindows--;
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1740
		RESPRINTF(("DestroyWindows %d\n",__cnt_createWindows));
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1741
#endif
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1742
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1743
		*pDefault = 0;
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1744
		return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1745
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1746
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1747
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1748
	case WM_GETMINMAXINFO:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1749
	    {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1750
		int minW, maxW;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1751
		localWindowInfo *lI;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1752
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1753
		lpmmi = (LPMINMAXINFO) lParam;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1754
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1755
		DDPRINTF(("WM_GETMINMAXINFO handle=%x got min: %d/%d\n",
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1756
			    hWnd,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1757
			    lpmmi->ptMinTrackSize.x,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1758
			    lpmmi->ptMinTrackSize.y));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1759
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1760
		lI = GETLOCALWINDOWINFOPTR(hWnd);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1761
		if (lI && (lI->minWidth) && (lI->maxWidth)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1762
		  lpmmi->ptMaxSize.x = lI->maxWidth;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1763
		  lpmmi->ptMaxSize.y = lI->maxHeight;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1764
		  lpmmi->ptMaxTrackSize.x = lI->maxWidth;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1765
		  lpmmi->ptMaxTrackSize.y = lI->maxHeight;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1766
		  lpmmi->ptMinTrackSize.x = lI->minWidth;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1767
		  lpmmi->ptMinTrackSize.y = lI->minHeight;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1768
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1769
		  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
  1770
				  hWnd,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1771
				  lI->minWidth, lI->minHeight,
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1772
				  lI->maxWidth, lI->maxHeight));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1773
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1774
		*pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1775
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1776
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1777
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1778
	case WM_SETCURSOR:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1779
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1780
		HCURSOR curs;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1781
		int hitCode;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1782
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1783
		hitCode = LOWORD(lParam);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1784
		if (hitCode != HTCLIENT) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1785
		    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1786
		     * not in client area ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1787
		     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1788
		    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1789
		}
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  1790
		DDPRINTF(("WM_SETCURSOR\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1791
		curs = GetWindow_Cursor(hWnd);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1792
		if (curs) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1793
		    SetCursor(curs);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1794
		    *pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1795
		    return 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1796
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1797
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1798
	    return 0;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1799
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1800
	case WM_WINDOWPOSCHANGED:
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1801
	    if (__currentCapture == CAPTURE_NONE) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1802
		POINT p;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1803
		HWND hWndChild,hWndTemp;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1804
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1805
		if (hWnd == __rootWinSpezial) {
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1806
		    *pDefault = 1;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1807
		    return 0;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1808
		}
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1809
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1810
		p.x = evRootX;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1811
		p.y = evRootY;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1812
		ScreenToClient(hWnd, &p);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1813
		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
  1814
		do {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1815
		    hWndTemp = hWndChild;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1816
		    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
  1817
		} while ((hWndChild) && (hWndChild != hWndTemp));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1818
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1819
		if (hWndChild /*&& (hWndChild != hWnd)*/) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1820
		    modifiers = getModifiers();
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1821
		    if (hWndChild != __currentPointerView) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1822
			if (__currentPointerView) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1823
			    if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask)
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1824
				enqEvent(ENQ_AT_END, LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1825
			    __currentPointerView = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1826
			}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1827
			if (GetWindow_eventMask(hWndChild) & EnterWindowMask)
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1828
			    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
  1829
			//SetFocus(hWndChild);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1830
			//printf("WM_WINDOWPOSCHANGED h=%x p=%d.%d in %x\n", hWnd,p.x,p.y,hWndChild);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1831
			__currentPointerView = hWndChild;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1832
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1833
		}
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1834
	    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1835
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1836
	    /*
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1837
	     * ignore child window messages ...
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1838
	     */
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1839
	    if (GetParent(hWnd)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1840
		break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1841
	    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1842
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1843
	    {
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1844
		WINDOWPOS *wp = (WINDOWPOS *)lParam;
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1845
		RECT rct;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1846
		int x, y, w, h;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1847
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1848
#if 0
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1849
		if (wp->flags & SWP_HIDEWINDOW) {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1850
		    fprintf(stderr, "W_UNMAPPED\n");
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1851
		}
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1852
		if (wp->flags & SWP_SHOWWINDOW) {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1853
		    fprintf(stderr, "W_MAPPED\n");
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1854
		}
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1855
#endif
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1856
		GetClientRect(hWnd, &rct);
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1857
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1858
		x = rct.left;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1859
		y = rct.top;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1860
		w = rct.right - rct.left;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1861
		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
  1862
		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
  1863
		DPRINTF(("%d %d %d %d\n",x, y, w, h));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1864
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1865
		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
  1866
#ifdef MAKES_GUI_PAINTER_START_SLOW
2491
be54b494a252 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2464
diff changeset
  1867
		*pDefault = 0;
2464
ad7fcfff0b0c fix slow GUI painter startup - finally
Claus Gittinger <cg@exept.de>
parents: 2463
diff changeset
  1868
#endif
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1869
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1870
	    return 0;
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1871
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1872
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1873
	case WM_ERASEBKGND:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1874
	    EVENT_PRINTF(("WM_ERASEBKGND\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1875
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1876
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1877
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1878
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1879
	    *pDefault = 0;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1880
	    return 1;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1881
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1882
	case WM_PAINT:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1883
	    EVENT_PRINTF(("WM_PAINT\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1884
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1885
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1886
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1887
	    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1888
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1889
	    if (((GetWindow_flag(hWnd) & LI_INPUTWIN) == 0)
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1890
	     && (__rootWinSpezial != hWnd)) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1891
		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
  1892
		    if (GetWindow_eventMask(hWnd) & ExposureMask) {
2620
519011e49878 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2619
diff changeset
  1893
# ifndef LATE_BG_PAINT
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1894
			HDC dc = (HDC)GetDC(hWnd);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1895
			HBRUSH br;
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1896
			int bgClr;
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1897
			int isSolidColorBrush = 0;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1898
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1899
			br = GetWindow_viewBgBrush(hWnd);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1900
			if (! br) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1901
			    isSolidColorBrush = 1;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1902
			    bgClr = GetWindow_viewBgColor(hWnd);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1903
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1904
#  ifdef CACHE_LAST_WM_PAINT_BRUSH
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1905
			    if (wm_paint_brush
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1906
			     && (wm_paint_brush_clr == bgClr)) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1907
				br = wm_paint_brush;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1908
			    } else {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1909
				if (wm_paint_brush) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1910
				    if ((wm_paint_brush != __whiteBrush)
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1911
				     && (wm_paint_brush != __blackBrush)) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1912
					_DeleteObject(wm_paint_brush, __LINE__);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1913
				    }
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1914
				}
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1915
				if (bgClr == WhitePixel) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1916
				    br = __whiteBrush;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1917
				} else if (bgClr == BlackPixel) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1918
				    br = __blackBrush;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1919
				} else {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1920
				    br = CreateSolidBrush(bgClr);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1921
				}
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1922
				wm_paint_brush = br;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1923
				wm_paint_brush_clr = bgClr;
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1924
			    }
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1925
#  else
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1926
			    br = CreateSolidBrush(bgClr);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1927
#  endif
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1928
			}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1929
			if (br) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1930
			    // printf("erase %d %d %d %d\n",rec.left,rec.top,rec.right,rec.bottom);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1931
			    SelectClipRgn(dc, 0);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1932
			    FillRect(dc, &upd, br);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1933
#  ifndef CACHE_LAST_WM_PAINT_BRUSH
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1934
			    if (isSolidColorBrush) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1935
				if ((br != __whiteBrush) && (br != __blackBrush)) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1936
				    _DeleteObject(br, __LINE__);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  1937
				}
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  1938
			    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1939
#  endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1940
			}
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1941
			ReleaseDC(hWnd, dc);
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1942
# endif
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1943
			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
  1944
		    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1945
		}
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1946
	    } else {
2463
b72624912746 GUI painter slow startup
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
  1947
# ifdef THIS_MAKES_GUI_PAINTER_START_SLOW
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1948
		*pDefault = 0;
2463
b72624912746 GUI painter slow startup
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
  1949
# endif
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  1950
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1951
	    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1952
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1953
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1954
	case WM_SIZE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1955
	    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
  1956
#if 0
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1957
	    switch(wParam) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1958
		case SIZE_RESTORED:
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1959
		case SIZE_MAXIMIZED:
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1960
		    GetClientRect(hWnd, (LPRECT) &upd);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1961
		    if (GetWindow_eventMask(hWnd) & ExposureMask)
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1962
			enqEvent(ENQ_AT_END, ExposureMask, hWnd, WM_PAINT, wParam, upd.left, upd.top, upd.right-upd.left+1, upd.bottom-upd.top+1);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1963
		    DPRINTF(("WM_SIZE %x w %d h %d\n",hWnd,LOWORD(lParam),HIWORD(lParam)));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1964
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1965
	    }
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1966
#endif
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1967
	    *pDefault = 0;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1968
	    return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1969
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1970
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1971
	case WM_DROPFILES:
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1972
	    EVENT_PRINTF(("WM_DROPFILES\n"));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1973
	    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
  1974
	    break;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1975
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1976
	case WM_SHOWWINDOW:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1977
	    EVENT_PRINTF(("WM_SHOWWINDOW\n"));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1978
	    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
  1979
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1980
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1981
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1982
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1983
	    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1984
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1985
	case WM_MOUSEACTIVATE :
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1986
	    EVENT_PRINTF2(("WM_MOUSEACTIVATE h=%x\n", hWnd));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1987
	    if (! __activateOnClick) {
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1988
		*pDefault = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1989
		if ((__rootWinSpezial == hWnd)
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1990
		 || (GetActiveWindow() && (LOWORD(lParam) == HTCLIENT)) 
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1991
		    /*((GetWindow_flag(hWnd) & LI_TOPWIN) == 0) */
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  1992
		) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  1993
		    return MA_NOACTIVATE;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1994
		} else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1995
		    return MA_ACTIVATE;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1996
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1997
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1998
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1999
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  2000
	case WM_NCHITTEST:
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  2001
	    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
  2002
	    if (hWnd == __rootWinSpezial) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2003
		*pDefault = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2004
		return HTCLIENT;
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  2005
	    }
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  2006
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2007
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  2008
	case WM_NCACTIVATE:
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  2009
	    EVENT_PRINTF(("WM_NCACTIVATE\n"));
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  2010
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2011
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2012
	case WM_ACTIVATE:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2013
	    CPRINTF(("WM_ACTIVATE %s h=%x\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2014
			    LOWORD(wParam) ? "active" : "inactive",
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2015
			    hWnd));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2016
	    //if (! __activateOnClick)
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2017
	    {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2018
		switch (LOWORD(wParam)) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2019
		    case WA_INACTIVE:
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2020
			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
  2021
			break;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2022
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2023
		    case WA_ACTIVE:
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2024
			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
  2025
#if 0
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2026
			if (__currentCapture == CAPTURE_NONE) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2027
			    POINT p;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2028
			    HWND hWndChild,hWndTemp;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2029
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2030
			    p.x = evRootX;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2031
			    p.y = evRootY;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2032
			    ScreenToClient(hWnd, &p);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2033
			    hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2034
			    do {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2035
				hWndTemp = hWndChild;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2036
				hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2037
			    } while ((hWndChild) && (hWndChild != hWndTemp));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2038
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2039
			    /*printf("WM_ACTIVATE active h=%x p=%d.%d in %x\n", hWnd,p.x,p.y,hWndChild);*/
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2040
			    if (hWndChild /*&& (hWndChild != hWnd)*/) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2041
				modifiers = getModifiers();
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2042
				if (hWndChild != __currentPointerView) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2043
				    if (__currentPointerView) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2044
					if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask)
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2045
					    enqEvent(ENQ_AT_END, LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2046
					__currentPointerView = 0;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2047
				    }
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2048
				    if (GetWindow_eventMask(hWndChild) & EnterWindowMask)
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2049
					enqEvent(ENQ_AT_END, EnterWindowMask,hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2050
				    //SetFocus(hWndChild);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2051
				    __currentPointerView = hWndChild;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2052
				}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2053
			    }
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2054
			}
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2055
#endif
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2056
			break;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2057
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2058
		    case WA_CLICKACTIVE:
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2059
			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
  2060
			break;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2061
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2062
		    default:
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2063
			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
  2064
			break;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2065
		}
2597
6031441d0f0d send activate:view: on WM_ACTIVATE / WM_INACTIVATE
Claus Gittinger <cg@exept.de>
parents: 2593
diff changeset
  2066
		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
  2067
		if (isNative) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2068
		    *pDefault = 1;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2069
		    return 0;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2070
		}
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2071
		*pDefault = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2072
		return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2073
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  2074
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2075
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2076
	case WM_SYSCHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2077
	    EVENT_PRINTF2(("WM_SYSCHAR h=%x %x\n", hWnd, wParam));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2078
	    goto commonChar;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2079
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2080
	case WM_CHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2081
	    EVENT_PRINTF2(("WM_CHAR h=%x %x\n", hWnd, wParam));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2082
	commonChar:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2083
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2084
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2085
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2086
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2087
	    {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2088
		HWND destWindow;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2089
		int evMask;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2090
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2091
		destWindow = __currentPointerView;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2092
		if (destWindow == 0) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2093
		    destWindow = hWnd;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2094
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2095
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2096
		evMask = GetWindow_eventMask(destWindow);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2097
		if (evMask & (KeyPressMask | KeyReleaseMask)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2098
		    POINT p;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2099
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2100
		    modifiers = getModifiers();
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2101
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2102
		    p.x = evRootX;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2103
		    p.y = evRootY;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2104
		    ScreenToClient(destWindow, &p);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2105
		    x = p.x;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2106
		    y = p.y;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2107
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2108
		    if (evMask & KeyPressMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2109
			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
  2110
		    if (evMask & KeyReleaseMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2111
			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
  2112
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2113
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2114
	    *pDefault = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2115
	    return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2116
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2117
	case WM_KEYUP:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2118
	    EVENT_PRINTF2(("WM_KEYUP h=%x %x\n", hWnd, wParam));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2119
	    goto commonKeyUp;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2120
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2121
	case WM_SYSKEYUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2122
	    EVENT_PRINTF2(("WM_SYSKEYUP %x\n, wParam"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2123
	commonKeyUp:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2124
	    if (isNative) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2125
		*pDefault = 1;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2126
		return 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2127
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2128
	    {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2129
		HWND destWindow;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2130
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2131
		destWindow = __currentPointerView;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2132
		if (destWindow == 0) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2133
		    destWindow = hWnd;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2134
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2135
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2136
		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
  2137
		    POINT p;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2138
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2139
		    p.x = evRootX;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2140
		    p.y = evRootY;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2141
		    ScreenToClient(destWindow, &p);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2142
		    x = p.x;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2143
		    y = p.y;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2144
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2145
		    modifiers = getModifiers();
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2146
		    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
  2147
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2148
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2149
	    *pDefault = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2150
	    return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2151
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2152
	case WM_SYSKEYDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2153
	    EVENT_PRINTF2(("WM_SYSKEYDOWN %x\n, wParam"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2154
	    goto commonKey;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2155
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2156
	case WM_KEYDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2157
	    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
  2158
#if 0
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2159
	    /* while debugging ... */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2160
	    if (wParam == VK_ESCAPE) {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2161
		__currentCapture = CAPTURE_NONE;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2162
		ReleaseCapture();
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2163
		CPRINTF(("ReleaseCapture <ESC>\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2164
	    }
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2165
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2166
	commonKey:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2167
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2168
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2169
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2170
	    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2171
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2172
	    {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2173
		HWND destWindow;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2174
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2175
		destWindow = __currentPointerView;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2176
		if (destWindow == 0) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2177
		    destWindow = hWnd;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2178
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2179
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2180
		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
  2181
		    POINT p;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2182
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2183
		    p.x = evRootX;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2184
		    p.y = evRootY;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2185
		    ScreenToClient(destWindow, &p);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2186
		    x = p.x;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2187
		    y = p.y;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2188
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2189
		    modifiers = getModifiers();
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2190
		    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
  2191
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2192
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2193
	    *pDefault = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2194
	    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2195
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2196
	case WM_MOUSEMOVE:
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2197
	    EVENT_PRINTF3(("WM_MOUSEMOVE h=%x\n", hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2198
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2199
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2200
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2201
	    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2202
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2203
	    {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2204
		short x, y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2205
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2206
		x = (int)(short)LOWORD(lParam);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2207
		y = (int)(short)HIWORD(lParam);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2208
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2209
		modifiers = getModifiers();
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2210
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2211
		if (__currentCapture == CAPTURE_NONE) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2212
		    if (hWnd != __currentPointerView) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2213
			if (__currentPointerView) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2214
			    if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask)
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2215
				enqEvent(ENQ_AT_END, LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2216
			    __currentPointerView = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2217
			}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2218
			if (GetWindow_eventMask(hWnd) & EnterWindowMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2219
			    enqEvent(ENQ_AT_END, EnterWindowMask,hWnd, __WM_MOUSEENTER, 0, x, y, 0, modifiers);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2220
			__currentPointerView = hWnd;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2221
		    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2222
		    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
  2223
		} else {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2224
		    CPRINTF(("MouseMove Capture %x\n", __currentPointerView));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2225
		}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2226
		if ((GetWindow_eventMask(__currentPointerView) & PointerMotionMask)
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2227
		 || (modifiers & (Button1Mask|Button2Mask|Button3Mask))) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2228
		     enqEvent(ENQ_AT_END, PointerMotionMask, __currentPointerView, message, wParam, x, y, 0, modifiers);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2229
		}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2230
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2231
	    *pDefault = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2232
	    return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2233
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2234
	case WM_LBUTTONUP:
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2235
	    curButton = Button1;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2236
	    goto commonButtonUp;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2237
	case WM_MBUTTONUP:
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2238
	    curButton = Button2;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2239
	    goto commonButtonUp;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2240
	case WM_RBUTTONUP:
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2241
	    curButton = Button3;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2242
commonButtonUp:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2243
	    if (isNative) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2244
		*pDefault = 1;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2245
		return 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2246
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2247
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2248
	    if (__currentCapture == curButton /* CAPTURE_IMPLICIT*/) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2249
		__currentCapture = CAPTURE_NONE;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2250
		ReleaseCapture();
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2251
		CPRINTF(("ReleaseCapture <BUTTONUP>\n"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2252
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2253
	    modifiers = getModifiers();
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2254
	    EVENT_PRINTF3(("WM_BUTTONUP h=%x pos=%d/%d\n",
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2255
			   hWnd, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam)));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2256
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2257
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2258
	    if (GetWindow_eventMask(hWnd) & ButtonReleaseMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2259
		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
  2260
			 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
  2261
			 wParam, modifiers);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2262
	    *pDefault = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2263
	    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2264
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2265
	case WM_LBUTTONDOWN:
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2266
	    curButton = Button1;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2267
	    goto commonButtonDown;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2268
	case WM_MBUTTONDOWN:
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2269
	    curButton = Button2;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2270
	    goto commonButtonDown;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2271
	case WM_RBUTTONDOWN:
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2272
	    curButton = Button3;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2273
commonButtonDown:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2274
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2275
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2276
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2277
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2278
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2279
	    if (__currentCapture == CAPTURE_NONE) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2280
		__currentCapture = curButton /*CAPTURE_IMPLICIT*/;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2281
		//SetFocus(hWnd);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2282
		SetCapture(hWnd);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2283
		CPRINTF(("SetCapture <BUTTONDOWN>%x\n",hWnd));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2284
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2285
	    goto commonButton;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2286
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2287
	case WM_LBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2288
	case WM_MBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2289
	case WM_RBUTTONDBLCLK:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2290
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2291
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2292
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2293
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2294
	commonButton:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2295
	    modifiers = getModifiers();
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2296
	    EVENT_PRINTF3(("WM_BUTTONDOWN h=%x pos=%d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2297
			   hWnd, LOWORD(lParam), HIWORD(lParam)));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2298
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2299
	    if (GetWindow_eventMask(hWnd) & ButtonPressMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2300
		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
  2301
			 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
  2302
			 wParam, modifiers);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2303
	    *pDefault = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2304
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2305
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2306
	case WM_CAPTURECHANGED:
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2307
	    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
  2308
#if 0
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2309
	    if ((__currentCapture != CAPTURE_NONE) && (__currentCapture != CAPTURE_EXPLICIT))
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2310
	    {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2311
	    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2312
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2313
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2314
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2315
	case WM_KILLFOCUS:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2316
	    CPRINTF(("WM_KILLFOCUS\n"));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2317
	    //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
  2318
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2319
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2320
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2321
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2322
	    *pDefault = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2323
	    return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2324
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2325
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2326
	case WM_SETFOCUS:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2327
	    CPRINTF(("WM_SETFOCUS %x\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2328
#if 0
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2329
	    //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
  2330
	    {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2331
		POINT p;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2332
		HWND hWndChild,hWndTemp;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2333
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2334
		p.x = evRootX;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2335
		p.y = evRootY;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2336
		ScreenToClient(hWnd, &p);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2337
		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
  2338
		do {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2339
		    hWndTemp = hWndChild;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2340
		    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
  2341
		} while ((hWndChild) && (hWndChild != hWndTemp));
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  2342
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2343
		/*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
  2344
		if (hWndChild /*&& (hWndChild != hWnd)*/) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2345
		    modifiers = getModifiers();
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2346
		    if (hWndChild != __currentPointerView) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2347
			if (__currentPointerView) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2348
			    if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask)
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2349
				enqEvent(ENQ_AT_END, LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2350
			    __currentPointerView = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2351
			}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2352
			if (GetWindow_eventMask(hWndChild) & EnterWindowMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2353
			    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
  2354
			//SetFocus(hWndChild);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2355
			__currentPointerView = hWndChild;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2356
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2357
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2358
	    }
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2359
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2360
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2361
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2362
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2363
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2364
	    *pDefault = 0;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2365
#endif
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  2366
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2367
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2368
	case WM_STYLECHANGING:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2369
	    UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGING\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2370
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2371
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2372
	case WM_STYLECHANGED:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2373
	    UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGED\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2374
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2375
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2376
	case WM_GETTEXT:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2377
	    /*EVENT_PRINTF(("WM_GETTEXT %x\n", message));*/
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2378
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2379
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2380
	case WM_GETTEXTLENGTH:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2381
	    EVENT_PRINTF(("WM_GETTEXTLENGTH %x\n", message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2382
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2383
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2384
	case WM_NCCREATE:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2385
	    EVENT_PRINTF(("WM_NCCREATE %x\n", message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2386
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2387
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2388
	case WM_NCMOUSEMOVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2389
	    {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2390
		short x, y;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2391
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2392
		x = (int)(short)LOWORD(lParam);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2393
		y = (int)(short)HIWORD(lParam);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2394
		EVENT_PRINTF(("WM_NCMOUSEMOVE %d/%d\n", x, y));
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2395
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2396
		modifiers = getModifiers();
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2397
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2398
		if (__currentCapture == CAPTURE_NONE) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2399
		    if (hWnd != __currentPointerView) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2400
			if (__currentPointerView) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2401
			    if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask)
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2402
				enqEvent(ENQ_AT_END, LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2403
			    __currentPointerView = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2404
			}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2405
		    }
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2406
		}
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2407
	    }
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2408
	    *pDefault = 0;
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2409
	    return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2410
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2411
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2412
	case WM_PARENTNOTIFY:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2413
	    EVENT_PRINTF2(("WM_PARENTNOTIFY h=%x hChild=%x %d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2414
				hWnd, lParam, LOWORD(wParam)));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2415
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2416
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2417
	case WM_NCLBUTTONDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2418
	    EVENT_PRINTF(("WM_NCLBUTTONDOWN\n"));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2419
	    /*
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2420
	     * with shift, this is a lower-operation
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2421
	     */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2422
	    if (GetKeyState(VK_SHIFT) & 0x8000) {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2423
		SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0, 
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2424
			     SWP_NOSENDCHANGING |
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2425
			     SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2426
		*pDefault = 0;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2427
	    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2428
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2429
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2430
	case WM_NCLBUTTONUP:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2431
	    EVENT_PRINTF(("WM_NCLBUTTONUP\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2432
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2433
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2434
	case WM_NCRBUTTONDOWN:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2435
	    EVENT_PRINTF(("WM_NCRBUTTONDOWN\n"));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2436
	    /*
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2437
	     * this is a lower-operation
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2438
	     */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2439
	    SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0, 
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2440
			 SWP_NOSENDCHANGING |
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2441
			 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
2508
008953d74e91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2499
diff changeset
  2442
	    *pDefault = 0;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2443
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2444
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2445
	case WM_NCRBUTTONUP:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2446
	    EVENT_PRINTF(("WM_NCRBUTTONUP\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2447
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2448
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2449
	case WM_NCMBUTTONDOWN:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2450
	    EVENT_PRINTF(("WM_NCMBUTTONDOWN\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2451
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2452
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2453
	case WM_NCMBUTTONUP:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2454
	    EVENT_PRINTF(("WM_NCMBUTTONUP\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2455
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2456
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2457
	case WM_SETTEXT:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2458
	    EVENT_PRINTF(("WM_SETTEXT\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2459
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2460
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2461
	case 0x88:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2462
	    EVENT_PRINTF(("0x88 (undoc)\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2463
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2464
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2465
	case WM_NCCALCSIZE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2466
	    EVENT_PRINTF(("WM_NCCALCSIZE\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2467
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2468
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2469
	case WM_NCPAINT:
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2470
	    EVENT_PRINTF3(("WM_NCPAINT\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2471
	    break;
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
	case WM_SYSCOMMAND:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2474
	    switch (wParam & ~0x000F) {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2475
		case SC_CLOSE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2476
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_CLOSE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2477
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2478
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2479
		case SC_MOVE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2480
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_MOVE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2481
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2482
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2483
		case SC_RESTORE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2484
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_RESTORE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2485
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2486
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2487
		case SC_SIZE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2488
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_SIZE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2489
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2490
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2491
		default:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2492
		    EVENT_PRINTF2(("WM_SYSCOMMAND %x\n", wParam));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2493
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2494
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2495
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2496
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2497
	case WM_INITMENU:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2498
	    EVENT_PRINTF(("WM_INITMENU\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2499
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2500
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2501
	case WM_INITMENUPOPUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2502
	    EVENT_PRINTF(("WM_INITMENUPOPUP\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2503
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2504
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2505
	case WM_ENTERIDLE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2506
	    EVENT_PRINTF(("WM_ENTERIDLE\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2507
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2508
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2509
	case WM_ENTERMENULOOP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2510
	    EVENT_PRINTF(("WM_ENTERMENULOOP\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2511
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2512
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2513
	case WM_EXITMENULOOP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2514
	    EVENT_PRINTF(("WM_EXITMENULOOP\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2515
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2516
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2517
	case WM_MENUSELECT:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2518
	    EVENT_PRINTF(("WM_MENUSELECT\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2519
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2520
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2521
	case WM_QUIT:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2522
	    UNHANDLED_EVENT_PRINTF(("WM_QUIT\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2523
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2524
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2525
	case WM_NCDESTROY:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2526
	    EVENT_PRINTF(("WM_NCDESTROY\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2527
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2528
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2529
	case WM_QUERYNEWPALETTE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2530
	    EVENT_PRINTF(("WM_QUERYNEWPALETTE\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2531
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2532
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2533
	case WM_PALETTECHANGED:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2534
	    EVENT_PRINTF(("WM_PALETTECHANGED\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2535
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2536
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2537
	case WM_ACTIVATEAPP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2538
	    EVENT_PRINTF2(("WM_ACTIVATEAPP %s\n", wParam ? "active" : "inactive"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2539
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2540
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2541
	case WM_SYSDEADCHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2542
	    EVENT_PRINTF2(("WM_SYSDEADCHAR %x\n, wParam"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2543
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2544
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2545
	case WM_DEADCHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2546
	    EVENT_PRINTF2(("WM_DEADCHAR %x\n, wParam"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2547
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2548
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2549
	case WM_PAINTICON:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2550
	    EVENT_PRINTF(("WM_PAINTICON\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2551
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2552
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2553
	case WM_ICONERASEBKGND:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2554
	    EVENT_PRINTF(("WM_ICONERASEBKGND\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2555
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2556
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2557
	case WM_WINDOWPOSCHANGING:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2558
	    EVENT_PRINTF(("WM_WINDOWPOSCHANGING\n"));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2559
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2560
#ifdef HANDLE_VIEWGRAVITY
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2561
	    /*
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2562
	     * any child with a viewGravity ?
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2563
	     * (only care for topViews here; child views do it
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2564
	     *  on the smalltalk level ...)
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2565
	     */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2566
	    if (1 /* GetParent(hWnd) == 0 */) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2567
		struct gravityCallBackInfo i;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2568
		RECT rct;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2569
		WINDOWPOS *wp = (WINDOWPOS *)lParam;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2570
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2571
		GetClientRect(hWnd, &rct);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2572
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2573
		i.parent = hWnd;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2574
		i.currX = rct.left;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2575
		i.currY = rct.top;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2576
		i.currW = rct.right - rct.left;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2577
		i.currH = rct.bottom - rct.top;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2578
		i.newX = wp->x;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2579
		i.newY = wp->y;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2580
		i.newW = wp->cx;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2581
		i.newH = wp->cy;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2582
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2583
		if ((i.currW != i.newW)
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2584
		 || (i.currH != i.newH)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2585
		    if (GetParent(hWnd) == 0) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2586
			fprintf(stderr, "a topView old: %d/%d %d/%d new: %d/%d %d/%d\n",
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2587
				i.currX, i.currY, i.currW, i.currH,
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2588
				i.newX, i.newY, i.newW, i.newH);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2589
		    } else {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2590
			fprintf(stderr, "a subView old: %d/%d %d/%d new: %d/%d %d/%d\n",
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2591
				i.currX, i.currY, i.currW, i.currH,
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2592
				i.newX, i.newY, i.newW, i.newH);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2593
		    }
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2594
		    EnumChildWindows(hWnd, gravityEnumeratorCallBack, (int)(&i));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2595
		}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2596
	    }
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2597
#endif /* HANDLE_VIEWGRAVITY */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2598
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2599
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2600
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2601
	case WM_QUERYOPEN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2602
	    EVENT_PRINTF(("WM_QUERYOPEN\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2603
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2604
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2605
	case WM_QUERYENDSESSION:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2606
	    EVENT_PRINTF(("WM_QUERYENDSESSION\n"));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2607
	    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
  2608
	    // 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
  2609
	    // 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
  2610
	    // arrives from smalltalk
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  2611
	    // (either positive or negative).
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  2612
	    // 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
  2613
	    // 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
  2614
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  2615
	    *pDefault = 0;
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  2616
	    return 0;    
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  2617
        
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2618
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2619
2602
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2620
	case WM_DISPLAYCHANGE:
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2621
	    EVENT_PRINTF(("WM_DISPLAYCHANGE\n"));
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2622
	    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
  2623
	    break;
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2624
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2625
	case WM_FONTCHANGE:
2602
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  2626
	    EVENT_PRINTF(("WM_FONTCHANGE\n"));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2627
	    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
  2628
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2629
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2630
	case WM_SYSCOLORCHANGE:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2631
	    EVENT_PRINTF(("WM_SYSCOLORCHANGE\n"));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2632
	    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
  2633
	    break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2634
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2635
	case WM_MOVING:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2636
	    EVENT_PRINTF(("WM_MOVING\n"));
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2637
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2638
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2639
	case WM_SIZING:
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2640
	    EVENT_PRINTF(("WM_SIZING\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2641
	    /*__debugEvent__();*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2642
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2643
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2644
	case WM_EXITSIZEMOVE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2645
	    EVENT_PRINTF(("WM_EXITSIZEMOVE\n"));
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2646
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2647
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2648
	case WM_ENTERSIZEMOVE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2649
	    EVENT_PRINTF(("WM_ENTERSIZEMOVE\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2650
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2651
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2652
	case WM_MOVE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2653
	    EVENT_PRINTF(("WM_MOVE\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2654
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2655
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2656
	case WM_POWER:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2657
	    UNHANDLED_EVENT_PRINTF(("WM_POWER\n"));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2658
	    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
  2659
	    break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2660
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2661
	default:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2662
	    UNHANDLED_EVENT_PRINTF(("WinWorkstat [info]: unhandled msg = %x\n", message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2663
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2664
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2665
    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2666
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2667
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2668
LONG APIENTRY
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2669
MainWndProc(HWND hWnd,UINT message,UINT wParam,LONG lParam);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2670
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2671
static void _USERENTRY
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2672
dispatchThread(void *arg)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2673
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2674
    static int th_calls;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2675
    RECT rect;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2676
    MSG msg;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2677
    localWindowInfo *lI;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2678
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2679
    _dispatchThreadId = GetCurrentThreadId();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2680
    TH_DPRINTF(("TS %d\n", th_calls++));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2681
    PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE);   /* must be */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2682
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2683
#ifndef WIN32THREADS
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2684
    AttachThreadInput(_dispatchThreadId, _masterThreadId, TRUE);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2685
# if 0
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2686
    SetThreadPriority(_masterThread,THREAD_PRIORITY_HIGHEST);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2687
    SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_ABOVE_NORMAL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2688
# endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2689
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2690
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2691
    GetWindowRect(GetDesktopWindow(), &rect);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2692
    /* allocate localMemory for Window */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2693
    lI = (localWindowInfo *)malloc(sizeof(localWindowInfo));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2694
    if (lI) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2695
	memset(lI, 0, sizeof(*lI));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2696
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2697
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  2698
    __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
  2699
				       WS_POPUP|WS_DISABLED,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2700
				      0,0,
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2701
				      rect.right-rect.left, rect.bottom-rect.top,
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2702
				      0, 0, (HANDLE) __getHInstance(), lI);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2703
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2704
#if 0
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2705
    printf("__rootWinSpezial %x\n",__rootWinSpezial);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2706
#endif
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  2707
    //ShowWindow(__rootWinSpezial,SW_SHOWNOACTIVATE);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2708
    SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0, 
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2709
		 SWP_NOSENDCHANGING |
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2710
		 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2711
    SetEvent(hCreateEvent);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2712
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2713
    for (;;) {
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2714
	HANDLE dummy;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2715
	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
  2716
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2717
	if (__currentPointerView && (__currentCapture == CAPTURE_NONE)) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2718
	    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
  2719
		/*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2720
		 * 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
  2721
		 */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2722
		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
  2723
		    /*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2724
		     * 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
  2725
		     * for synthetic leave events.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2726
		     */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2727
		    POINT point;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2728
		    if (GetCursorPos(&point)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2729
			HWND hWnd = WindowFromPoint(point);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2730
			if (hWnd) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2731
			    if (GetWindowThreadProcessId(hWnd,0) != GetCurrentThreadId()) {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2732
				if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask)
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2733
				    enqEvent(ENQ_AT_END, LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers());
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2734
				__currentPointerView = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2735
				break;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2736
			    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2737
			}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2738
		    }
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2739
		}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2740
	    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2741
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2742
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2743
	GetMessage(&msg, NULL, 0, 0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2744
	TH_DPRINTF(("TD %d\n", th_calls++));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2745
	destroyWin = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2746
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2747
	switch (msg.message) {
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2748
#if 0
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2749
	    case WM_THREADDESTROYWINDOW:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2750
		destroyWin = TRUE;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2751
		msg.message = WM_CLOSE;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2752
		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
  2753
		break;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2754
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2755
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2756
#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
  2757
	    case WM_THREADSETFOCUS:
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2758
# ifdef xxWIN32THREADS
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2759
		if (msg.lParam) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2760
		    if (AttachThreadInput(_dispatchThreadId,msg.lParam,TRUE) == FALSE)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2761
			PRINTF(("SetFocus AttachThreadInput error %d\n", GetLastError()));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2762
		}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2763
# endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2764
		CPRINTF(("threadSetfocus %x\n",msg.wParam));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2765
		if (SetFocus((HWND)msg.wParam) == 0) {
2491
be54b494a252 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2464
diff changeset
  2766
		    DPRINTF(("SetFocus to %x failed.\n",msg.wParam));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2767
		}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2768
		continue;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2769
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2770
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2771
#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
  2772
	    case WM_THREADSETCURSOR:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2773
		if (msg.lParam) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2774
		    POINT p;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2775
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2776
		    GetCursorPos(&p);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2777
		    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
  2778
			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
  2779
			SetCursor((HCURSOR)msg.lParam);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2780
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2781
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2782
		continue;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2783
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2784
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2785
	    case WM_THREADSETCAPTURE:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2786
		if (msg.wParam) {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2787
		    if (__currentPointerView) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2788
			if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask)
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2789
			    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
  2790
		    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2791
		    __currentPointerView = msg.wParam;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2792
		    __currentCapture = CAPTURE_EXPLICIT;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2793
		    CPRINTF(("threadSetCapture %x\n",msg.wParam));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2794
		    SetCapture(__currentPointerView);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2795
		} else {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2796
		    if (__currentPointerView  == __rootWinSpezial) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2797
			//ShowWindow(__rootWinSpezial, SW_HIDE);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2798
			SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0,
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2799
				     SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2800
				     | SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2801
				   /*| SWP_NOZORDER | SWP_NOOWNERZORDER */);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2802
		    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2803
		    __currentPointerView = 0;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2804
		    __currentCapture = CAPTURE_NONE;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2805
		    CPRINTF(("threadReleaseCapture\n"));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2806
		    ReleaseCapture();
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2807
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2808
		if (msg.lParam) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2809
		    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
  2810
		    SetCursor((HCURSOR)msg.lParam);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2811
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2812
		continue;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2813
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2814
	    case WM_THREADCREATEWINDOW:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2815
		TH_DPRINTF(("C %d\n", th_calls));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2816
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2817
		{
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2818
		    createWindowInfo *cwi = (createWindowInfo *)(msg.lParam);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2819
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2820
		    cwi->xxx = 1;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2821
		    if (cwi->newWinHandle == NULL) {
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  2822
			HANDLE ev;
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  2823
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2824
			cwi->newWinHandle = CreateWindowEx(
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2825
						cwi->winStyleBitsEx,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2826
						cwi->className,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2827
						cwi->windowName,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2828
						cwi->winStyleBits,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2829
						cwi->x, cwi->y,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2830
						cwi->dx, cwi->dy,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2831
						cwi->parentHandle,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2832
						NULL,           /* menu */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2833
						(HANDLE) __getHInstance(),
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2834
						cwi->localWindowInfo 
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2835
					       );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2836
                
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2837
			if (cwi->newWinHandle == NULL) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2838
			    fprintf(stderr, "Create event failed: %d\n", GetLastError());
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2839
			}
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  2840
			ev = cwi->hCreateEvent;
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  2841
			if (ev) {
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  2842
			    SetEvent(ev);
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  2843
			}
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2844
		    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2845
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2846
		continue;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2847
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2848
	    case WM_KEYDOWN:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2849
	    case WM_KEYUP:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2850
	    case WM_SYSKEYDOWN:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2851
	    case WM_SYSKEYUP:
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2852
#ifdef EXIT_WITH_3_CTRL_Cs
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2853
		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
  2854
		    /* CTRL-C */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2855
		    if (c_count++ > 3)  /* for debugging */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2856
			exit(1);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2857
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2858
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2859
		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
  2860
		if (
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2861
		       ((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
  2862
		    || ((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
  2863
		    || (msg.wParam == 0x20)
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2864
		    || (msg.wParam == 0x14)
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2865
		    /*|| (msg.wParam == 0x10)*/
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2866
		    || (msg.wParam >= 0xB0)
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2867
		   )
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2868
		{
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2869
		    /*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2870
		     * 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
  2871
		     */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2872
		    if (TranslateMessage(&msg))
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2873
			continue;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2874
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2875
		break;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2876
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2877
	    /* short cirquit some messages */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2878
#ifndef SUPPORT_NATIVE_WINDOWS
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2879
	    case WM_ERASEBKGND:
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2880
		EVENT_PRINTF(("WM_ERASEBKGND\n"));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2881
		continue;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2882
	    case WM_KILLFOCUS:
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2883
		EVENT_PRINTF(("WM_KILLFOCUS\n"));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2884
		continue;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2885
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2886
	    case WM_SIZE:
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2887
		EVENT_PRINTF(("WM_SIZE\n"));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2888
		continue;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2889
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2890
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2891
	/*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2892
	 * common ...
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2893
	 */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2894
	evRootX = msg.pt.x;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2895
	evRootY = msg.pt.y;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2896
	lastMSGTime = msg.time;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2897
	DispatchMessage(&msg);   /* Dispatches message to window */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2898
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2899
    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2900
}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2901
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2902
LONG APIENTRY
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2903
MainWndProc(HWND hWnd,UINT message,UINT wParam,LONG lParam)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2904
{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2905
    int wantDefault = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2906
    int retVal;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2907
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2908
    TH_DPRINTF(("TMW %d\n",message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2909
    retVal = winEventProcessing(hWnd, message, wParam, lParam, &wantDefault);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2910
    if (wantDefault) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2911
	DDPRINTF((">>DefWindowProc\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2912
	retVal = DefWindowProc(hWnd, message, wParam, lParam);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2913
	DDPRINTF(("<<DefWindowProc\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2914
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2915
    return retVal;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2916
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2917
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2918
static int CALLBACK
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2919
EnumFPTypeFaceProc( lplf, lptm, dwType, lpData )
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2920
	LOGFONT*        lplf;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2921
	TEXTMETRIC*     lptm;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2922
	DWORD           dwType;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2923
	LPARAM          lpData;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2924
{
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2925
	OBJ t;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2926
	OBJ* refToList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2927
	OBJ  typeFaceList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2928
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2929
	if (lplf) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2930
	    refToList = (OBJ*) lpData;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2931
	    __PROTECT__(*refToList);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2932
	    t = __MKSTRING( lplf->lfFaceName );
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2933
	    __UNPROTECT__(*refToList);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2934
	    typeFaceList = *refToList;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2935
	    __SSEND1( typeFaceList, @symbol(add:), 0, t );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2936
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2937
	return 1;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2938
}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2939
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2940
static int CALLBACK
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2941
EnumFontsProc( lplf, lptm, dwType, lpData )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2942
	LOGFONT*      lplf;     /* address of logical-font data */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2943
	TEXTMETRIC*   lptm;     /* address of physical font data */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2944
	DWORD         dwType;   /* font type */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2945
	LPARAM        lpData;   /* address of application supplied data */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2946
{
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2947
	OBJ newArray, t;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2948
	OBJ *refToList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2949
	OBJ list;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2950
	char *s;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2951
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2952
	DPRINTF(("EnumFontProc\n\n\n\n"));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2953
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2954
	if( lplf ) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2955
	    refToList = (OBJ*) lpData;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2956
	    __PROTECT__(*refToList);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2957
	    DPRINTF((" lfHeight          %d\n", lplf->lfHeight ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2958
	    DPRINTF((" lfWidth           %d\n", lplf->lfWidth  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2959
	    DPRINTF((" lfEscapement      %d\n", lplf->lfEscapement  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2960
	    DPRINTF((" lfOrientation     %d\n", lplf->lfOrientation  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2961
	    DPRINTF((" lfWeight          %d\n", lplf->lfWeight  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2962
	    DPRINTF((" lfItalic          %d\n", lplf->lfItalic  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2963
	    DPRINTF((" lfUnderline       %d\n", lplf->lfUnderline  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2964
	    DPRINTF((" lfStrikeOut       %d\n", lplf->lfStrikeOut  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2965
	    DPRINTF((" lfCharSet         %d\n", lplf->lfCharSet  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2966
	    DPRINTF((" lfOutPrecision    %d\n", lplf->lfOutPrecision  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2967
	    DPRINTF((" lfClipPrecision   %d\n", lplf->lfClipPrecision  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2968
	    DPRINTF((" lfQuality         %d\n", lplf->lfQuality  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2969
	    DPRINTF((" lfPitchAndFamily  %d\n", lplf->lfPitchAndFamily  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2970
	    DPRINTF((" lfFaceName        %s\n\n", lplf->lfFaceName  ));
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2971
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2972
	    newArray = __ARRAY_NEW_INT(16);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2973
	    __UNPROTECT__(*refToList);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2974
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2975
	    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
  2976
		__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
  2977
	    else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2978
		//__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
  2979
		__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
  2980
	    }
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2981
	    __ArrayInstPtr(newArray)->a_element[1] = __MKSMALLINT(lplf->lfWidth);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2982
	    __ArrayInstPtr(newArray)->a_element[2] = __MKSMALLINT(lplf->lfEscapement);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2983
	    __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
  2984
	    switch (lplf->lfWeight) {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2985
		case FW_NORMAL:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2986
		    s = "normal";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2987
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2988
		case FW_BOLD:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2989
		    s = "bold";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2990
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2991
		case FW_MEDIUM:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2992
		    s = "medium";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2993
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2994
		case FW_LIGHT:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2995
		    s = "demi";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2996
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2997
		default:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2998
		    s = "other";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2999
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3000
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3001
	    __PROTECT__(*refToList);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3002
	    __PROTECT__(newArray);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3003
	    t = __MKSTRING(s);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3004
	    __UNPROTECT__(newArray);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3005
	    __UNPROTECT__(*refToList);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3006
	    __ArrayInstPtr(newArray)->a_element[4] = t; __STORE(newArray, t);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3007
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3008
	    if( lplf->lfItalic == TRUE ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3009
		if( lplf->lfUnderline == TRUE ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3010
		    if( lplf->lfStrikeOut == TRUE ) {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3011
			s = "italic-underline-strikeOut";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3012
		    } else {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3013
			s = "italic-underline";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3014
		    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3015
		} else {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3016
		    if( lplf->lfStrikeOut == TRUE ) {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3017
			s = "italic-strikeOut";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3018
		    } else {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3019
			s = "italic";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3020
		    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3021
		}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3022
	    } else {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3023
		if( lplf->lfUnderline == TRUE ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3024
		    if( lplf->lfStrikeOut == TRUE ) {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3025
			s = "underline-strikeOut";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3026
		    } else {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3027
			s = "underline";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3028
		    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3029
		} else {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3030
		    if( lplf->lfStrikeOut == TRUE ) {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3031
			s = "strikeOut";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3032
		    } else {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3033
			s = "normal";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3034
		    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3035
		}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3036
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3037
	    __PROTECT__(*refToList);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3038
	    __PROTECT__(newArray);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3039
	    t = __MKSTRING(s);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3040
	    __UNPROTECT__(newArray);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3041
	    __UNPROTECT__(*refToList);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3042
	    __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
  3043
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3044
	    __ArrayInstPtr(newArray)->a_element[5] = __MKSMALLINT(lplf->lfItalic);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3045
	    __ArrayInstPtr(newArray)->a_element[6] = __MKSMALLINT(lplf->lfUnderline);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3046
	    __ArrayInstPtr(newArray)->a_element[7] = __MKSMALLINT(lplf->lfStrikeOut);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3047
	    __ArrayInstPtr(newArray)->a_element[8] = __MKSMALLINT(lplf->lfCharSet);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3048
	    __ArrayInstPtr(newArray)->a_element[9] = __MKSMALLINT(lplf->lfOutPrecision);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3049
	    __ArrayInstPtr(newArray)->a_element[10] = __MKSMALLINT(lplf->lfClipPrecision);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3050
	    __ArrayInstPtr(newArray)->a_element[11] = __MKSMALLINT(lplf->lfQuality);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3051
	    __ArrayInstPtr(newArray)->a_element[12] = __MKSMALLINT(lplf->lfPitchAndFamily);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3052
	    /* ... */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3053
	    __PROTECT__(*refToList);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3054
	    __PROTECT__(newArray);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3055
	    t = __MKSTRING(lplf->lfFaceName);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3056
	    __UNPROTECT__(newArray);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3057
	    __UNPROTECT__(*refToList);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3058
	    __ArrayInstPtr(newArray)->a_element[13] = t; __STORE(newArray, t);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3059
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3060
	    switch (lplf->lfCharSet) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3061
		case ANSI_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3062
		    s = "ansi";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3063
		    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3064
		case DEFAULT_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3065
		    s = "default";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3066
		case SYMBOL_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3067
		    s = "symbol";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3068
		case SHIFTJIS_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3069
		    s = "sjis";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3070
		case GB2312_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3071
		    s = "gb";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3072
		case HANGEUL_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3073
		    s = "hangeul";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3074
		case CHINESEBIG5_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3075
		    s = "big5";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3076
		case OEM_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3077
		    s = "oem";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3078
		    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3079
# ifdef JOHAB_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3080
		case JOHAB_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3081
		    s = "johab";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3082
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3083
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3084
# ifdef HEBREW_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3085
		case HEBREW_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3086
		    s = "hebrew";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3087
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3088
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3089
# ifdef GREEK_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3090
		case GREEK_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3091
		    s = "greek";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3092
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3093
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3094
# ifdef RUSSIAN_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3095
		case RUSSIAN_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3096
		    s = "russian";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3097
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3098
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3099
# ifdef MAC_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3100
		case MAC_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3101
		    s = "mac";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3102
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3103
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3104
		default:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3105
		    s = "unknown";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3106
		    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3107
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3108
	    __PROTECT__(*refToList);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3109
	    __PROTECT__(newArray);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3110
	    t = __MKSTRING(s);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3111
	    __UNPROTECT__(newArray);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3112
	    __UNPROTECT__(*refToList);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3113
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3114
	    __ArrayInstPtr(newArray)->a_element[14] = t; __STORE(newArray, t);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3115
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3116
	    list = *refToList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3117
	    __SSEND1(list, @symbol(add:), 0, newArray);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3118
	}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3119
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3120
	DPRINTF((" dwType            %d\n", dwType ));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3121
	return 1;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3122
}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3123
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3124
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3125
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3126
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3127
!WinWorkstation class methodsFor:'documentation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3128
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3129
copyright
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3130
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3131
COPYRIGHT (c) 1996 by Claus Gittinger
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3132
	      All Rights Reserved
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3133
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3134
 This software is furnished under a license and may be used
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3135
 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
  3136
 inclusion of the above copyright notice.   This software may not
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3137
 be provided or otherwise made available to, or used by, any
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3138
 other person.  No title to or ownership of the software is
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3139
 hereby transferred.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3140
"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3141
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3142
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3143
documentation
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3144
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3145
    See more documentation in my superclass, DeviceWorkstation.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3146
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3147
    [author:]
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3148
	Claus Gittinger (initial port)
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3149
	Manfred Dierolf (many, many changes & fixes, multithreading etc.)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3150
"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3151
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3152
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3153
!WinWorkstation class methodsFor:'initialization'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3154
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  3155
activateOnClick:aBoolean
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  3156
    "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
  3157
     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
  3158
     the window.
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  3159
     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
  3160
     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
  3161
     it disabled.
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  3162
     Returns the previous setting."
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3163
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3164
%{  /* NOCONTEXT */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3165
    OBJ rslt = __activateOnClick ? true : false;
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  3166
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  3167
    if (aBoolean == true) {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3168
       __activateOnClick = 1;
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  3169
    } else {
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  3170
       if (aBoolean == false) {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3171
	   __activateOnClick = 0;
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  3172
       }
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  3173
    }
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  3174
    RETURN (rslt);
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  3175
%}
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  3176
    "
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  3177
     WinWorkstation activateOnClick:true
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  3178
     WinWorkstation activateOnClick:false
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  3179
    "
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  3180
!
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  3181
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3182
initialize
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3183
    |nButtons swap|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3184
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3185
    super initialize.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3186
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3187
    self initializeStandardColorNames.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3188
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3189
    NativeWindows := false.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3190
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3191
    BeepDuration := 200.        "/ millis
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3192
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3193
    ButtonTranslation := #(1 2 2).
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3194
2602
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  3195
"/    nButtons := self getSystemMetrics:#mouseButtons.
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  3196
"/    swap := self getSystemMetrics:#swapButton.
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  3197
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  3198
"/    nButtons == 0 ifTrue:[
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  3199
"/        'WinWorkstation [warning]: mouse-less operation may not work' infoPrintCR.
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  3200
"/    ] ifFalse:[
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  3201
"/        nButtons == 2 ifTrue:[
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  3202
"/            ButtonTranslation := #(1 2).
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  3203
"/        ].
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  3204
"/        swap ifTrue:[
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  3205
"/            ButtonTranslation := ButtonTranslation copy reverse
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  3206
"/        ]
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  3207
"/    ].
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3208
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3209
    "/ translation table from ST/X windowType symbol (system-independent)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3210
    "/ to Windows windowClass (windows-specific).
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3211
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3212
    NativeWindowClassTable := IdentityDictionary new.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3213
    NativeWindowClassTable at:#ScrollBar     put:'SCROLLBAR'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3214
    NativeWindowClassTable at:#CheckBox      put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3215
    NativeWindowClassTable at:#RadioButton   put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3216
    NativeWindowClassTable at:#Button        put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3217
    NativeWindowClassTable at:#DefaultButton put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3218
    NativeWindowClassTable at:#ComboBox      put:'COMBOBOX'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3219
    NativeWindowClassTable at:#EditField     put:'EDIT'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3220
    NativeWindowClassTable at:#ListBox       put:'LISTBOX'.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3221
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3222
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3223
initializeStandardColorNames
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3224
    "{ Pragma: +optSpace }"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3225
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3226
    "setup standard color names (X-color names)"
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3227
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3228
    StandardColorValues := Dictionary new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3229
    #(
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3230
	(240 248 255)   'alice blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3231
	(240 248 255)   'AliceBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3232
	(250 235 215)   'antique white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3233
	(250 235 215)   'AntiqueWhite'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3234
	(255 239 219)   'AntiqueWhite1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3235
	(238 223 204)   'AntiqueWhite2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3236
	(205 192 176)   'AntiqueWhite3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3237
	(139 131 120)   'AntiqueWhite4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3238
	(127 255 212)   'aquamarine'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3239
	(127 255 212)   'aquamarine1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3240
	(118 238 198)   'aquamarine2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3241
	(102 205 170)   'aquamarine3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3242
	( 69 139 116)   'aquamarine4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3243
	(240 255 255)   'azure'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3244
	(240 255 255)   'azure1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3245
	(224 238 238)   'azure2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3246
	(193 205 205)   'azure3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3247
	(131 139 139)   'azure4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3248
	(245 245 220)   'beige'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3249
	(255 228 196)   'bisque'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3250
	(255 228 196)   'bisque1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3251
	(238 213 183)   'bisque2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3252
	(205 183 158)   'bisque3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3253
	(139 125 107)   'bisque4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3254
	(  0   0   0)   'black'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3255
	(255 235 205)   'blanched almond'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3256
	(255 235 205)   'BlanchedAlmond'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3257
	(  0   0 255)   'blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3258
	(138  43 226)   'blue violet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3259
	(  0   0 255)   'blue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3260
	(  0   0 238)   'blue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3261
	(  0   0 205)   'blue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3262
	(  0   0 139)   'blue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3263
	(138  43 226)   'BlueViolet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3264
	(165  42  42)   'brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3265
	(255  64  64)   'brown1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3266
	(238  59  59)   'brown2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3267
	(205  51  51)   'brown3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3268
	(139  35  35)   'brown4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3269
	(222 184 135)   'burlywood'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3270
	(255 211 155)   'burlywood1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3271
	(238 197 145)   'burlywood2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3272
	(205 170 125)   'burlywood3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3273
	(139 115  85)   'burlywood4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3274
	( 95 158 160)   'cadet blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3275
	( 95 158 160)   'CadetBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3276
	(152 245 255)   'CadetBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3277
	(142 229 238)   'CadetBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3278
	(122 197 205)   'CadetBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3279
	( 83 134 139)   'CadetBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3280
	(127 255   0)   'chartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3281
	(127 255   0)   'chartreuse1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3282
	(118 238   0)   'chartreuse2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3283
	(102 205   0)   'chartreuse3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3284
	( 69 139   0)   'chartreuse4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3285
	(210 105  30)   'chocolate'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3286
	(255 127  36)   'chocolate1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3287
	(238 118  33)   'chocolate2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3288
	(205 102  29)   'chocolate3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3289
	(139  69  19)   'chocolate4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3290
	(255 127  80)   'coral'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3291
	(255 114  86)   'coral1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3292
	(238 106  80)   'coral2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3293
	(205  91  69)   'coral3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3294
	(139  62  47)   'coral4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3295
	(100 149 237)   'cornflower blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3296
	(100 149 237)   'CornflowerBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3297
	(255 248 220)   'cornsilk'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3298
	(255 248 220)   'cornsilk1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3299
	(238 232 205)   'cornsilk2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3300
	(205 200 177)   'cornsilk3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3301
	(139 136 120)   'cornsilk4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3302
	(  0 255 255)   'cyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3303
	(  0 255 255)   'cyan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3304
	(  0 238 238)   'cyan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3305
	(  0 205 205)   'cyan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3306
	(  0 139 139)   'cyan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3307
	(  0   0 139)   'dark blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3308
	(  0 139 139)   'dark cyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3309
	(184 134  11)   'dark goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3310
	(169 169 169)   'dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3311
	(  0 100   0)   'dark green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3312
	(169 169 169)   'dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3313
	(189 183 107)   'dark khaki'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3314
	(139   0 139)   'dark magenta'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3315
	( 85 107  47)   'dark olive green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3316
	(255 140   0)   'dark orange'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3317
	(153  50 204)   'dark orchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3318
	(139   0   0)   'dark red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3319
	(233 150 122)   'dark salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3320
	(143 188 143)   'dark sea green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3321
	( 72  61 139)   'dark slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3322
	( 47  79  79)   'dark slate gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3323
	( 47  79  79)   'dark slate grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3324
	(  0 206 209)   'dark turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3325
	(148   0 211)   'dark violet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3326
	(  0   0 139)   'DarkBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3327
	(  0 139 139)   'DarkCyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3328
	(184 134  11)   'DarkGoldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3329
	(255 185  15)   'DarkGoldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3330
	(238 173  14)   'DarkGoldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3331
	(205 149  12)   'DarkGoldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3332
	(139 101   8)   'DarkGoldenrod4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3333
	(169 169 169)   'DarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3334
	(  0 100   0)   'DarkGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3335
	(169 169 169)   'DarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3336
	(189 183 107)   'DarkKhaki'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3337
	(139   0 139)   'DarkMagenta'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3338
	( 85 107  47)   'DarkOliveGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3339
	(202 255 112)   'DarkOliveGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3340
	(188 238 104)   'DarkOliveGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3341
	(162 205  90)   'DarkOliveGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3342
	(110 139  61)   'DarkOliveGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3343
	(255 140   0)   'DarkOrange'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3344
	(255 127   0)   'DarkOrange1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3345
	(238 118   0)   'DarkOrange2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3346
	(205 102   0)   'DarkOrange3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3347
	(139  69   0)   'DarkOrange4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3348
	(153  50 204)   'DarkOrchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3349
	(191  62 255)   'DarkOrchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3350
	(178  58 238)   'DarkOrchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3351
	(154  50 205)   'DarkOrchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3352
	(104  34 139)   'DarkOrchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3353
	(139   0   0)   'DarkRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3354
	(233 150 122)   'DarkSalmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3355
	(143 188 143)   'DarkSeaGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3356
	(193 255 193)   'DarkSeaGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3357
	(180 238 180)   'DarkSeaGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3358
	(155 205 155)   'DarkSeaGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3359
	(105 139 105)   'DarkSeaGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3360
	( 72  61 139)   'DarkSlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3361
	( 47  79  79)   'DarkSlateGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3362
	(151 255 255)   'DarkSlateGray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3363
	(141 238 238)   'DarkSlateGray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3364
	(121 205 205)   'DarkSlateGray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3365
	( 82 139 139)   'DarkSlateGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3366
	( 47  79  79)   'DarkSlateGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3367
	(  0 206 209)   'DarkTurquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3368
	(148   0 211)   'DarkViolet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3369
	(255  20 147)   'deep pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3370
	(  0 191 255)   'deep sky blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3371
	(255  20 147)   'DeepPink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3372
	(255  20 147)   'DeepPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3373
	(238  18 137)   'DeepPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3374
	(205  16 118)   'DeepPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3375
	(139  10  80)   'DeepPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3376
	(  0 191 255)   'DeepSkyBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3377
	(  0 191 255)   'DeepSkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3378
	(  0 178 238)   'DeepSkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3379
	(  0 154 205)   'DeepSkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3380
	(  0 104 139)   'DeepSkyBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3381
	(105 105 105)   'dim gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3382
	(105 105 105)   'dim grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3383
	(105 105 105)   'DimGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3384
	(105 105 105)   'DimGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3385
	( 30 144 255)   'dodger blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3386
	( 30 144 255)   'DodgerBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3387
	( 30 144 255)   'DodgerBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3388
	( 28 134 238)   'DodgerBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3389
	( 24 116 205)   'DodgerBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3390
	( 16  78 139)   'DodgerBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3391
	(178  34  34)   'firebrick'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3392
	(255  48  48)   'firebrick1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3393
	(238  44  44)   'firebrick2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3394
	(205  38  38)   'firebrick3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3395
	(139  26  26)   'firebrick4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3396
	(255 250 240)   'floral white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3397
	(255 250 240)   'FloralWhite'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3398
	( 34 139  34)   'forest green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3399
	( 34 139  34)   'ForestGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3400
	(220 220 220)   'gainsboro'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3401
	(248 248 255)   'ghost white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3402
	(248 248 255)   'GhostWhite'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3403
	(255 215   0)   'gold'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3404
	(255 215   0)   'gold1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3405
	(238 201   0)   'gold2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3406
	(205 173   0)   'gold3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3407
	(139 117   0)   'gold4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3408
	(218 165  32)   'goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3409
	(255 193  37)   'goldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3410
	(238 180  34)   'goldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3411
	(205 155  29)   'goldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3412
	(139 105  20)   'goldenrod4'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3413
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3414
	(192 192 192)   'grey'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3415
	(  0   0   0)   'grey0'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3416
	(  3   3   3)   'grey1'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3417
	( 26  26  26)   'grey10'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3418
	(255 255 255)   'grey100'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3419
	( 28  28  28)   'grey11'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3420
	( 31  31  31)   'grey12'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3421
	( 33  33  33)   'grey13'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3422
	( 36  36  36)   'grey14'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3423
	( 38  38  38)   'grey15'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3424
	( 41  41  41)   'grey16'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3425
	( 43  43  43)   'grey17'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3426
	( 46  46  46)   'grey18'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3427
	( 48  48  48)   'grey19'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3428
	(  5   5   5)   'grey2'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3429
	( 51  51  51)   'grey20'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3430
	( 54  54  54)   'grey21'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3431
	( 56  56  56)   'grey22'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3432
	( 59  59  59)   'grey23'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3433
	( 61  61  61)   'grey24'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3434
	( 64  64  64)   'grey25'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3435
	( 66  66  66)   'grey26'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3436
	( 69  69  69)   'grey27'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3437
	( 71  71  71)   'grey28'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3438
	( 74  74  74)   'grey29'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3439
	(  8   8   8)   'grey3'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3440
	( 77  77  77)   'grey30'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3441
	( 79  79  79)   'grey31'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3442
	( 82  82  82)   'grey32'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3443
	( 84  84  84)   'grey33'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3444
	( 87  87  87)   'grey34'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3445
	( 89  89  89)   'grey35'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3446
	( 92  92  92)   'grey36'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3447
	( 94  94  94)   'grey37'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3448
	( 97  97  97)   'grey38'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3449
	( 99  99  99)   'grey39'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3450
	( 10  10  10)   'grey4'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3451
	(102 102 102)   'grey40'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3452
	(105 105 105)   'grey41'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3453
	(107 107 107)   'grey42'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3454
	(110 110 110)   'grey43'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3455
	(112 112 112)   'grey44'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3456
	(115 115 115)   'grey45'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3457
	(117 117 117)   'grey46'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3458
	(120 120 120)   'grey47'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3459
	(122 122 122)   'grey48'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3460
	(125 125 125)   'grey49'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3461
	( 13  13  13)   'grey5'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3462
	(127 127 127)   'grey50'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3463
	(130 130 130)   'grey51'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3464
	(133 133 133)   'grey52'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3465
	(135 135 135)   'grey53'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3466
	(138 138 138)   'grey54'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3467
	(140 140 140)   'grey55'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3468
	(143 143 143)   'grey56'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3469
	(145 145 145)   'grey57'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3470
	(148 148 148)   'grey58'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3471
	(150 150 150)   'grey59'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3472
	( 15  15  15)   'grey6'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3473
	(153 153 153)   'grey60'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3474
	(156 156 156)   'grey61'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3475
	(158 158 158)   'grey62'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3476
	(161 161 161)   'grey63'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3477
	(163 163 163)   'grey64'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3478
	(166 166 166)   'grey65'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3479
	(168 168 168)   'grey66'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3480
	(171 171 171)   'grey67'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3481
	(173 173 173)   'grey68'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3482
	(176 176 176)   'grey69'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3483
	( 18  18  18)   'grey7'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3484
	(179 179 179)   'grey70'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3485
	(181 181 181)   'grey71'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3486
	(184 184 184)   'grey72'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3487
	(186 186 186)   'grey73'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3488
	(189 189 189)   'grey74'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3489
	(191 191 191)   'grey75'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3490
	(194 194 194)   'grey76'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3491
	(196 196 196)   'grey77'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3492
	(199 199 199)   'grey78'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3493
	(201 201 201)   'grey79'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3494
	( 20  20  20)   'grey8'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3495
	(204 204 204)   'grey80'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3496
	(207 207 207)   'grey81'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3497
	(209 209 209)   'grey82'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3498
	(212 212 212)   'grey83'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3499
	(214 214 214)   'grey84'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3500
	(217 217 217)   'grey85'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3501
	(219 219 219)   'grey86'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3502
	(222 222 222)   'grey87'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3503
	(224 224 224)   'grey88'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3504
	(227 227 227)   'grey89'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3505
	( 23  23  23)   'grey9'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3506
	(229 229 229)   'grey90'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3507
	(232 232 232)   'grey91'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3508
	(235 235 235)   'grey92'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3509
	(237 237 237)   'grey93'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3510
	(240 240 240)   'grey94'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3511
	(242 242 242)   'grey95'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3512
	(245 245 245)   'grey96'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3513
	(247 247 247)   'grey97'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3514
	(250 250 250)   'grey98'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3515
	(252 252 252)   'grey99'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3516
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3517
	(192 192 192)   'gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3518
	(  0   0   0)   'gray0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3519
	(  3   3   3)   'gray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3520
	( 26  26  26)   'gray10'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3521
	(255 255 255)   'gray100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3522
	( 28  28  28)   'gray11'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3523
	( 31  31  31)   'gray12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3524
	( 33  33  33)   'gray13'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3525
	( 36  36  36)   'gray14'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3526
	( 38  38  38)   'gray15'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3527
	( 41  41  41)   'gray16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3528
	( 43  43  43)   'gray17'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3529
	( 46  46  46)   'gray18'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3530
	( 48  48  48)   'gray19'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3531
	(  5   5   5)   'gray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3532
	( 51  51  51)   'gray20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3533
	( 54  54  54)   'gray21'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3534
	( 56  56  56)   'gray22'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3535
	( 59  59  59)   'gray23'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3536
	( 61  61  61)   'gray24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3537
	( 64  64  64)   'gray25'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3538
	( 66  66  66)   'gray26'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3539
	( 69  69  69)   'gray27'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3540
	( 71  71  71)   'gray28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3541
	( 74  74  74)   'gray29'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3542
	(  8   8   8)   'gray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3543
	( 77  77  77)   'gray30'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3544
	( 79  79  79)   'gray31'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3545
	( 82  82  82)   'gray32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3546
	( 84  84  84)   'gray33'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3547
	( 87  87  87)   'gray34'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3548
	( 89  89  89)   'gray35'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3549
	( 92  92  92)   'gray36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3550
	( 94  94  94)   'gray37'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3551
	( 97  97  97)   'gray38'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3552
	( 99  99  99)   'gray39'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3553
	( 10  10  10)   'gray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3554
	(102 102 102)   'gray40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3555
	(105 105 105)   'gray41'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3556
	(107 107 107)   'gray42'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3557
	(110 110 110)   'gray43'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3558
	(112 112 112)   'gray44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3559
	(115 115 115)   'gray45'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3560
	(117 117 117)   'gray46'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3561
	(120 120 120)   'gray47'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3562
	(122 122 122)   'gray48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3563
	(125 125 125)   'gray49'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3564
	( 13  13  13)   'gray5'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3565
	(127 127 127)   'gray50'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3566
	(130 130 130)   'gray51'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3567
	(133 133 133)   'gray52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3568
	(135 135 135)   'gray53'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3569
	(138 138 138)   'gray54'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3570
	(140 140 140)   'gray55'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3571
	(143 143 143)   'gray56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3572
	(145 145 145)   'gray57'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3573
	(148 148 148)   'gray58'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3574
	(150 150 150)   'gray59'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3575
	( 15  15  15)   'gray6'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3576
	(153 153 153)   'gray60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3577
	(156 156 156)   'gray61'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3578
	(158 158 158)   'gray62'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3579
	(161 161 161)   'gray63'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3580
	(163 163 163)   'gray64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3581
	(166 166 166)   'gray65'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3582
	(168 168 168)   'gray66'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3583
	(171 171 171)   'gray67'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3584
	(173 173 173)   'gray68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3585
	(176 176 176)   'gray69'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3586
	( 18  18  18)   'gray7'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3587
	(179 179 179)   'gray70'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3588
	(181 181 181)   'gray71'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3589
	(184 184 184)   'gray72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3590
	(186 186 186)   'gray73'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3591
	(189 189 189)   'gray74'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3592
	(191 191 191)   'gray75'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3593
	(194 194 194)   'gray76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3594
	(196 196 196)   'gray77'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3595
	(199 199 199)   'gray78'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3596
	(201 201 201)   'gray79'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3597
	( 20  20  20)   'gray8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3598
	(204 204 204)   'gray80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3599
	(207 207 207)   'gray81'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3600
	(209 209 209)   'gray82'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3601
	(212 212 212)   'gray83'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3602
	(214 214 214)   'gray84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3603
	(217 217 217)   'gray85'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3604
	(219 219 219)   'gray86'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3605
	(222 222 222)   'gray87'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3606
	(224 224 224)   'gray88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3607
	(227 227 227)   'gray89'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3608
	( 23  23  23)   'gray9'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3609
	(229 229 229)   'gray90'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3610
	(232 232 232)   'gray91'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3611
	(235 235 235)   'gray92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3612
	(237 237 237)   'gray93'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3613
	(240 240 240)   'gray94'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3614
	(242 242 242)   'gray95'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3615
	(245 245 245)   'gray96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3616
	(247 247 247)   'gray97'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3617
	(250 250 250)   'gray98'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3618
	(252 252 252)   'gray99'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3619
	(  0 255   0)   'green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3620
	(173 255  47)   'green yellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3621
	(  0 255   0)   'green1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3622
	(  0 238   0)   'green2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3623
	(  0 205   0)   'green3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3624
	(  0 139   0)   'green4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3625
	(173 255  47)   'GreenYellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3626
	(240 255 240)   'honeydew'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3627
	(240 255 240)   'honeydew1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3628
	(224 238 224)   'honeydew2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3629
	(193 205 193)   'honeydew3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3630
	(131 139 131)   'honeydew4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3631
	(255 105 180)   'hot pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3632
	(255 105 180)   'HotPink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3633
	(255 110 180)   'HotPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3634
	(238 106 167)   'HotPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3635
	(205  96 144)   'HotPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3636
	(139  58  98)   'HotPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3637
	(205  92  92)   'indian red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3638
	(205  92  92)   'IndianRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3639
	(255 106 106)   'IndianRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3640
	(238  99  99)   'IndianRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3641
	(205  85  85)   'IndianRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3642
	(139  58  58)   'IndianRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3643
	(255 255 240)   'ivory'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3644
	(255 255 240)   'ivory1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3645
	(238 238 224)   'ivory2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3646
	(205 205 193)   'ivory3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3647
	(139 139 131)   'ivory4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3648
	(240 230 140)   'khaki'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3649
	(255 246 143)   'khaki1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3650
	(238 230 133)   'khaki2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3651
	(205 198 115)   'khaki3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3652
	(139 134  78)   'khaki4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3653
	(230 230 250)   'lavender'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3654
	(255 240 245)   'lavender blush'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3655
	(255 240 245)   'LavenderBlush'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3656
	(255 240 245)   'LavenderBlush1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3657
	(238 224 229)   'LavenderBlush2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3658
	(205 193 197)   'LavenderBlush3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3659
	(139 131 134)   'LavenderBlush4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3660
	(124 252   0)   'lawn green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3661
	(124 252   0)   'LawnGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3662
	(255 250 205)   'lemon chiffon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3663
	(255 250 205)   'LemonChiffon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3664
	(255 250 205)   'LemonChiffon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3665
	(238 233 191)   'LemonChiffon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3666
	(205 201 165)   'LemonChiffon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3667
	(139 137 112)   'LemonChiffon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3668
	(173 216 230)   'light blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3669
	(240 128 128)   'light coral'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3670
	(224 255 255)   'light cyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3671
	(238 221 130)   'light goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3672
	(250 250 210)   'light goldenrod yellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3673
	(211 211 211)   'light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3674
	(144 238 144)   'light green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3675
	(211 211 211)   'light grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3676
	(255 182 193)   'light pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3677
	(255 160 122)   'light salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3678
	( 32 178 170)   'light sea green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3679
	(135 206 250)   'light sky blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3680
	(132 112 255)   'light slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3681
	(119 136 153)   'light slate gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3682
	(119 136 153)   'light slate grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3683
	(176 196 222)   'light steel blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3684
	(255 255 224)   'light yellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3685
	(173 216 230)   'LightBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3686
	(191 239 255)   'LightBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3687
	(178 223 238)   'LightBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3688
	(154 192 205)   'LightBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3689
	(104 131 139)   'LightBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3690
	(240 128 128)   'LightCoral'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3691
	(224 255 255)   'LightCyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3692
	(224 255 255)   'LightCyan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3693
	(209 238 238)   'LightCyan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3694
	(180 205 205)   'LightCyan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3695
	(122 139 139)   'LightCyan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3696
	(238 221 130)   'LightGoldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3697
	(255 236 139)   'LightGoldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3698
	(238 220 130)   'LightGoldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3699
	(205 190 112)   'LightGoldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3700
	(139 129  76)   'LightGoldenrod4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3701
	(250 250 210)   'LightGoldenrodYellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3702
	(211 211 211)   'LightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3703
	(144 238 144)   'LightGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3704
	(211 211 211)   'LightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3705
	(255 182 193)   'LightPink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3706
	(255 174 185)   'LightPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3707
	(238 162 173)   'LightPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3708
	(205 140 149)   'LightPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3709
	(139  95 101)   'LightPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3710
	(255 160 122)   'LightSalmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3711
	(255 160 122)   'LightSalmon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3712
	(238 149 114)   'LightSalmon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3713
	(205 129  98)   'LightSalmon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3714
	(139  87  66)   'LightSalmon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3715
	( 32 178 170)   'LightSeaGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3716
	(135 206 250)   'LightSkyBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3717
	(176 226 255)   'LightSkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3718
	(164 211 238)   'LightSkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3719
	(141 182 205)   'LightSkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3720
	( 96 123 139)   'LightSkyBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3721
	(132 112 255)   'LightSlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3722
	(119 136 153)   'LightSlateGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3723
	(119 136 153)   'LightSlateGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3724
	(176 196 222)   'LightSteelBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3725
	(202 225 255)   'LightSteelBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3726
	(188 210 238)   'LightSteelBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3727
	(162 181 205)   'LightSteelBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3728
	(110 123 139)   'LightSteelBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3729
	(255 255 224)   'LightYellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3730
	(255 255 224)   'LightYellow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3731
	(238 238 209)   'LightYellow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3732
	(205 205 180)   'LightYellow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3733
	(139 139 122)   'LightYellow4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3734
	( 50 205  50)   'lime green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3735
	( 50 205  50)   'LimeGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3736
	(250 240 230)   'linen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3737
	(255   0 255)   'magenta'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3738
	(255   0 255)   'magenta1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3739
	(238   0 238)   'magenta2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3740
	(205   0 205)   'magenta3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3741
	(139   0 139)   'magenta4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3742
	(176  48  96)   'maroon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3743
	(255  52 179)   'maroon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3744
	(238  48 167)   'maroon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3745
	(205  41 144)   'maroon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3746
	(139  28  98)   'maroon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3747
	(102 205 170)   'medium aquamarine'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3748
	(  0   0 205)   'medium blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3749
	(186  85 211)   'medium orchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3750
	(147 112 219)   'medium purple'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3751
	( 60 179 113)   'medium sea green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3752
	(123 104 238)   'medium slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3753
	(  0 250 154)   'medium spring green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3754
	( 72 209 204)   'medium turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3755
	(199  21 133)   'medium violet red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3756
	(102 205 170)   'MediumAquamarine'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3757
	(  0   0 205)   'MediumBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3758
	(186  85 211)   'MediumOrchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3759
	(224 102 255)   'MediumOrchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3760
	(209  95 238)   'MediumOrchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3761
	(180  82 205)   'MediumOrchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3762
	(122  55 139)   'MediumOrchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3763
	(147 112 219)   'MediumPurple'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3764
	(171 130 255)   'MediumPurple1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3765
	(159 121 238)   'MediumPurple2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3766
	(137 104 205)   'MediumPurple3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3767
	( 93  71 139)   'MediumPurple4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3768
	( 60 179 113)   'MediumSeaGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3769
	(123 104 238)   'MediumSlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3770
	(  0 250 154)   'MediumSpringGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3771
	( 72 209 204)   'MediumTurquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3772
	(199  21 133)   'MediumVioletRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3773
	( 25  25 112)   'midnight blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3774
	( 25  25 112)   'MidnightBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3775
	(245 255 250)   'mint cream'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3776
	(245 255 250)   'MintCream'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3777
	(255 228 225)   'misty rose'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3778
	(255 228 225)   'MistyRose'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3779
	(255 228 225)   'MistyRose1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3780
	(238 213 210)   'MistyRose2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3781
	(205 183 181)   'MistyRose3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3782
	(139 125 123)   'MistyRose4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3783
	(255 228 181)   'moccasin'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3784
	(255 222 173)   'navajo white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3785
	(255 222 173)   'NavajoWhite'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3786
	(255 222 173)   'NavajoWhite1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3787
	(238 207 161)   'NavajoWhite2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3788
	(205 179 139)   'NavajoWhite3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3789
	(139 121  94)   'NavajoWhite4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3790
	(  0   0 128)   'navy'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3791
	(  0   0 128)   'navy blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3792
	(  0   0 128)   'NavyBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3793
	(253 245 230)   'old lace'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3794
	(253 245 230)   'OldLace'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3795
	(107 142  35)   'olive drab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3796
	(107 142  35)   'OliveDrab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3797
	(192 255  62)   'OliveDrab1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3798
	(179 238  58)   'OliveDrab2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3799
	(154 205  50)   'OliveDrab3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3800
	(105 139  34)   'OliveDrab4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3801
	(255 165   0)   'orange'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3802
	(255  69   0)   'orange red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3803
	(255 165   0)   'orange1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3804
	(238 154   0)   'orange2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3805
	(205 133   0)   'orange3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3806
	(139  90   0)   'orange4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3807
	(255  69   0)   'OrangeRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3808
	(255  69   0)   'OrangeRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3809
	(238  64   0)   'OrangeRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3810
	(205  55   0)   'OrangeRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3811
	(139  37   0)   'OrangeRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3812
	(218 112 214)   'orchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3813
	(255 131 250)   'orchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3814
	(238 122 233)   'orchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3815
	(205 105 201)   'orchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3816
	(139  71 137)   'orchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3817
	(238 232 170)   'pale goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3818
	(152 251 152)   'pale green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3819
	(175 238 238)   'pale turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3820
	(219 112 147)   'pale violet red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3821
	(238 232 170)   'PaleGoldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3822
	(152 251 152)   'PaleGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3823
	(154 255 154)   'PaleGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3824
	(144 238 144)   'PaleGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3825
	(124 205 124)   'PaleGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3826
	( 84 139  84)   'PaleGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3827
	(175 238 238)   'PaleTurquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3828
	(187 255 255)   'PaleTurquoise1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3829
	(174 238 238)   'PaleTurquoise2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3830
	(150 205 205)   'PaleTurquoise3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3831
	(102 139 139)   'PaleTurquoise4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3832
	(219 112 147)   'PaleVioletRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3833
	(255 130 171)   'PaleVioletRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3834
	(238 121 159)   'PaleVioletRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3835
	(205 104 137)   'PaleVioletRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3836
	(139  71  93)   'PaleVioletRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3837
	(255 239 213)   'papaya whip'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3838
	(255 239 213)   'PapayaWhip'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3839
	(255 218 185)   'peach puff'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3840
	(255 218 185)   'PeachPuff'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3841
	(255 218 185)   'PeachPuff1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3842
	(238 203 173)   'PeachPuff2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3843
	(205 175 149)   'PeachPuff3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3844
	(139 119 101)   'PeachPuff4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3845
	(205 133  63)   'peru'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3846
	(255 192 203)   'pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3847
	(255 181 197)   'pink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3848
	(238 169 184)   'pink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3849
	(205 145 158)   'pink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3850
	(139  99 108)   'pink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3851
	(221 160 221)   'plum'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3852
	(255 187 255)   'plum1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3853
	(238 174 238)   'plum2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3854
	(205 150 205)   'plum3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3855
	(139 102 139)   'plum4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3856
	(176 224 230)   'powder blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3857
	(176 224 230)   'PowderBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3858
	(160  32 240)   'purple'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3859
	(155  48 255)   'purple1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3860
	(145  44 238)   'purple2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3861
	(125  38 205)   'purple3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3862
	( 85  26 139)   'purple4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3863
	(255   0   0)   'red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3864
	(255   0   0)   'red1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3865
	(238   0   0)   'red2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3866
	(205   0   0)   'red3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3867
	(139   0   0)   'red4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3868
	(188 143 143)   'rosy brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3869
	(188 143 143)   'RosyBrown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3870
	(255 193 193)   'RosyBrown1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3871
	(238 180 180)   'RosyBrown2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3872
	(205 155 155)   'RosyBrown3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3873
	(139 105 105)   'RosyBrown4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3874
	( 65 105 225)   'royal blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3875
	( 65 105 225)   'RoyalBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3876
	( 72 118 255)   'RoyalBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3877
	( 67 110 238)   'RoyalBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3878
	( 58  95 205)   'RoyalBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3879
	( 39  64 139)   'RoyalBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3880
	(139  69  19)   'saddle brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3881
	(139  69  19)   'SaddleBrown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3882
	(250 128 114)   'salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3883
	(255 140 105)   'salmon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3884
	(238 130  98)   'salmon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3885
	(205 112  84)   'salmon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3886
	(139  76  57)   'salmon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3887
	(244 164  96)   'sandy brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3888
	(244 164  96)   'SandyBrown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3889
	( 255 206 137)   'scoActiveBackground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3890
	( 43  45  49)   'scoActiveForeground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3891
	( 254 222 255)   'scoActiveTopShadow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3892
	( 172 186 204)   'scoAltBackground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3893
	( 203 203 192)   'scoBackground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3894
	( 11   0 113)   'scoForeground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3895
	( 141 178 215)   'scoHighlight'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3896
	( 255 240 248)   'scoTopShadow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3897
	( 46 139  87)   'sea green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3898
	( 46 139  87)   'SeaGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3899
	( 84 255 159)   'SeaGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3900
	( 78 238 148)   'SeaGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3901
	( 67 205 128)   'SeaGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3902
	( 46 139  87)   'SeaGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3903
	(255 245 238)   'seashell'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3904
	(255 245 238)   'seashell1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3905
	(238 229 222)   'seashell2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3906
	(205 197 191)   'seashell3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3907
	(139 134 130)   'seashell4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3908
	(142 56 142)   'sgi beet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3909
	(197 193 170)   'sgi bright gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3910
	(197 193 170)   'sgi bright grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3911
	(113 198 113)   'sgi chartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3912
	( 85  85  85)   'sgi dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3913
	( 85  85  85)   'sgi dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3914
	(  0   0   0)   'sgi gray 0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3915
	(255 255 255)   'sgi gray 100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3916
	( 30  30  30)   'sgi gray 12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3917
	( 40  40  40)   'sgi gray 16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3918
	( 51  51  51)   'sgi gray 20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3919
	( 61  61  61)   'sgi gray 24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3920
	( 71  71  71)   'sgi gray 28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3921
	( 81  81  81)   'sgi gray 32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3922
	( 91  91  91)   'sgi gray 36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3923
	( 10  10  10)   'sgi gray 4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3924
	(102 102 102)   'sgi gray 40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3925
	(112 112 112)   'sgi gray 44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3926
	(122 122 122)   'sgi gray 48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3927
	(132 132 132)   'sgi gray 52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3928
	(142 142 142)   'sgi gray 56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3929
	(153 153 153)   'sgi gray 60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3930
	(163 163 163)   'sgi gray 64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3931
	(173 173 173)   'sgi gray 68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3932
	(183 183 183)   'sgi gray 72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3933
	(193 193 193)   'sgi gray 76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3934
	( 20  20  20)   'sgi gray 8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3935
	(204 204 204)   'sgi gray 80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3936
	(214 214 214)   'sgi gray 84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3937
	(224 224 224)   'sgi gray 88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3938
	(234 234 234)   'sgi gray 92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3939
	(244 244 244)   'sgi gray 96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3940
	(  0   0   0)   'sgi grey 0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3941
	(255 255 255)   'sgi grey 100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3942
	( 30  30  30)   'sgi grey 12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3943
	( 40  40  40)   'sgi grey 16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3944
	( 51  51  51)   'sgi grey 20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3945
	( 61  61  61)   'sgi grey 24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3946
	( 71  71  71)   'sgi grey 28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3947
	( 81  81  81)   'sgi grey 32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3948
	( 91  91  91)   'sgi grey 36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3949
	( 10  10  10)   'sgi grey 4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3950
	(102 102 102)   'sgi grey 40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3951
	(112 112 112)   'sgi grey 44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3952
	(122 122 122)   'sgi grey 48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3953
	(132 132 132)   'sgi grey 52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3954
	(142 142 142)   'sgi grey 56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3955
	(153 153 153)   'sgi grey 60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3956
	(163 163 163)   'sgi grey 64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3957
	(173 173 173)   'sgi grey 68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3958
	(183 183 183)   'sgi grey 72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3959
	(193 193 193)   'sgi grey 76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3960
	( 20  20  20)   'sgi grey 8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3961
	(204 204 204)   'sgi grey 80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3962
	(214 214 214)   'sgi grey 84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3963
	(224 224 224)   'sgi grey 88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3964
	(234 234 234)   'sgi grey 92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3965
	(244 244 244)   'sgi grey 96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3966
	(125 158 192)   'sgi light blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3967
	(170 170 170)   'sgi light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3968
	(170 170 170)   'sgi light grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3969
	(132 132 132)   'sgi medium gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3970
	(132 132 132)   'sgi medium grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3971
	(142 142  56)   'sgi olive drab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3972
	(198 113 113)   'sgi salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3973
	(113 113 198)   'sgi slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3974
	( 56 142 142)   'sgi teal'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3975
	( 40  40  40)   'sgi very dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3976
	( 40  40  40)   'sgi very dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3977
	(214 214 214)   'sgi very light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3978
	(214 214 214)   'sgi very light grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3979
	(142 56 142)   'SGIBeet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3980
	(197 193 170)   'SGIBrightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3981
	(197 193 170)   'SGIBrightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3982
	(113 198 113)   'SGIChartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3983
	( 85  85  85)   'SGIDarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3984
	( 85  85  85)   'SGIDarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3985
	(  0   0   0)   'SGIGray0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3986
	(255 255 255)   'SGIGray100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3987
	( 30  30  30)   'SGIGray12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3988
	( 40  40  40)   'SGIGray16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3989
	( 51  51  51)   'SGIGray20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3990
	( 61  61  61)   'SGIGray24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3991
	( 71  71  71)   'SGIGray28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3992
	( 81  81  81)   'SGIGray32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3993
	( 91  91  91)   'SGIGray36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3994
	( 10  10  10)   'SGIGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3995
	(102 102 102)   'SGIGray40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3996
	(112 112 112)   'SGIGray44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3997
	(122 122 122)   'SGIGray48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3998
	(132 132 132)   'SGIGray52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3999
	(142 142 142)   'SGIGray56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4000
	(153 153 153)   'SGIGray60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4001
	(163 163 163)   'SGIGray64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4002
	(173 173 173)   'SGIGray68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4003
	(183 183 183)   'SGIGray72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4004
	(193 193 193)   'SGIGray76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4005
	( 20  20  20)   'SGIGray8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4006
	(204 204 204)   'SGIGray80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4007
	(214 214 214)   'SGIGray84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4008
	(224 224 224)   'SGIGray88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4009
	(234 234 234)   'SGIGray92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4010
	(244 244 244)   'SGIGray96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4011
	(  0   0   0)   'SGIGrey0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4012
	(255 255 255)   'SGIGrey100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4013
	( 30  30  30)   'SGIGrey12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4014
	( 40  40  40)   'SGIGrey16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4015
	( 51  51  51)   'SGIGrey20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4016
	( 61  61  61)   'SGIGrey24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4017
	( 71  71  71)   'SGIGrey28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4018
	( 81  81  81)   'SGIGrey32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4019
	( 91  91  91)   'SGIGrey36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4020
	( 10  10  10)   'SGIGrey4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4021
	(102 102 102)   'SGIGrey40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4022
	(112 112 112)   'SGIGrey44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4023
	(122 122 122)   'SGIGrey48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4024
	(132 132 132)   'SGIGrey52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4025
	(142 142 142)   'SGIGrey56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4026
	(153 153 153)   'SGIGrey60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4027
	(163 163 163)   'SGIGrey64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4028
	(173 173 173)   'SGIGrey68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4029
	(183 183 183)   'SGIGrey72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4030
	(193 193 193)   'SGIGrey76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4031
	( 20  20  20)   'SGIGrey8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4032
	(204 204 204)   'SGIGrey80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4033
	(214 214 214)   'SGIGrey84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4034
	(224 224 224)   'SGIGrey88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4035
	(234 234 234)   'SGIGrey92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4036
	(244 244 244)   'SGIGrey96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4037
	(125 158 192)   'SGILightBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4038
	(170 170 170)   'SGILightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4039
	(170 170 170)   'SGILightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4040
	(132 132 132)   'SGIMediumGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4041
	(132 132 132)   'SGIMediumGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4042
	(142 142  56)   'SGIOliveDrab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4043
	(198 113 113)   'SGISalmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4044
	(113 113 198)   'SGISlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4045
	( 56 142 142)   'SGITeal'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4046
	( 40  40  40)   'SGIVeryDarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4047
	( 40  40  40)   'SGIVeryDarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4048
	(214 214 214)   'SGIVeryLightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4049
	(214 214 214)   'SGIVeryLightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4050
	(160  82  45)   'sienna'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4051
	(255 130  71)   'sienna1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4052
	(238 121  66)   'sienna2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4053
	(205 104  57)   'sienna3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4054
	(139  71  38)   'sienna4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4055
	(135 206 235)   'sky blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4056
	(135 206 235)   'SkyBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4057
	(135 206 255)   'SkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4058
	(126 192 238)   'SkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4059
	(108 166 205)   'SkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4060
	( 74 112 139)   'SkyBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4061
	(106  90 205)   'slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4062
	(112 128 144)   'slate gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4063
	(112 128 144)   'slate grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4064
	(106  90 205)   'SlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4065
	(131 111 255)   'SlateBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4066
	(122 103 238)   'SlateBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4067
	(105  89 205)   'SlateBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4068
	( 71  60 139)   'SlateBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4069
	(112 128 144)   'SlateGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4070
	(198 226 255)   'SlateGray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4071
	(185 211 238)   'SlateGray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4072
	(159 182 205)   'SlateGray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4073
	(108 123 139)   'SlateGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4074
	(112 128 144)   'SlateGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4075
	(255 250 250)   'snow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4076
	(255 250 250)   'snow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4077
	(238 233 233)   'snow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4078
	(205 201 201)   'snow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4079
	(139 137 137)   'snow4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4080
	(  0 255 127)   'spring green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4081
	(  0 255 127)   'SpringGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4082
	(  0 255 127)   'SpringGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4083
	(  0 238 118)   'SpringGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4084
	(  0 205 102)   'SpringGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4085
	(  0 139  69)   'SpringGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4086
	( 70 130 180)   'steel blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4087
	( 70 130 180)   'SteelBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4088
	( 99 184 255)   'SteelBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4089
	( 92 172 238)   'SteelBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4090
	( 79 148 205)   'SteelBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4091
	( 54 100 139)   'SteelBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4092
	(210 180 140)   'tan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4093
	(255 165  79)   'tan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4094
	(238 154  73)   'tan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4095
	(205 133  63)   'tan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4096
	(139  90  43)   'tan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4097
	(216 191 216)   'thistle'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4098
	(255 225 255)   'thistle1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4099
	(238 210 238)   'thistle2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4100
	(205 181 205)   'thistle3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4101
	(139 123 139)   'thistle4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4102
	(255  99  71)   'tomato'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4103
	(255  99  71)   'tomato1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4104
	(238  92  66)   'tomato2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4105
	(205  79  57)   'tomato3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4106
	(139  54  38)   'tomato4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4107
	( 64 224 208)   'turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4108
	(  0 245 255)   'turquoise1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4109
	(  0 229 238)   'turquoise2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4110
	(  0 197 205)   'turquoise3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4111
	(  0 134 139)   'turquoise4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4112
	(238 130 238)   'violet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4113
	(208  32 144)   'violet red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4114
	(208  32 144)   'VioletRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4115
	(255  62 150)   'VioletRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4116
	(238  58 140)   'VioletRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4117
	(205  50 120)   'VioletRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4118
	(139  34  82)   'VioletRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4119
	(245 222 179)   'wheat'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4120
	(255 231 186)   'wheat1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4121
	(238 216 174)   'wheat2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4122
	(205 186 150)   'wheat3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4123
	(139 126 102)   'wheat4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4124
	(255 255 255)   'white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4125
	(245 245 245)   'white smoke'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4126
	(245 245 245)   'WhiteSmoke'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4127
	(255 255   0)   'yellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4128
	(154 205  50)   'yellow green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4129
	(255 255   0)   'yellow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4130
	(238 238   0)   'yellow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4131
	(205 205   0)   'yellow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4132
	(139 139   0)   'yellow4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4133
	(154 205  50)   'YellowGreen'   
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4134
    ) pairWiseDo:[ :value :name |
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4135
	StandardColorValues at:name put:value
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4136
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4137
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4138
     WinWorkstation initializeStandardColorNames
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4139
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4140
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4141
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4142
nativeWindows:aBoolean
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4143
    "enable / disable use of native windows"
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4144
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4145
    NativeWindows := aBoolean
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4146
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4147
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4148
!WinWorkstation class methodsFor:'debugging'!
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4149
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4150
bitmapHandleCounts
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4151
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4152
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4153
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4154
#ifdef COUNT_BMP_RESOURCES
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4155
    RETURN ( __MKSMALLINT(__cnt_bitmap));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4156
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4157
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4158
#endif
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4159
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4160
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4161
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4162
bmpDcHandleCounts
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4163
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4164
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4165
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4166
#ifdef COUNT_BMP_RESOURCES
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4167
    RETURN ( __MKSMALLINT(__cnt_bmpdc));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4168
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4169
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4170
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4171
%}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4172
!
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4173
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4174
cursorHandleCounts
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4175
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4176
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4177
%{  /* NOCONTEXT */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4178
#ifdef COUNT_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4179
    RETURN ( __MKSMALLINT(__cnt_cur));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4180
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4181
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4182
#endif
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4183
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4184
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4185
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4186
debug:aBoolean
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4187
    "enable/disable debug prints - this will vanish"
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4188
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4189
%{  /* NOCONTEXT */
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
    __debug__ = (aBoolean == true) ? 1 : 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4192
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4193
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4194
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4195
fontHandleCounts
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4196
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4197
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4198
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4199
#ifdef COUNT_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4200
    RETURN ( __MKSMALLINT(__cnt_font));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4201
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4202
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4203
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4204
%}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4205
!
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4206
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4207
gcDataHandleCounts
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4208
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4209
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4210
%{  /* NOCONTEXT */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4211
#ifdef COUNT_RESOURCES
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4212
    RETURN ( __MKSMALLINT(__cnt_gcData));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4213
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4214
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4215
#endif
2374
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
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4218
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  4219
printHandleCounts
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4220
   "show prim values"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4221
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  4222
   ('WINWORKSTATION: pW=', self windowHandleCounts printString,
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  4223
    'pB=',self bitmapHandleCounts printString,
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  4224
    'pGc=',self gcDataHandleCounts printString,
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  4225
    'pbmpdc=',self bmpDcHandleCounts printString) errorPrintNL
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  4226
!
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  4227
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  4228
windowHandleCounts
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4229
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4230
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4231
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4232
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4233
    RETURN ( __MKSMALLINT(__cnt_createWindows));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4234
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4235
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4236
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4237
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4238
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4239
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4240
!WinWorkstation class methodsFor:'queries'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4241
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4242
platformName
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4243
    "ST-80 compatibility.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4244
     Return a string describing the display systems platform."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4245
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4246
    ^ 'WIN32'  
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4247
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4248
    "Modified: 26.5.1996 / 15:32:46 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4249
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4250
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4251
!WinWorkstation methodsFor:'accessing & queries'!
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
anyButtonMotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4254
    "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
  4255
     This is the devices mask."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4256
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4257
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4258
    RETURN ( __MKSMALLINT(Button1MotionMask | Button2MotionMask | Button3MotionMask));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4259
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4260
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4261
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4262
blackpixel
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4263
    "return the colornumber of black"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4264
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4265
    ^ blackpixel
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4266
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4267
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4268
button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4269
    "return the state-mask for button1 in motion events' state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4270
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4271
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4272
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4273
    RETURN (__MKSMALLINT(Button1MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4274
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4275
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4276
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4277
     Display button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4278
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4279
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4280
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4281
button2MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4282
    "return the state-mask for button2 in motion events' state-field
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4283
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4284
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4285
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4286
    RETURN (__MKSMALLINT(Button2MotionMask)); 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
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
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4290
button3MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4291
    "return the state-mask for button3 in motion events' state-field
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4292
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4293
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4294
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4295
    RETURN (__MKSMALLINT(Button3MotionMask)); 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4296
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4297
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4298
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4299
buttonMotionMask:aButton
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4300
    "return the state-mask for button1 in motion events state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4301
     This is the devices mask."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4302
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4303
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4304
    if (aButton == __MKSMALLINT(1)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4305
	RETURN (__MKSMALLINT(Button1MotionMask));    
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4306
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4307
    if (aButton == __MKSMALLINT(2)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4308
	RETURN (__MKSMALLINT(Button2MotionMask));    
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4309
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4310
    if (aButton == __MKSMALLINT(3)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4311
	RETURN (__MKSMALLINT(Button3MotionMask));    
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4312
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4313
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4314
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4315
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4316
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4317
controlMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4318
    "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
  4319
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4320
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4321
    RETURN (__MKSMALLINT(ControlMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4322
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4323
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4324
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4325
defaultEventMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4326
    "return a mask to enable some events by default."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4327
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4328
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4329
    RETURN (__MKSMALLINT( ExposureMask | StructureNotifyMask |
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4330
			 KeyPressMask | KeyReleaseMask |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4331
			 EnterWindowMask | LeaveWindowMask |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4332
			 ButtonPressMask | ButtonMotionMask | ButtonReleaseMask ));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4333
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4334
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4335
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4336
displayFileDescriptor
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4337
    "return the displays fileNumber for select, if any"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4338
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4339
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4340
   /* RETURN (nil);*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4341
   RETURN ( __MKEXTERNALADDRESS(hInputEvent));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4342
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4343
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4344
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4345
displayName
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4346
    "return the display-connections display name.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4347
     For Windows, a dummy name is returned"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4348
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4349
    ^ 'local'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4350
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4351
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4352
getSystemColor:aKey
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  4353
    "retrieve a windows system color.
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  4354
     The styleSheet/View classes may use this to setup default colors"
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  4355
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4356
    |rgb|
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4357
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4358
    rgb := self primGetSystemColor:aKey.
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4359
    rgb notNil ifTrue:[
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4360
	^ Color
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4361
	    redByte:((rgb bitShift:-16) bitAnd:16rFF)
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4362
	    greenByte:((rgb bitShift:-8) bitAnd:16rFF)
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4363
	    blueByte:(rgb bitAnd:16rFF)
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4364
    ].
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4365
    ^ nil
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  4366
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  4367
    "
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  4368
     Display getSystemColor:#COLOR_WINDOW
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  4369
     Display getSystemColor:#COLOR_HIGHLIGHT
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  4370
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4371
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4372
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4373
getSystemMetrics:aNumberOrSymbol
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4374
    "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
  4375
     as described in the windows API;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4376
     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
  4377
     which must be the define-value."
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4378
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4379
%{  /* NOCONTEXT */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4380
    int info = 0;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4381
    int isBool = 0;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4382
    int arg;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4383
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4384
    if (__isSmallInteger(aNumberOrSymbol)) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4385
	arg = __intVal(aNumberOrSymbol);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4386
    } else if ((aNumberOrSymbol == @symbol(swapButton)) || (aNumberOrSymbol == @symbol(SM_SWAPBUTTON))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4387
	arg = SM_SWAPBUTTON;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4388
	isBool = 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4389
    } else if ((aNumberOrSymbol == @symbol(mouseButtons)) || (aNumberOrSymbol == @symbol(SM_CMOUSEBUTTONS))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4390
	arg = SM_CMOUSEBUTTONS;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4391
    } else if ((aNumberOrSymbol == @symbol(iconWidth)) || (aNumberOrSymbol == @symbol(SM_CXICON))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4392
	arg = SM_CXICON;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4393
    } else if ((aNumberOrSymbol == @symbol(iconHeight)) || (aNumberOrSymbol == @symbol(SM_CYICON))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4394
	arg = SM_CYICON;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4395
    } else if ((aNumberOrSymbol == @symbol(cursorWidth)) || (aNumberOrSymbol == @symbol(SM_CXCURSOR))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4396
	arg = SM_CXCURSOR;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4397
    } else if ((aNumberOrSymbol == @symbol(cursorHeight)) || (aNumberOrSymbol == @symbol(SM_CYCURSOR))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4398
	arg = SM_CYCURSOR;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4399
    } else if ((aNumberOrSymbol == @symbol(captionHeight)) || (aNumberOrSymbol == @symbol(SM_CYCAPTION))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4400
	arg = SM_CYCAPTION;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4401
    } else if ((aNumberOrSymbol == @symbol(resizeFrameWidth)) || (aNumberOrSymbol == @symbol(SM_CXFRAME))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4402
	arg = SM_CXFRAME;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4403
    } else if ((aNumberOrSymbol == @symbol(resizeFrameHeight)) || (aNumberOrSymbol == @symbol(SM_CYFRAME))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4404
	arg = SM_CYFRAME;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4405
    } else if ((aNumberOrSymbol == @symbol(borderFrameWidth)) || (aNumberOrSymbol == @symbol(SM_CXBORDER))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4406
	arg = SM_CXBORDER;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4407
    } else if ((aNumberOrSymbol == @symbol(borderFrameHeight)) || (aNumberOrSymbol == @symbol(SM_CYBORDER))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4408
	arg = SM_CYBORDER;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4409
    } else if ((aNumberOrSymbol == @symbol(fullScreenWindowWidth)) || (aNumberOrSymbol == @symbol(SM_CXFULLSCREEN))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4410
	arg = SM_CXFULLSCREEN;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4411
    } else if ((aNumberOrSymbol == @symbol(fullScreenWindowHeight)) || (aNumberOrSymbol == @symbol(SM_CYFULLSCREEN))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4412
	arg = SM_CYFULLSCREEN;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4413
    } else if ((aNumberOrSymbol == @symbol(vScrollbarWidth)) || (aNumberOrSymbol == @symbol(SM_CXVSCROLL))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4414
	arg = SM_CXVSCROLL;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4415
    } else if ((aNumberOrSymbol == @symbol(hScrollbarHeight)) || (aNumberOrSymbol == @symbol(SM_CYHSCROLL))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4416
	arg = SM_CYHSCROLL;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4417
    } else if ((aNumberOrSymbol == @symbol(vThumbHeight)) || (aNumberOrSymbol == @symbol(SM_CYVTHUMB))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4418
	arg = SM_CYVTHUMB;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4419
    } else if ((aNumberOrSymbol == @symbol(hThumbWidth)) || (aNumberOrSymbol == @symbol(SM_CXHTHUMB))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4420
	arg = SM_CXHTHUMB;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4421
    } else {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4422
	RETURN (nil);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4423
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4424
    info = GetSystemMetrics(arg);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4425
    if (isBool) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4426
	RETURN (info ? true : false);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4427
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4428
    RETURN (__MKSMALLINT(info));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4429
%}
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4430
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4431
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4432
primGetSystemColor:aKey
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4433
%{  /* xxLIMITEDSTACK (WIN95 only) */
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4434
    int p;
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  4435
    int rgb, r, g, b;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4436
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4437
    if (aKey == @symbol(COLOR_WINDOW)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  4438
      p = COLOR_WINDOW;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4439
    } else if (aKey == @symbol(COLOR_WINDOWTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  4440
      p = COLOR_WINDOWTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4441
    } else if (aKey == @symbol(COLOR_MENU)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  4442
      p = COLOR_MENU;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4443
    } else if (aKey == @symbol(COLOR_MENUTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  4444
      p = COLOR_MENUTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4445
    } else if (aKey == @symbol(COLOR_BTNFACE)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  4446
      p = COLOR_BTNFACE;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4447
    } else if (aKey == @symbol(COLOR_BTNSHADOW)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  4448
      p = COLOR_BTNSHADOW;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4449
    } else if (aKey == @symbol(COLOR_BTNTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  4450
      p = COLOR_BTNTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4451
    } else if (aKey == @symbol(COLOR_GRAYTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  4452
      p = COLOR_GRAYTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4453
    } else if (aKey == @symbol(COLOR_HIGHLIGHT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  4454
      p = COLOR_HIGHLIGHT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4455
    } else if (aKey == @symbol(COLOR_HIGHLIGHTTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  4456
      p = COLOR_HIGHLIGHTTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4457
    } else if (aKey == @symbol(COLOR_MENU)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  4458
      p = COLOR_MENU;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4459
    } else if (aKey == @symbol(COLOR_MENUTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  4460
      p = COLOR_MENUTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4461
    } else if (aKey == @symbol(COLOR_SCROLLBAR)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  4462
      p = COLOR_SCROLLBAR;
2239
f535b1178597 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  4463
#ifdef COLOR_SHADOW
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4464
    } else if (aKey == @symbol(COLOR_SHADOW)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  4465
      p = COLOR_SHADOW;
2239
f535b1178597 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  4466
#endif
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4467
    } else {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  4468
      RETURN (nil);
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4469
    }
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  4470
    rgb = GetSysColor(p);
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  4471
    /* win uses BGR order */
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  4472
    r = rgb & 0xFF;
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  4473
    g = (rgb >> 8) & 0xFF;
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  4474
    b = (rgb >> 16) & 0xFF;
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  4475
    rgb = (((r << 8) | g) << 8) | b;
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  4476
    RETURN (__MKSMALLINT(rgb));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4477
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4478
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4479
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4480
primTranslatePointX:x y:y from:windowId1 to:windowId2
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4481
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4482
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4483
    HWND w1, w2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4484
    POINT point;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4485
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4486
    if (__isExternalAddress(windowId1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4487
     && __isExternalAddress(windowId2)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4488
     && __bothSmallInteger(x, y)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4489
	w1 = _HWNDVal(windowId1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4490
	w2 = _HWNDVal(windowId2);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4491
	point.x = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4492
	point.y = __intVal(y);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4493
	DPRINTF(("TransPoint %x %d/%d ->",w1,point.x,point.y));
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4494
	if (ClientToScreen(w1,&point) == FALSE) {
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4495
	    RETURN (nil);
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4496
	}
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4497
	if (ScreenToClient(w2,&point) == FALSE) {
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4498
	    RETURN (nil);
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4499
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4500
	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
  4501
	RETURN (__MKPOINT_INT(point.x, point.y));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4502
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4503
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4504
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4505
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4506
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4507
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4508
primViewIdFromPoint:aPoint in:windowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4509
    "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
  4510
     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
  4511
     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
  4512
     - 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
  4513
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4514
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4515
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4516
    OBJ xp, yp;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4517
    int xpos, ypos;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4518
    HWND child_return;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4519
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4520
    if (ISCONNECTED
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4521
     && __isExternalAddress(windowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4522
     && __isPoint(aPoint))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4523
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4524
	xp = _point_X(aPoint);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4525
	yp = _point_Y(aPoint);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4526
	if (__bothSmallInteger(xp, yp))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4527
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4528
	    POINT p;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4529
	    HWND hWnd = _HWNDVal(windowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4530
	    p.x = __intVal(xp);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4531
	    p.y = __intVal(yp);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4532
	    ScreenToClient(hWnd, &p);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4533
	    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
  4534
	    /*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
  4535
	    if ((child_return) && (child_return != hWnd))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4536
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4537
		RETURN ( __MKEXTERNALADDRESS(child_return) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4538
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4539
	    RETURN ( nil );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4540
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4541
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4542
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4543
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4544
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4545
protocolVersion
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4546
    "return the displays protocol version.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4547
     For Windows, a dummy number is returned"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4548
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4549
    ^ '1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4550
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4551
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4552
     Display protocolVersion
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4553
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4554
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4555
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4556
serverVendor
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4557
    "return the server vendor string. 
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4558
     For Windows, a dummy name is returned"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4559
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4560
    ^ 'microsoft'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4561
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4562
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4563
     Display serverVendor
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4564
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4565
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4566
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4567
shiftMask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4568
    "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
  4569
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4570
%{  /* NOCONTEXT */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4571
    RETURN (__MKSMALLINT(ShiftMask));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4572
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4573
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4574
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4575
translatePoint:aPoint from:windowId1 to:windowId2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4576
    "given a point in window1, return the coordinate in window2.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4577
     This expects a device coordinate (relative to the first views origin)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4578
     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
  4579
     - use to xlate points from a window to rootwindow"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4580
2276
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4581
    |x1 y1 x2 y2|
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4582
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4583
    x1 := x2 := aPoint x truncated.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4584
    y1 := y2 := aPoint y truncated.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4585
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4586
%{
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4587
    HWND w1, w2;
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4588
    POINT point;
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4589
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4590
    if (__isExternalAddress(windowId1)
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4591
     && __isExternalAddress(windowId2)
2279
30a35be06995 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2276
diff changeset
  4592
     && __bothSmallInteger(x1, y1)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  4593
	w1 = _HWNDVal(windowId1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  4594
	w2 = _HWNDVal(windowId2);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  4595
	point.x = __intVal(x1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  4596
	point.y = __intVal(y1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  4597
	DPRINTF(("TransPoint %x %d/%d ->",w1,point.x,point.y));
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4598
	if (ClientToScreen(w1,&point) == FALSE) {
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4599
	    RETURN (nil);
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4600
	}
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4601
	if (ScreenToClient(w2,&point) == FALSE) {
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4602
	    RETURN (nil);
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4603
	}
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  4604
	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
  4605
	x2 = __MKSMALLINT(point.x);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  4606
	y2 = __MKSMALLINT(point.y);
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4607
    } else {
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  4608
	RETURN (nil);
2276
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4609
    }
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4610
%}.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  4611
    ^ (x2 @ y2)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4612
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4613
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4614
vendorRelease
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4615
    "return the display-servers vendor release 
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4616
     - should normally not be of any interest, 
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4617
     but may be usefule for special cases.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4618
     (to avoid bugs in certain implementations / releases)"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4619
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4620
    ^ 1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4621
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4622
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4623
     Display vendorRelease
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4624
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4625
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4626
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4627
viewIdFromPoint:aPoint in:windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4628
    "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
  4629
     hit by this coordinate. Return nil if no view was hit.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4630
     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
  4631
     - 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
  4632
     
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4633
    windowId notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4634
	aPoint isPoint ifTrue:[
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4635
	    "/(aPoint x > 30000) ifTrue:[self halt.].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4636
	    "/(aPoint y > 30000) ifTrue:[self halt.].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4637
	    "/aPoint printString errorPrintCR.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4638
	    ^ self primViewIdFromPoint:aPoint asPoint truncated in:windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4639
	]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4640
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4641
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4642
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4643
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4644
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4645
whitepixel
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4646
    "return the colornumber of white"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4647
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4648
    ^ whitepixel
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4649
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4650
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4651
!WinWorkstation methodsFor:'accessing display capabilities'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4652
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4653
captionHeight
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4654
    "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
  4655
     standard topWindows."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4656
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4657
    ^ self getSystemMetrics:#captionHeight
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4658
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4659
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4660
iconSizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4661
    "Get the preferred/supported icon sizes."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4662
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4663
    |d w h|
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4664
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4665
    w := self getSystemMetrics:#iconWidth.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4666
    h := self getSystemMetrics:#iconHeight.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4667
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4668
    d := IdentityDictionary new.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4669
    d at:#minWidth put:w.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4670
    d at:#maxWidth put:h.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4671
    d at:#widthStep put:1.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4672
    d at:#minHeight put:w.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4673
    d at:#maxHeight put:h.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4674
    d at:#heightStep put:1.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4675
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4676
    ^ OrderedCollection with:d
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4677
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4678
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4679
     Display iconSizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4680
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4681
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4682
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4683
preferredIconSize
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4684
    "Get the preferrered icon size. 
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4685
     Here, workaround windows (bug?) which returns 32@32
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4686
     although, 20@20 is much nicer"
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4687
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4688
    ^ 20@20
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4689
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4690
    "
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4691
     Display preferredIconSize  
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4692
    "
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4693
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4694
    "Modified: / 28.9.1998 / 13:49:54 / cg"
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4695
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  4696
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4697
scrollsAsynchronous
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4698
    "return true, if this display asynchronously sends expose events after a
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4699
     scroll operation. False otherwise. Asynchronous expose events are an X
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4700
     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
  4701
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4702
    ^ true "/ false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4703
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4704
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4705
supportedImageFormats
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4706
    "return an array with supported image formats; each array entry
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4707
     is another array, consisting of depth and bitsPerPixel values."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4708
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4709
    |info|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4710
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4711
    info := IdentityDictionary new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4712
    info at:#depth put:depth.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4713
    info at:#bitsPerPixel put:depth.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4714
    info at:#padding put:32.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4715
    ^ Array with:info
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  4716
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  4717
    "
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  4718
     Disply supportedImageFormats
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  4719
    "
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  4720
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  4721
    "Modified: / 10.9.1998 / 23:14:05 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4722
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4723
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4724
supportsDeepIcons
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4725
    "return true, if this device supports deepicons."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4726
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4727
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4728
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4729
2604
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  4730
supportsIconMasks
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  4731
    "return true, if this device supports masked icons.
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  4732
     For now, return false since somehow icons are inverted
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  4733
     if we use masks (and I dont know yet why)."
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  4734
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  4735
    ^ false
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  4736
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  4737
    "
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  4738
     Display supportsIconMasks 
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  4739
    "
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  4740
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  4741
    "Modified: / 28.4.1999 / 19:59:17 / cg"
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  4742
!
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  4743
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4744
supportsIconViews
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4745
    "return true, if this device supports views as icons."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4746
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4747
    ^ false "/ true
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4748
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4749
    "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4750
     Display supportsIconViews
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4751
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4752
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4753
    "Modified: 10.6.1996 / 20:11:48 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4754
    "Created: 10.6.1996 / 21:08:18 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4755
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4756
2632
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  4757
supportsMaskedDrawingWith:aForm
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  4758
    "return true, if the device allows the given form pixmap
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  4759
     to be used as paint color. 
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  4760
     Sorry - win95 only supports 8x8 masks."
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  4761
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  4762
    isWin95 ifFalse:[
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  4763
	^ true
2632
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  4764
    ].
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  4765
    ^ (aForm width == 8) and:[aForm height == 8]
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  4766
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  4767
    "Created: / 4.5.1999 / 12:48:49 / cg"
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  4768
    "Modified: / 4.5.1999 / 12:58:31 / cg"
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  4769
!
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  4770
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4771
usableExtent
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4772
    "return the usable extent of the display (in pixels).
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4773
     Normally, the same as extent, but may be smaller, in
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4774
     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
  4775
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4776
    ^ (self getSystemMetrics:#fullScreenWindowWidth)
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4777
      @
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4778
      (self getSystemMetrics:#fullScreenWindowHeight)
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4779
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4780
    "
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4781
     Display usableExtent
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4782
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4783
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4784
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4785
!WinWorkstation methodsFor:'bitmap/window creation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4786
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4787
addMenuItemWithLabel:aString toWindowID:aWindowId
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4788
    "not yet"
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4789
%{
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4790
#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
  4791
    if (__isExternalAddress(aWindowId)) {
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4792
	HWND hWin = _HWNDVal(aWindowId);
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4793
	HMENU hMenu;
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4794
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4795
	hMenu = GetMenu(hWin);
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4796
	if (hMenu) {
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4797
        
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4798
	}
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4799
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4800
#endif
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4801
%}
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4802
!
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  4803
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4804
createBitmapFromArray:anArray width:w height:h
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4805
    |bitmapId|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4806
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4807
    bitmapId := self primCreateBitmapFromArray:anArray width:w height:h.
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4808
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4809
    bitmapId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4810
	'WINWORKSTATION: cannot create bitmap' errorPrintCR.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4811
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4812
    ^ bitmapId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4813
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4814
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4815
createBitmapWidth:w height:h
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4816
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4817
%{  /* xxLIMITEDSTACK (WIN95 only) */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4818
    HANDLE newBitmapHandle;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4819
    int b_width, b_height;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4820
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4821
    if (__bothSmallInteger(w, h)) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4822
	b_width = __intVal(w);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4823
	b_height = __intVal(h);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4824
	newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, NULL);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4825
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4826
	if (newBitmapHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4827
#ifdef COUNT_BMP_RESOURCES
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4828
	    __cnt_bitmap++;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4829
	   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
  4830
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4831
	  RETURN ( __MKOBJ(newBitmapHandle));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4832
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4833
	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4834
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4835
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4836
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4837
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4838
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4839
createPixmapWidth:w height:h depth:d
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4840
    "allocate a pixmap on the Xserver, the contents is undefined
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4841
     (i.e. random). Return a bitmap id or nil"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4842
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4843
%{  /* xxLIMITEDSTACK (WIN95 only) */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4844
    HANDLE newBitmapHandle;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4845
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4846
    /*printf("CreateBitmap Color\n");*/
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4847
    if (__bothSmallInteger(w, h) && __isSmallInteger(d) && ISCONNECTED) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4848
	if (__intVal(d) == 1) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4849
	    newBitmapHandle = CreateBitmap(__intVal(w), __intVal(h) , 1, 1, NULL);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4850
	} else {
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  4851
#if 0
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4852
	    if (__intVal(d) != __depth) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4853
		printf("invalid depth\n");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4854
		RETURN (nil);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4855
	    } 
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4856
#endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4857
	    newBitmapHandle = CreateCompatibleBitmap(__rootDC,__intVal(w), __intVal(h) );
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4858
	}
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4859
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4860
	if (newBitmapHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4861
#ifdef COUNT_BMP_RESOURCES
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4862
	    __cnt_bitmap++;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4863
	    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
  4864
#endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  4865
	    RETURN ( __MKOBJ(newBitmapHandle));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4866
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4867
	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4868
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4869
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4870
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4871
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4872
1467
9629ce710c53 added type argument to createWindowFor - prepare for native window support (windows)
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  4873
createWindowFor:aView type:typeSymbol
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4874
		 origin:origin
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4875
		 extent:extent
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4876
		 minExtent:minExt
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4877
		 maxExtent:maxExt
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4878
		 borderWidth:bWidth
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4879
		 subViewOf:wsuperView
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4880
		 style:wStyle
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4881
		 inputOnly:winputOnly
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4882
		 label:wlabel
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4883
		 owner:wowner
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4884
		 icon:wicon
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4885
		 iconMask:wiconMask
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4886
		 iconView:wiconView
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4887
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4888
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4889
    |xpos ypos wwidth wheight minWidth minHeight maxWidth maxHeight
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4890
     wsuperViewId wiconId wiconMaskId windowId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4891
     weventMask wiconHeight
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4892
     wiconWidth windowType windowClass moreArgs|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4893
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4894
    "/ bColorId wiconViewId bitGravity vBgColor vBgForm deepForm
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4895
    "/  preferredVisual preferredDepth  viewGravity wcursorId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4896
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4897
    displayId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4898
	self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4899
	^ nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4900
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4901
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4902
    origin notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4903
	xpos := origin x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4904
	ypos := origin y.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4905
    ] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4906
	xpos := ypos := 0.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4907
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4908
    extent notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4909
	wwidth := extent x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4910
	wheight := extent y.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4911
    ] ifFalse:[
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4912
	wwidth := 100.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4913
	wheight := 40.
1127
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
    minExt notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4916
	minWidth := minExt x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4917
	minHeight := minExt y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4918
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4919
    maxExt notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4920
	maxWidth := maxExt x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4921
	maxHeight := maxExt y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4922
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4923
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4924
    wsuperView notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4925
	wsuperViewId := wsuperView id
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4926
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4927
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4928
    wicon notNil ifTrue:[
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4929
	wiconId := wicon id.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4930
	wiconHeight := wicon height.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4931
	wiconWidth  := wicon width.
1418
d21112d621a1 prepared for iconMasks
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  4932
	wiconMask notNil ifTrue:[
d21112d621a1 prepared for iconMasks
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  4933
	    wiconMaskId := wiconMask id
d21112d621a1 prepared for iconMasks
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  4934
	]
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4935
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4936
"/    wiconView notNil ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4937
"/        wiconViewId := wiconView id
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4938
"/    ].
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4939
    weventMask := aView eventMask.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4940
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4941
    NativeWindows ifTrue:[
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4942
	windowType := aView nativeWindowType.
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4943
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4944
	"/ if it is already a string, take it as it is;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4945
	"/ otherwise, it must be a symbol and is used
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4946
	"/ as a key into the nativeClass translation map.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4947
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4948
	windowType isString ifTrue:[
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4949
	    windowClass := windowType
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4950
	] ifFalse:[
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4951
	    windowClass := NativeWindowClassTable at:windowType ifAbsent:nil
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4952
	]
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4953
    ].
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4954
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4955
    moreArgs := Array new:20.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4956
    moreArgs at:1 put:xpos.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4957
    moreArgs at:2 put:ypos.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4958
    moreArgs at:3 put:wwidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4959
    moreArgs at:4 put:wheight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4960
    moreArgs at:5 put:minWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4961
    moreArgs at:6 put:minHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4962
    moreArgs at:7 put:maxWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4963
    moreArgs at:8 put:maxHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4964
    moreArgs at:9 put:wsuperViewId.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4965
    moreArgs at:10 put:nil. "/ wcursorId.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4966
    moreArgs at:11 put:wiconId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4967
    moreArgs at:12 put:wiconMaskId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4968
    moreArgs at:13 put:wiconWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4969
    moreArgs at:14 put:wiconHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4970
    moreArgs at:15 put:windowType.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4971
    moreArgs at:16 put:windowClass.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4972
    moreArgs at:17 put:weventMask.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4973
    moreArgs at:18 put:(aView className asString).
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4974
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4975
    [
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4976
      windowId := self
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4977
		  primCreateWindowFor:aView
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4978
		  type:typeSymbol
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4979
		  borderWidth:bWidth
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4980
		  subViewOf:wsuperView
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4981
		  style:wStyle
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4982
		  inputOnly:winputOnly
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4983
		  label:wlabel
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4984
		  owner:wowner
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4985
		  icon:wicon
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4986
		  iconMask:wiconMask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4987
		  moreArgs:moreArgs.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4988
      aView setId:windowId.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4989
    ] valueUninterruptably.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4990
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4991
    windowId notNil ifTrue:[self addKnownView:aView withId:windowId].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4992
    ^ windowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4993
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4994
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4995
destroyGC:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4996
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4997
    if (__isExternalAddress(aGCId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4998
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4999
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5000
	if (gcData == NULL) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5001
	    fprintf(stderr, "oops - destroying GC twice\n");
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5002
	    RETURN(self);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5003
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5004
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5005
#ifdef COUNT_RESOURCES
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5006
	 __cnt_gcData--;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5007
	RESPRINTF(("DestroyGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5008
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5009
#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
  5010
	if (gcData->hBitmap) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5011
	    __cnt_bmpdc--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5012
	    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
  5013
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5014
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5015
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5016
#ifdef CACHE_LAST_DC
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5017
	if (lastGcData == gcData) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5018
	    _releaseDC(lastGcData);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5019
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5020
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5021
	__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
  5022
	free(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5023
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5024
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5025
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5026
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5027
destroyPixmap:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5028
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5029
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5030
    if (__isExternalAddress(aDrawableId) && ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5031
	HANDLE bitmapHandle = _HANDLEVal(aDrawableId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5032
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5033
	if (bitmapHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5034
#ifdef COUNT_BMP_RESOURCES
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5035
	    __cnt_bitmap--;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5036
	    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
  5037
#endif
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  5038
	    if( _DeleteObject(bitmapHandle, __LINE__) ) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5039
		DPRINTF(("Bitmap deleted!\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5040
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5041
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5042
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5043
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5044
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5045
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5046
destroyView:aView withId:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5047
    self primDestroyView:aView withId:aWindowId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5048
    self removeKnownView:aView withId:aWindowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5049
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5050
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5051
gcFor:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5052
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5053
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5054
    HWND hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5055
    struct gcData *gcData;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5056
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5057
    if (__isExternalAddress(aDrawableId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5058
	hWnd = _HWNDVal(aDrawableId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5059
	gcData = newGcData();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5060
	if (! gcData) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5061
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5062
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5063
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5064
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5065
	__cnt_gcData++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5066
	RESPRINTF(("CreateGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5067
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5068
	gcData->hWnd = hWnd;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5069
	gcData->_hDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5070
	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
  5071
	RETURN ( __MKOBJ(gcData) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5072
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5073
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5074
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5075
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5076
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5077
gcForBitmap:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5078
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5079
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5080
    struct gcData *gcData;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5081
    BITMAP bitmap;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5082
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5083
    if (__isExternalAddress(aDrawableId)) {  /* HBITMAP */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5084
	HBITMAP hBitmap = _HBITMAPVAL(aDrawableId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5085
	HDC hDC;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5086
	gcData = newGcData();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5087
	if (! gcData) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5088
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5089
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  5090
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5091
#ifdef COUNT_BMP_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5092
	__cnt_bmpdc++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5093
	RES_BMP_PRINTF(("CreateBmpDC %d\n",__cnt_bmpdc));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5094
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5095
	if (GetObject(hBitmap,sizeof(bitmap),&bitmap)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5096
	    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
  5097
	} else {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5098
	    DPRINTF(("noinfo returned\n"));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5099
	}
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5100
	gcData->hBitmap = hBitmap;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5101
	gcData->bitmapColorBitCount = bitmap.bmBitsPixel;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5102
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5103
	__cnt_gcData++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5104
	RESPRINTF(("CreateGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5105
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5106
	RETURN ( __MKOBJ(gcData) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5107
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5108
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5109
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5110
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5111
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5112
primCreateBitmapFromArray:anArray width:w height:h
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5113
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5114
%{  /* xxLIMITEDSTACK */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5115
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5116
    HBITMAP newBitmapHandle;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5117
    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
  5118
    int row, col;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5119
    unsigned char *cp, *bPits;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5120
    unsigned char *b_bits = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5121
    int index;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5122
    OBJ num;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5123
    unsigned char *allocatedBits = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5124
    unsigned char fastBits[10000];
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5125
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5126
    if (__bothSmallInteger(w, h)
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5127
     && _isNonNilObject(anArray)) {
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5128
	OBJ cls = __qClass(anArray);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5129
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5130
	b_width = __intVal(w);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5131
	b_height = __intVal(h);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5132
	bytesPerRowST = (b_width + 7) / 8;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5133
	bytesPerRowWN = ((b_width + 15) / 16) * 2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5134
	padding = bytesPerRowWN - bytesPerRowST;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5135
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5136
	if ((padding == 0) && (cls == @global(ByteArray))) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5137
	    b_bits = __ByteArrayInstPtr(anArray)->ba_element;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5138
	    cp = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5139
	} else {
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5140
	    int nBytes = b_height * bytesPerRowWN;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5141
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5142
	    if (nBytes < sizeof(fastBits)) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5143
		cp = b_bits = fastBits;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5144
	    } else {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5145
		cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5146
		if (! cp) goto fail;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5147
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5148
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5149
	if (cp) {
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5150
	    if (cls == @global(Array)) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5151
		OBJ *op;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5152
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5153
		index = 1;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5154
		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
  5155
		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
  5156
		    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
  5157
			num = *op++;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5158
			if (! __isSmallInteger(num))
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5159
			    goto fail;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5160
			*cp++ = __intVal(num);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5161
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5162
		    cp += padding;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5163
		}
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5164
	    } else if (cls == @global(ByteArray)) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5165
		unsigned char *pBits;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5166
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5167
		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
  5168
		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
  5169
		    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
  5170
			*cp++ = ( *pBits++ /*^ 0xFF*/ );
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5171
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5172
		    cp += padding;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5173
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5174
	    } else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5175
		goto fail;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5176
	    }
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5177
	}
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5178
	DPRINTF(("create bitmap ...\n"));
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5179
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5180
	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
  5181
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5182
	if( newBitmapHandle ) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5183
#ifdef COUNT_BMP_RESOURCES
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5184
	    __cnt_bitmap++;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5185
	    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
  5186
#endif
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5187
	    DPRINTF(("returning bitmap ...\n"));
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5188
	    if (allocatedBits) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5189
		free(allocatedBits);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5190
	    }
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  5191
	    RETURN ( __MKOBJ(newBitmapHandle));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5192
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5193
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5194
fail: ;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5195
    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
  5196
    if (allocatedBits) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5197
	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
  5198
	free(allocatedBits);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5199
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5200
    DPRINTF(("returning nil ...\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5201
    RETURN ( nil );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5202
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5203
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5204
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5205
primCreateWindowFor:aView type:aSymbol
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5206
	  borderWidth:bWidth subViewOf:wsuperView
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5207
	  style:wStyle inputOnly:winputOnly
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5208
	  label:wlabel owner:wowner
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5209
	  icon:wicon iconMask:wiconMask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5210
	  moreArgs:moreArgs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5211
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5212
%{  /* xxLIMITEDSTACK */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5213
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5214
    WNDCLASS wc;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5215
    long bg, bd, bw;
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  5216
    int winStyleBits, winEXStyleBits;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5217
    int w, h, x, y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5218
    int min_width, min_height;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5219
    int max_width, max_height;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5220
    OBJ eventMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5221
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5222
    HANDLE parentHandle;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5223
    OBJ xpos, ypos, wwidth, wheight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5224
    OBJ minWidth, minHeight, maxWidth, maxHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5225
    OBJ wsuperViewId, wcursorId, wiconId, wiconMaskId;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5226
    OBJ wiconWidth, wiconHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5227
    OBJ windowType, windowClass, windowId;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5228
    OBJ stClassName;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5229
    int isTopWindow = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5230
    localWindowInfo *lI;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5231
    createWindowInfo cwi;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5232
    unsigned char* cp;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5233
    HBITMAP        xBitMap, maskBitmap;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5234
    HICON          xIcon = (HICON)0;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5235
    ICONINFO       iconInfo;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5236
    char *className;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5237
    unsigned char fastBits[10000];
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5238
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5239
    xpos = __ArrayInstPtr(moreArgs)->a_element[0];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5240
    ypos = __ArrayInstPtr(moreArgs)->a_element[1];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5241
    wwidth = __ArrayInstPtr(moreArgs)->a_element[2];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5242
    wheight = __ArrayInstPtr(moreArgs)->a_element[3];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5243
    minWidth = __ArrayInstPtr(moreArgs)->a_element[4];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5244
    minHeight = __ArrayInstPtr(moreArgs)->a_element[5];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5245
    maxWidth = __ArrayInstPtr(moreArgs)->a_element[6];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5246
    maxHeight = __ArrayInstPtr(moreArgs)->a_element[7];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5247
    wsuperViewId = __ArrayInstPtr(moreArgs)->a_element[8];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5248
    wcursorId = __ArrayInstPtr(moreArgs)->a_element[9];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5249
    wiconId = __ArrayInstPtr(moreArgs)->a_element[10];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5250
    wiconMaskId = __ArrayInstPtr(moreArgs)->a_element[11];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5251
    wiconWidth = __ArrayInstPtr(moreArgs)->a_element[12];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5252
    wiconHeight = __ArrayInstPtr(moreArgs)->a_element[13];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5253
    windowType = __ArrayInstPtr(moreArgs)->a_element[14];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5254
    windowClass = __ArrayInstPtr(moreArgs)->a_element[15];
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5255
    eventMask = __ArrayInstPtr(moreArgs)->a_element[16];
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5256
    stClassName = __ArrayInstPtr(moreArgs)->a_element[17];
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5257
    bg = WhitePixel;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5258
    bd = BlackPixel;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5259
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5260
    /* get bitmap for icon */
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5261
    if ( __isExternalAddress(wiconId) ) {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5262
	xBitMap = _HBITMAPVAL( wiconId );
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5263
	if ( xBitMap != 0 ) {
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5264
	    BITMAP bm;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5265
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5266
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5267
		int d = bm.bmPlanes * bm.bmBitsPixel;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5268
		BYTE *ep;
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5269
		int height, width;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5270
		int nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5271
		unsigned char *allocatedBits = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5272
		int privateMask = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5273
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5274
		if ( __isExternalAddress(wiconMaskId) ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5275
		    maskBitmap = _HBITMAPVAL( wiconMaskId );
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5276
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5277
		    if (wiconMaskId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5278
			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
  5279
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5280
		    maskBitmap = 0;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5281
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5282
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5283
		/*
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5284
		 * if there is no mask, generate one
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5285
		 */
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5286
		if (maskBitmap == 0) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5287
		    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
  5288
		    height = __intVal( wiconHeight );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5289
		    width  = __intVal( wiconWidth  );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5290
		    nBytes = ( width + 15 ) / 8;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5291
		    nBytes = height * nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5292
		    if (nBytes < sizeof(fastBits)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5293
			ep = fastBits;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5294
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5295
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5296
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5297
		    if ( ep == 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5298
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5299
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5300
			memset(ep, 0, nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5301
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5302
			if ( maskBitmap == NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5303
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5304
			} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5305
			    privateMask = 1;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5306
			}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5307
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5308
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5309
		if ( maskBitmap != NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5310
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5311
		    iconInfo.fIcon = TRUE;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5312
		    iconInfo.hbmMask  = maskBitmap;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5313
		    iconInfo.hbmColor = xBitMap;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5314
		    xIcon = CreateIconIndirect( &iconInfo );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5315
		    if (privateMask) {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  5316
			_DeleteObject( maskBitmap, __LINE__ );
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5317
		    }
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5318
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5319
		    PRINTF(( "WinWorkstat [warning]: no mask for icon !\n" ));
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5320
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5321
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5322
		if (allocatedBits) {
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5323
		    free(allocatedBits);
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5324
		}
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5325
	    }
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5326
	} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5327
	    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
  5328
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5329
    } else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5330
	if (wiconId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  5331
	    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
  5332
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5333
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5334
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5335
    if (__bothSmallInteger(wwidth, wheight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5336
	w = __intVal(wwidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5337
	h = __intVal(wheight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5338
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5339
	w = h = 100;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5340
    }
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
    if (__bothSmallInteger(xpos, ypos)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5343
	x = __intVal(xpos);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5344
	y = __intVal(ypos);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5345
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5346
	x = y = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5347
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5348
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5349
    if (__bothSmallInteger(minWidth, minHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5350
	min_width = __intVal(minWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5351
	min_height = __intVal(minHeight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5352
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5353
	min_width = min_height = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5354
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5355
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5356
    if (__bothSmallInteger(maxWidth, maxHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5357
	max_width = __intVal(maxWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5358
	max_height = __intVal(maxHeight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5359
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5360
	max_width = max_height = 10000;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5361
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5362
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  5363
    winStyleBits = winEXStyleBits = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5364
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5365
    if (__isSmallInteger(bWidth)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5366
	bw = __intVal(bWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5367
	if (bw) {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5368
	    winStyleBits |= WS_BORDER;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5369
	    bw = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5370
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5371
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5372
	bw = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5373
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5374
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5375
    className = app_name;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5376
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5377
#ifdef LATER
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5378
    if (__isString(windowClass)) {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5379
	className = __stringVal(windowClass);
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5380
    }
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5381
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5382
    if (__isString(windowClass)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5383
	if (__isInteger(wStyle)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5384
	    winStyleBits |= __longIntVal(wStyle);
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5385
	} else {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5386
	    if (windowType == @symbol(RadioButton)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5387
		winStyleBits |= BS_RADIOBUTTON;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5388
	    } else if (windowType == @symbol(CheckBox)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5389
		winStyleBits |= BS_CHECKBOX;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5390
	    } else if (windowType == @symbol(HorizontalScrollbar)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5391
		winStyleBits |= SBS_HORZ;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5392
	    } else if (windowType == @symbol(VerticalScrollBar)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5393
		winStyleBits |= SBS_VERT;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5394
	    }
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5395
	}
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5396
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5397
#endif /* LATER */
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5398
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5399
    if (__isExternalAddress(wsuperViewId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5400
	/*
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5401
	 * a child window
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5402
	 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5403
	parentHandle = _HANDLEVal(wsuperViewId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5404
	winStyleBits |= WS_CHILD;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5405
	if (winputOnly != true) {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5406
	    winStyleBits |= (WS_CLIPSIBLINGS|WS_CLIPCHILDREN);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5407
	    /*winStyleBits |= WS_CLIPCHILDREN;*/
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5408
	    DPRINTF(("parent handle=%x\n", parentHandle));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5409
	} else {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5410
	    winEXStyleBits |= WS_EX_TRANSPARENT;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5411
	    DPRINTF(("inputview parent handle=%x\n", parentHandle));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5412
	}
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5413
    } else {
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  5414
	/*
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  5415
	 * a top window (regular / popUp or dialog)
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  5416
	 */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5417
	char buf[300];
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5418
	char *stName;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5419
	static winCount;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5420
#   ifdef __BORLANDC__
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5421
	struct timeb timebuffer;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5422
	ftime(&timebuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5423
#   else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5424
	struct _timeb timebuffer;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5425
	_ftime(&timebuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5426
#   endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5427
	if (__isString(stClassName)) {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5428
	    stName = __stringVal(stClassName);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5429
	} else {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5430
	    stName = app_name;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5431
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5432
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5433
	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
  5434
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5435
	parentHandle = NULL;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5436
	isTopWindow = 1;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5437
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  5438
#ifdef TOPWINDOWCLASS
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5439
	DPRINTF(("topview - registerClass:%s\n",buf));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5440
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5441
	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
  5442
	wc.lpfnWndProc = (WNDPROC) MainWndProc;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5443
	wc.cbClsExtra = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5444
	wc.cbWndExtra = N_WINDOW_PRIVATE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5445
	wc.hInstance = (HANDLE) __getHInstance();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5446
	if (xIcon) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5447
	    wc.hIcon   = xIcon;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5448
	    /* 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
  5449
	} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5450
	    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
  5451
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5452
	wc.hCursor = 0 /* LoadCursor(NULL, IDC_ARROW) */;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5453
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5454
	wc.hbrBackground = 0; /*CreateSolidBrush (bg);*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5455
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5456
	wc.lpszMenuName =  NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5457
	wc.lpszClassName = buf;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5458
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5459
	if (!RegisterClass(&wc)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5460
	    PRINTF(("RegisterClass failed\n"));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5461
	    RETURN( nil );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5462
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5463
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5464
	className = buf;
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  5465
#endif
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5466
	if (wStyle == @symbol(popUp)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5467
	    winStyleBits |= WS_POPUP;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5468
	    winStyleBits |= WS_DISABLED;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5469
	    winEXStyleBits |= WS_EX_TOOLWINDOW;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5470
	    CPRINTF(("Create popUpWindow\n"));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5471
#if 0
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5472
	    parentHandle = GetActiveWindow();
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5473
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5474
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5475
	} else if (wStyle == @symbol(dialog)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5476
/*
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5477
	    winStyleBits |= WS_OVERLAPPED | WS_CAPTION | WS_THICKFRAME;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5478
*/
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5479
	    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
  5480
	    winStyleBits |= WS_POPUP;
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  5481
	    winStyleBits |= DS_NOIDLEMSG;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  5482
	    //winEXStyleBits |= WS_EX_TOOLWINDOW;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5483
	    if ((min_width || min_height)
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5484
	     && (min_width == max_width)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5485
	     && (min_height == max_height)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5486
		winStyleBits &= ~WS_THICKFRAME;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5487
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5488
	} else {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  5489
	    //winStyleBits |= WS_OVERLAPPEDWINDOW;
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  5490
	    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
  5491
	    //winEXStyleBits |= WS_EX_CLIENTEDGE;
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  5492
	    winEXStyleBits |= WS_EX_WINDOWEDGE;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  5493
	    //winEXStyleBits |= WS_EX_ACCEPTFILES;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5494
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5495
	winStyleBits |= WS_CLIPCHILDREN;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5496
    }
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5497
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5498
    rec.left = x;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5499
    rec.top = y;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5500
    rec.right = x + w;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5501
    rec.bottom = y+ h;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5502
    cwi.winStyleBitsEx = WS_EX_LEFT | WS_EX_NOPARENTNOTIFY | winEXStyleBits;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5503
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5504
#ifdef ADJUSTWINDOW
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5505
    AdjustWindowRectEx(&rec, winStyleBits, 0, cwi.winStyleBitsEx);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5506
    w = rec.right - rec.left;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5507
    h = rec.bottom - rec.top;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5508
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5509
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5510
    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
  5511
		((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
  5512
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5513
    /* allocate localMemory for Window */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5514
    lI = (localWindowInfo *) malloc(sizeof(localWindowInfo));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5515
    if (! lI) {
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5516
	fprintf(stderr, "WinWorkstation: malloc failed in CreateWindow\n");
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5517
	RETURN ( nil );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5518
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5519
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5520
    memset(lI, 0, sizeof(*lI));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5521
    if (isTopWindow) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5522
	if (rec.left < 0) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5523
	    rec.left = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5524
	    rec.right = w;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5525
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5526
	if (rec.top < 0) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5527
	    rec.top = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5528
	    rec.bottom = h;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5529
	}
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5530
	lI->flag = LI_TOPWIN;
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  5531
    } else {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5532
	if (bw) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5533
	    // adjust for border
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5534
	    rec.left++;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5535
	    rec.top++;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5536
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5537
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5538
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5539
    if (winputOnly == true)
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5540
	lI->flag |= LI_INPUTWIN;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5541
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5542
    cwi.className = className;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5543
    cwi.winStyleBits = winStyleBits;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5544
    cwi.parentHandle = parentHandle;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5545
    cwi.x = rec.left;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5546
    cwi.y = rec.top;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5547
    cwi.dx = rec.right - rec.left;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5548
    cwi.dy = rec.bottom - rec.top;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5549
    rec.left = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5550
    rec.top = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5551
    rec.right = min_width;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5552
    rec.bottom = min_height;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5553
#ifdef ADJUSTWINDOW
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5554
    AdjustWindowRectEx(&rec, winStyleBits, 0, cwi.winStyleBitsEx);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5555
#endif
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5556
    lI->minWidth = rec.right - rec.left;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5557
    lI->minHeight = rec.bottom - rec.top;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5558
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5559
    rec.left = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5560
    rec.top = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5561
    rec.right = max_width;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5562
    rec.bottom = max_height;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5563
#ifdef ADJUSTWINDOW
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5564
    AdjustWindowRectEx(&rec,winStyleBits, 0, cwi.winStyleBitsEx);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5565
#endif
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5566
    lI->maxWidth = rec.right - rec.left;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5567
    lI->maxHeight = rec.bottom - rec.top;
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  5568
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  5569
    lI->viewBgBrush = __whiteBrush;
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  5570
    lI->viewBgColor = WhitePixel;
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  5571
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5572
    if (__isSmallInteger(eventMask))
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5573
	lI->eventMask = __intVal(eventMask);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5574
    else
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5575
	lI->eventMask = 0xffffffff;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5576
    DPRINTF(("eventMask is %x\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5577
#ifdef DEBUGMASK1
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5578
    printMask(lI->eventMask);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5579
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5580
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5581
    lI->bw = bw;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5582
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5583
    cwi.newWinHandle = NULL;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5584
    cwi.windowName = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5585
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5586
    if (isTopWindow) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5587
	if (__isString(wlabel) || __isSymbol(wlabel)) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5588
	    cwi.windowName = (char *) __stringVal(wlabel);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5589
	    DPRINTF(("title = %s\n", cwi.windowName));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5590
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5591
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5592
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5593
    cwi.xxx = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5594
    cwi.localWindowInfo = lI;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5595
#ifndef NEW_CREATE_EVENT /* does not work - why ? */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5596
    cwi.hCreateEvent = hCreateEvent;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5597
    ResetEvent(cwi.hCreateEvent);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5598
#else
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5599
    cwi.hCreateEvent = CreateEvent(
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5600
	NULL,        /* no security attributes */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5601
	FALSE,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5602
	FALSE,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5603
	NULL);       /* name of mutex */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5604
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5605
    if (cwi.hCreateEvent == NULL) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5606
	fprintf(stderr, "WinWorkstation [error]: oops CreateEvent failed in CreateWindow: %d\n", GetLastError() );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5607
	RETURN ( nil );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5608
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5609
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5610
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5611
    if (PostThreadMessage(_dispatchThreadId, WM_THREADCREATEWINDOW, 0, (INT)(&cwi)) == FALSE) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5612
	fprintf(stderr, "WinWorkstation [error]: oops PostThreadMessage failed in CreateWindow: %d\n", GetLastError() );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5613
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5614
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5615
    if (cwi.newWinHandle != NULL) {
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  5616
	cwi.hCreateEvent = NULL;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5617
	/* wow - that was quick ... */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5618
    } else {
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5619
	{
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5620
	    DWORD dwWaitResult;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5621
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5622
	    /* Request ownership of mutex. */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5623
	    dwWaitResult = WaitForSingleObject(
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5624
				hCreateEvent,   /* handle of mutex */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5625
				1000L);         /* time-out interval */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5626
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5627
	    if (cwi.xxx == 0) {
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  5628
		fprintf(stderr, "WinWorkstation [error]: message did not get posted - try again\n");
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5629
		if (PostThreadMessage(_dispatchThreadId, WM_THREADCREATEWINDOW, 0, (INT)(&cwi)) == FALSE) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5630
		    fprintf(stderr, "WinWorkstation [error]: oops PostThreadMessage failed in CreateWindow: %d\n", GetLastError() );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5631
		} else {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5632
		    dwWaitResult = WaitForSingleObject(
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5633
					hCreateEvent,   /* handle of mutex */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5634
					1000L);         /* time-out interval */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5635
		}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5636
	    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5637
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5638
	    switch (dwWaitResult) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5639
		// The thread got mutex ownership.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5640
		case WAIT_OBJECT_0:
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5641
		    break;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5642
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5643
		// Cannot get mutex ownership due to time-out.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5644
		case WAIT_TIMEOUT:
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5645
		    fprintf(stderr, "WinWorkstation [error]: oops timeout in CreateWindow\n");
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5646
		    break;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5647
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5648
		// Got ownership of the abandoned mutex object.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5649
		default:
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5650
		    fprintf(stderr, "WinWorkstation [warning]: CreateEvent abandoned\n");
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5651
		    break;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5652
	    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5653
	    if ((cwi.newWinHandle == NULL)
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5654
	     && (dwWaitResult != WAIT_OBJECT_0)) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5655
		dwWaitResult = WaitForSingleObject(
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5656
				    hCreateEvent,   /* handle of mutex */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5657
				    1000L);         /* time-out interval */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5658
		if (dwWaitResult != WAIT_OBJECT_0) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5659
		    fprintf(stderr, "WinWorkstation [error]: oops timeout again in CreateWindow\n");
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5660
		}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5661
	    }
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  5662
	    cwi.hCreateEvent = NULL;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5663
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5664
	    if (cwi.xxx == 0) {
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  5665
		fprintf(stderr, "WinWorkstation [error]: message did not get posted (again)\n");
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5666
	    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5667
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5668
#ifdef NEW_CREATE_EVENT
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5669
	    CloseHandle(cwi.hCreateEvent);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5670
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5671
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5672
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5673
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5674
    DPRINTF(("handle = %x\n", cwi.newWinHandle));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5675
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5676
    if (! cwi.newWinHandle) {
2491
be54b494a252 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2464
diff changeset
  5677
	fprintf(stderr, "WinWorkstation [error]: CreateWindow failed\n");
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5678
	RETURN ( nil );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5679
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5680
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5681
    windowId = __MKOBJ(cwi.newWinHandle);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5682
    SetWindowPos(cwi.newWinHandle, HWND_TOP, 0, 0, 0, 0, 
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5683
		 SWP_NOSENDCHANGING |
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5684
		 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5685
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  5686
#ifndef TOPWINDOWCLASS
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5687
    if (xIcon) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5688
	SendMessage(cwi.newWinHandle, WM_SETICON, ICON_SMALL, (LPARAM)xIcon);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5689
	SendMessage(cwi.newWinHandle, WM_SETICON, ICON_BIG, (LPARAM)xIcon);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5690
    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  5691
#endif      
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  5692
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5693
    DPRINTF(("done - create\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5694
    RETURN (windowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5695
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5696
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5697
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5698
primDestroyView:aView withId:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5699
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5700
%{  /* xxLIMITEDSTACK (WIN95 only) */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5701
    HICON oldIcon;
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5702
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5703
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5704
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5705
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5706
	if (win && IsWindow(win)) {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  5707
#ifndef TOPWINDOWCLASS
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5708
	   oldIcon = (HICON) GetClassLong(win, GCL_HICON);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5709
	   SetClassLong(win, GCL_HICON, (DWORD)0);
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5710
	   /* It has to be checked whether this can be deleted!!!!! */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5711
	   if ( oldIcon ) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5712
		if ( DestroyIcon( oldIcon )) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5713
		    DPRINTF(( "Old icon deleted\n" ));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5714
		} else {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5715
		    fprintf(stderr, "failed to destroy icon\n");
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5716
		}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5717
	   }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  5718
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5719
	   /*printf("post WM_THREADDESTROYWINDOW\n");*/
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5720
	   PostMessage(win, WM_THREADDESTROYWINDOW, 0, 0);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5721
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5722
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5723
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5724
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5725
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5726
rootWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5727
    "return the id of the root window.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5728
     This is the window you see as background,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5729
     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
  5730
     since some window managers install a virtual root window on top
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5731
     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
  5732
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5733
    ^ rootWin
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5734
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5735
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5736
!WinWorkstation methodsFor:'color stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5737
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5738
colorRed:redVal green:greenVal blue:blueVal
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5739
    "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
  5740
     This method is obsoleted by #colorScaledRed:scaledGreen:scaledBlue:"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5741
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5742
    |r g b|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5743
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5744
    r := self percentToDeviceColorValue:redVal.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5745
    g := self percentToDeviceColorValue:greenVal.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5746
    b := self percentToDeviceColorValue:blueVal.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5747
    ^ self colorScaledRed:r scaledGreen:g scaledBlue:b
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5748
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5749
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5750
colorScaledRed:r scaledGreen:g scaledBlue:b
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5751
    "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
  5752
     (i.e. colorID)"
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5753
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5754
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5755
    int id, ir, ig, ib;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5756
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5757
    if (__bothSmallInteger(r, g) && __isSmallInteger(b)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5758
	id = RGB2st(__intVal(r),__intVal(g),__intVal(b));
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5759
	DDPRINTF(("alloc color %d/%d/%d -> %x\n", ir, ig, ib, id));
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  5760
	RETURN ( __MKSMALLINT(id) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5761
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5762
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5763
    self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5764
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5765
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5766
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5767
freeColor:colorIndex
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5768
    "free a display color when its no longer needed"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5769
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5770
    'free color' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5771
    ^ self
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5772
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5773
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5774
getRGBFrom:index into:aBlock
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5775
    "get rgb components (0..100) of color in map at:index,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5776
     and evaluate the 3-arg block, aBlock with them"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5777
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5778
    |val|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5779
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5780
    self getScaledRGBFrom:index into:[:r :g :b |
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5781
	val := aBlock
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5782
		value:(r * 100.0 / 16rFFFF)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5783
		value:(g * 100.0 / 16rFFFF)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5784
		value:(b * 100.0 / 16rFFFF)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5785
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5786
    'get RGB' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5787
    ^ val
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5788
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5789
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5790
getRGBFromName:colorName into:aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5791
    "get rgb components (0..100) of color named colorName,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5792
     and evaluate the 3-arg block, aBlock with them"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5793
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5794
    |val|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5795
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5796
    self getScaledRGBFromName:colorName into:[:r :g :b |
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5797
	r isNil ifTrue:[^nil].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5798
	val := aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5799
		value:(r * 100.0 / 16rFFFF)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5800
		value:(g * 100.0 / 16rFFFF)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5801
		value:(b * 100.0 / 16rFFFF)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5802
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5803
    ^val
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5804
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5805
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5806
getScaledRGBFrom:index into:aBlock
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5807
    "get rgb components (0 .. 16rFFFF) of color in map at:index,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5808
     and evaluate the 3-arg block, aBlock with them"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5809
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5810
    |r g b|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5811
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5812
    int id = __intVal(index);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5813
    int iR, iG, iB;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5814
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5815
    id = st2RGB(id,0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5816
    iR = id & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5817
    iG = (id >> 8) & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5818
    iB = (id >> 16) & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5819
    iR = (iR << 8) | iR;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5820
    iG = (iG << 8) | iG;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5821
    iB = (iB << 8) | iB;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5822
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5823
    r = __MKSMALLINT(iR);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5824
    g = __MKSMALLINT(iG);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5825
    b = __MKSMALLINT(iB);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5826
    /*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
  5827
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5828
    ^ aBlock value:r value:g value:b
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5829
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5830
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5831
getScaledRGBFromName:colorName into:aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5832
    "get scaled rgb components (0..16rFFFF) of color named colorName,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5833
     and evaluate the 3-arg block, aBlock with them"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5834
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5835
    |triple r g b found|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5836
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5837
    r := g := b := 0.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5838
    found := false.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5839
    (colorName startsWith:$#) ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5840
	"/ color in r/g/b hex notation
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5841
	r := Integer readFrom:(colorName copyFrom:2 to:3) radix:16.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5842
	g := Integer readFrom:(colorName copyFrom:4 to:5) radix:16.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5843
	b := Integer readFrom:(colorName copyFrom:6 to:7) radix:16.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5844
	found := true.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5845
    ] ifFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5846
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5847
	triple := StandardColorValues at:colorName asString ifAbsent:nil.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5848
	triple isNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5849
	    triple := StandardColorValues at:colorName asString asLowercase ifAbsent:nil.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5850
	].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5851
	triple notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5852
	    r := triple at:1.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5853
	    g := triple at:2.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5854
	    b := triple at:3.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5855
	    found := true.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5856
	].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5857
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5858
    found ifFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5859
	('WinWorkstation: unknown color: ' , colorName) infoPrintCR.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5860
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5861
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5862
    ^ 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
  5863
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5864
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5865
listOfAvailableColors
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5866
    "return a list of all available colornames.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5867
     This should not be used, since colornames are very
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5868
     display-specific (here X-specific)."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5869
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5870
    |aStream list line index colorName|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5871
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5872
    aStream := FileStream readonlyFileNamed:'/usr/lib/X11/rgb.txt'.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5873
    aStream isNil ifTrue:[^ nil].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5874
    list := OrderedCollection new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5875
    [aStream atEnd] whileFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5876
	line := aStream nextLine.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5877
	line notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5878
	    "skip the r/g/b numbers"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5879
	    index := 1.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5880
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5881
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5882
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5883
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5884
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5885
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5886
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5887
	    colorName := line copyFrom:index.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5888
	    ((colorName occurrencesOf:(Character space)) == 0) ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5889
		list add:colorName
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5890
	    ]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5891
	]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5892
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5893
    aStream close.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5894
    ^ list sort
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5895
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5896
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5897
     Screen current listOfAvailableColors
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5898
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5899
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5900
    "Modified: 11.9.1996 / 15:26:28 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5901
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5902
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5903
percentToDeviceColorValue:aPercentage
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5904
    "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
  5905
     WIN-component value (0..16rFFFF) as an integer"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5906
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5907
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5908
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5909
    if (__isSmallInteger(aPercentage)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5910
	RETURN ( __MKSMALLINT(0xFFFF * __intVal(aPercentage) / 100) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5911
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5912
    if (__isFloat(aPercentage)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5913
	RETURN ( __MKSMALLINT(0xFFFF * (int)(__floatVal(aPercentage)) / 100) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5914
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5915
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5916
    ^ (16rFFFF * aPercentage / 100) rounded
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5917
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5918
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5919
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
  5920
    "change a palette index.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5921
     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
  5922
     - 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
  5923
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5924
     '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
  5925
     ^ self.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5926
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5927
    "Created: 30.1.1998 / 09:27:48 / md"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5928
    "Modified: 30.1.1998 / 09:30:22 / md"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5929
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5930
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5931
!WinWorkstation methodsFor:'cursor stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5932
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5933
builtInCursorShapes
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5934
    "return a collection of standard cursor names.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5935
     Those are built into Windows and need not be created as
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5936
     user cursors.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5937
     (actually, there are more than those below ...)"
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5938
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5939
    "/ if you add something here, also add to #shapeNumberFromCursor ...
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5940
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5941
    ^ #(
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5942
	#upLeftArrow            "/ IDC_ARROW
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5943
	#upDownArrow            "/ IDC_SIZENS
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5944
	#leftRightArrow         "/ IDC_SIZEWE
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5945
	#text                   "/ IDC_IBEAM
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5946
	#wait                   "/ IDC_WAIT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5947
	#execute                "/ IDC_APPSTARTING
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5948
	#crossHair              "/ IDC_CROSS
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5949
	#fourWay                "/ IDC_SIZEALL
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5950
	#upRightHand            "/ IDC_ARROW
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5951
	#noDrop                 "/ IDC_NO
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5952
       )
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5953
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5954
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5955
createCursorShape:aShape
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5956
    "create a cursor given a shape-symbol"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5957
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5958
    |number|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5959
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5960
    number := self shapeNumberFromSymbol:aShape.
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  5961
    number isNil ifTrue:[^ nil].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5962
    ^ self primCreateCursorShapeNr:number
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5963
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5964
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5965
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
  5966
    "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
  5967
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5968
    |padding bpl bplPadded srcOffs dstOffs
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5969
     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
  5970
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  5971
    cW := self getSystemMetrics:#cursorWidth.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  5972
    cH := self getSystemMetrics:#cursorHeight.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  5973
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5974
    "/ ('cursorWidth ',cW printString,'cursorHeight ',cH printString) infoPrintCR.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5975
    src := sourceBytes.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5976
    mask := maskBytes.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5977
    padding := self cursorBitmapPadding.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5978
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5979
    "/ repadding and/or resizing required ?
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5980
    bpl := sourceBytes size / h.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5981
    bplPadded := (cW + padding - 1) // padding * 2.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5982
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5983
    bpl ~~ bplPadded ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5984
	 "/     'repad cursor bits' infoPrintCR.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5985
	srcPadded := ByteArray new:(bplPadded * cH).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5986
	nB := bpl min: bplPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5987
	nR := cH min: h.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5988
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5989
	dstOffs := srcOffs := 1.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5990
	1 to:nR do:[:row |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5991
	    srcPadded
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5992
		replaceFrom:dstOffs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5993
		to:(dstOffs+nB-1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5994
		with:src
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5995
		startingAt:srcOffs.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5996
	    dstOffs := dstOffs + bplPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5997
	    srcOffs := srcOffs + bpl.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5998
	].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5999
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6000
	maskPadded := ByteArray new:(bplPadded * cH).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6001
	dstOffs := srcOffs := 1.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6002
	1 to:nR do:[:row |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6003
	    maskPadded
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6004
		replaceFrom:dstOffs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6005
		to:(dstOffs+nB-1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6006
		with:mask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6007
		startingAt:srcOffs.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6008
	    dstOffs := dstOffs + bplPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6009
	    srcOffs := srcOffs + bpl.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6010
	].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6011
	src := srcPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6012
	mask := maskPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6013
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6014
    ].
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6015
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6016
    src invert.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6017
    1 to:src size do:[:index |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6018
	src byteAt:index put:((src byteAt:index) bitAnd:(mask byteAt:index)).
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6019
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6020
    mask invert.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6021
    cursor := self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6022
	primCreateCursorSourceBits:src
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6023
	maskBits:mask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6024
	hotX:hx hotY:hy
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6025
	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
  6026
    cursor notNil ifTrue:[^ cursor ].
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6027
    'WinWorkstation [warning]: could not create bitmap cursor' infoPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6028
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6029
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6030
cursorBitmapPadding
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6031
    ^ 16 "/ windows requires short-padded rows
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6032
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6033
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6034
destroyCursor:aCursorId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6035
    "destroy a cursor"
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6036
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6037
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6038
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6039
    if (ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6040
	if (__isExternalAddress(aCursorId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6041
	    HCURSOR curs = _HCURSORVal(aCursorId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6042
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6043
	    if (curs) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6044
#ifdef KEEP_STD_CURSORS
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6045
		if ((curs != H_C_ARROW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6046
		 && (curs != H_C_CROSS)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6047
		 && (curs != H_C_IBEAM)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6048
		 && (curs != H_C_ICON)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6049
		 && (curs != H_C_NO)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6050
		 && (curs != H_C_SIZE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6051
		 && (curs != H_C_SIZEALL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6052
		 && (curs != H_C_SIZENESW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6053
		 && (curs != H_C_SIZENS)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6054
		 && (curs != H_C_SIZENWSE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6055
		 && (curs != H_C_UPARROW)
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6056
		 && (curs != H_C_APPSTARTING)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6057
		 && (curs != H_C_WAIT)) 
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6058
#endif /* KEEP_STD_CURSORS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6059
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6060
		    DestroyCursor(curs);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6061
#ifdef COUNT_RESOURCES
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6062
		    __cnt_cur--;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6063
		    RESPRINTF(("DestroyCursor %d\n",__cnt_cur));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6064
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6065
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6066
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6067
	    RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6068
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6069
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6070
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6071
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6072
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6073
needDeviceFormsForCursor
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6074
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6075
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6076
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6077
primCreateCursorShapeNr:number
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6078
    " create a standard (shape) cursor"
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6079
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6080
%{  
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6081
    HCURSOR newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6082
    LPCTSTR cId;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6083
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6084
    if (__isSmallInteger(number)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6085
	cId = (LPCTSTR)(__intVal(number));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6086
	newCursor = LoadCursor(NULL, cId);
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  6087
	if (newCursor) {
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  6088
#ifdef KEEP_STD_CURSORS
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6089
	    if (cId == IDC_ARROW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6090
		H_C_ARROW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6091
	    else if (cId == IDC_CROSS)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6092
		H_C_CROSS = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6093
	    else if (cId == IDC_IBEAM)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6094
		H_C_IBEAM = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6095
	    else if (cId == IDC_ICON)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6096
		H_C_ICON = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6097
	    else if (cId == IDC_NO)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6098
		H_C_NO = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6099
	    else if (cId == IDC_SIZE)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6100
		H_C_SIZE = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6101
	    else if (cId == IDC_SIZEALL)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6102
		H_C_SIZEALL = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6103
	    else if (cId == IDC_SIZENESW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6104
		H_C_SIZENESW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6105
	    else if (cId == IDC_SIZENS)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6106
		H_C_SIZENS = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6107
	    else if (cId == IDC_SIZENWSE)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6108
		H_C_SIZENWSE = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6109
	    else if (cId == IDC_UPARROW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6110
		H_C_UPARROW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6111
	    else if (cId == IDC_WAIT)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6112
		H_C_WAIT = newCursor;
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6113
	    else if (cId == IDC_APPSTARTING)
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6114
		H_C_APPSTARTING = newCursor;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6115
#endif /* KEEP_STD_CURSORS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6116
	    RETURN ( __MKOBJ(newCursor) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6117
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6118
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6119
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6120
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6121
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6122
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6123
primCreateCursorSourceBits:src maskBits:mask hotX:hx hotY:hy width:w height:h
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6124
    "create a cursor from given pixels"
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6125
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6126
%{  
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6127
    HCURSOR newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6128
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6129
    if (__isByteArray(src)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6130
     && __isByteArray(mask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6131
     && __bothSmallInteger(hx, hy)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6132
     && __bothSmallInteger(w, h)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6133
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6134
	newCursor = CreateCursor((HANDLE) __getHInstance(),
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6135
				 __intVal(hx), __intVal(hy),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6136
				 __intVal(w), __intVal(h),
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6137
				 __ByteArrayInstPtr(mask)->ba_element,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6138
				 __ByteArrayInstPtr(src)->ba_element);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6139
	if (newCursor) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6140
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6141
	    __cnt_cur++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6142
	    RESPRINTF(("CreateCursor %d\n",__cnt_cur));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6143
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6144
	    RETURN ( __MKOBJ(newCursor));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6145
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6146
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6147
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6148
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6149
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6150
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6151
shapeNumberFromSymbol:shape
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6152
    "given a shape-symbol, return the corresponding cursor-number,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6153
     or nil if no such standard cursor exists."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6154
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6155
    "this is pure Win-knowlegde - but you may easily add more"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6156
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6157
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6158
    if (shape == @symbol(upRightHand)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6159
	RETURN ( __MKSMALLINT( (INT)IDC_ARROW));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6160
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6161
    if (shape == @symbol(upLeftArrow)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6162
	RETURN ( __MKSMALLINT( (INT)IDC_ARROW));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6163
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6164
    if (shape == @symbol(upDownArrow)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6165
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENS));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6166
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6167
    if (shape == @symbol(leftRightArrow)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6168
	RETURN ( __MKSMALLINT( (INT)IDC_SIZEWE));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6169
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6170
    if (shape == @symbol(text)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6171
	RETURN ( __MKSMALLINT( (INT)IDC_IBEAM));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6172
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6173
    if (shape == @symbol(wait)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6174
	RETURN ( __MKSMALLINT( (INT)IDC_WAIT));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6175
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6176
    if (shape == @symbol(crossHair)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6177
	RETURN ( __MKSMALLINT( (INT)IDC_CROSS));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6178
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6179
    if (shape == @symbol(fourWay)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6180
	RETURN ( __MKSMALLINT( (INT)IDC_SIZEALL));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6181
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6182
    if (shape == @symbol(execute)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6183
	RETURN ( __MKSMALLINT( (INT)IDC_APPSTARTING));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6184
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6185
    if (shape == @symbol(noDrop)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6186
	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
  6187
    }
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6188
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6189
    if (shape == @symbol(IDC_UPARROW)) {
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6190
	RETURN ( __MKSMALLINT( (INT)IDC_UPARROW));
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6191
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6192
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6193
    if (shape == @symbol(IDC_SIZE)) {
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6194
	RETURN ( __MKSMALLINT( (INT)IDC_SIZE));
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6195
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6196
    if (shape == @symbol(IDC_SIZENWSE)) {
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6197
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENWSE));
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6198
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6199
    if (shape == @symbol(IDC_SIZENESW)) {
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6200
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENESW));
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6201
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6202
    if (shape == @symbol(IDC_NO)) {
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6203
	RETURN ( __MKSMALLINT( (INT)IDC_NO));
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6204
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6205
#ifdef IDC_HELP
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6206
    if (shape == @symbol(IDC_HELP)) {
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6207
	RETURN ( __MKSMALLINT( (INT)IDC_HELP));
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6208
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6209
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6210
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6211
"/    ('WINWORKSTATION: invalid cursorShape:' , shape printString) infoPrintNL.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6212
    ^  nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6213
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6214
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6215
!WinWorkstation methodsFor:'drawing'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6216
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6217
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
  6218
		width:w height:h
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6219
    "do a bit-blt; copy bits from the rectangle defined by
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6220
     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
  6221
     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
  6222
     argument is not integer."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6223
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6224
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6225
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  6226
    struct gcData *dstGcData = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6227
    struct gcData *srcGcData = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6228
    HDC srcDC = (HDC)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6229
    HDC dstDC = (HDC)0;
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6230
    int dstGcOwnerThreadID;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6231
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6232
    if (__isExternalAddress(srcGCId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6233
	srcGcData = _GCDATA(srcGCId);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6234
    } else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6235
	goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6236
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6237
    if (__isExternalAddress(dstGCId)) {
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  6238
	dstGcData = _GCDATA(dstGCId);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6239
    } else {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  6240
	goto fail;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  6241
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  6242
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  6243
    if (__bothSmallInteger(w, h)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6244
     && __bothSmallInteger(srcX, srcY)
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6245
     && __bothSmallInteger(dstX, dstY)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6246
	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
  6247
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6248
	if (srcGcData && dstGcData) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6249
	    fun = dstGcData->bitbltrop2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6250
#if 0
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6251
	    switch (fun) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6252
	      case BITBLT_COPY:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6253
		printf("BITBLT_COPY\n");
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6254
		break;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6255
	      case BITBLT_COPYINVERTED:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6256
		printf("BITBLT_COPYINVERTED\n");
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6257
		break;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6258
	      case BITBLT_XOR:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6259
		printf("BITBLT_XOR\n");
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6260
		break;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6261
	      case BITBLT_AND:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6262
		printf("BITBLT_AND\n");
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6263
		break;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6264
	      case BITBLT_OR:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6265
		printf("BITBLT_OR\n");
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6266
		break;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6267
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6268
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6269
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6270
	    if (srcGcData->hWnd 
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6271
	     && ((srcGcData->hWnd == dstGcData->hWnd)
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6272
	     && (fun == BITBLT_COPY))) {
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6273
		RECT rec,upd;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6274
		RECT invRec;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6275
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6276
#ifdef CACHE_LAST_DC
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6277
		if (lastGcData) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6278
		    _releaseDC(lastGcData);     
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6279
		}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6280
#endif
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6281
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6282
		rec.left = __intVal(srcX);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6283
		rec.top = __intVal(srcY);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6284
		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
  6285
		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
  6286
		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
  6287
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6288
		ScrollWindowEx(srcGcData->hWnd,
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6289
			    __intVal(dstX) - __intVal(srcX),
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6290
			    __intVal(dstY) - __intVal(srcY),
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6291
			    &rec, 0,
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6292
			    0 /* rgnUpd */, &invRec, SW_ERASE | SW_INVALIDATE);
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6293
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6294
		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
  6295
#if 0
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6296
		if ((invRec.right >= invRec.left)
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6297
		 && (invRec.bottom >= invRec.top)) {
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6298
		    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
  6299
		}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6300
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6301
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6302
#if 0
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6303
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6304
# ifdef DO_GEXPOSE
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6305
		UpdateWindow(srcGcData->hWnd);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6306
# endif
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6307
		ScrollWindow(srcGcData->hWnd,
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6308
			    __intVal(dstX) - __intVal(srcX),
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6309
			    __intVal(dstY) - __intVal(srcY),
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6310
			    &rec, 0);
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6311
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6312
# ifdef DO_GEXPOSE
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6313
#  ifdef OLD
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6314
		UpdateWindow(srcGcData->hWnd);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6315
		if (GetWindow_eventMask(srcGcData->hWnd) & ExposureMask)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6316
		    enqEvent(ENQ_AT_END, ExposureMask,srcGcData->hWnd, __WM_NOGEXPOSE, 0, 0, 0, 0, 0);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6317
#  else
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6318
		/* notice the reverse order ... */
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6319
		if (GetWindow_eventMask(srcGcData->hWnd) & ExposureMask)
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6320
		    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
  6321
		if (GetUpdateRect(srcGcData->hWnd, &upd, FALSE)) {
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6322
		    if ((upd.right >= upd.left)
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6323
		     && (upd.bottom >= upd.top)) {
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6324
			if (GetWindow_eventMask(srcGcData->hWnd) & ExposureMask) {
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6325
			    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
  6326
			}
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6327
		    }
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6328
		}
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6329
#  endif
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6330
# else
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6331
		UpdateWindow(srcGcData->hWnd);
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6332
# endif
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6333
#endif /* 0 */
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  6334
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6335
		RETURN ( self );
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6336
	    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6337
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6338
#if 0
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6339
	    if (srcGcData->hWnd) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6340
		/*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
  6341
	    }
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6342
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6343
	    fun = dstGcData->bitbltrop2;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6344
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6345
	    if ((srcGcData == dstGcData)
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6346
	     && (fun == BITBLT_COPY)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6347
		RECT rec, uprec;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6348
		int _srcX, _srcY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6349
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6350
		rec.left = _srcX = __intVal(srcX);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6351
		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
  6352
		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
  6353
		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
  6354
		srcDC = _getDC(srcGcData);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6355
		DPRINTF(("dst and src is DC %x fun == BITBLT_COPY  --> scrolling %d %d\n",srcDC,__intVal(dstX) - __intVal(srcX),__intVal(dstY) - __intVal(srcY)));
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6356
		ScrollDC(srcDC, __intVal(dstX)-_srcX, 
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6357
				__intVal(dstY)-_srcY, 
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6358
				&rec, 0, 0, &uprec);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6359
#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
  6360
		_releaseDC(srcGcData);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6361
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6362
		RETURN ( self );
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6363
	    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6364
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6365
#ifdef CACHE_LAST_DC
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6366
/* mhmh - this should not be needed */
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6367
	    if (lastGcData) {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6368
		_releaseDC(lastGcData);     
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6369
	    }
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6370
#endif
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6371
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6372
	    dstDC = _getDC(dstGcData);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6373
#ifdef CACHE_LAST_DC
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6374
	    dstGcOwnerThreadID = lastGcOwnerThreadID;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6375
	    lastGcData = 0;  /* kludge - to avoid release in getDC below ... */
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6376
#endif
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6377
	    if (dstGcData == srcGcData) {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6378
		srcDC = dstDC;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6379
		SetBkColor(srcDC, srcGcData->fgColor);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6380
		SetTextColor(srcDC, srcGcData->bgColor);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6381
	    } else {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6382
		srcDC = _getDC(srcGcData);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6383
		SetBkColor(srcDC, srcGcData->fgColor);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6384
		SetBkColor(dstDC, dstGcData->fgColor);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6385
		SetTextColor(srcDC, srcGcData->bgColor);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6386
		SetTextColor(dstDC, dstGcData->bgColor);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6387
	    }
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6388
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  6389
	    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
  6390
	    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
  6391
	    if (BitBlt(dstDC,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6392
		 __intVal(dstX), __intVal(dstY),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6393
		 __intVal(w), __intVal(h),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6394
		 srcDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6395
		 __intVal(srcX), __intVal(srcY),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6396
		 fun)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6397
	       == 0
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6398
	      ) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6399
		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
  6400
	    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6401
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6402
	    if (srcGcData != dstGcData) {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6403
		_releaseDC(srcGcData);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6404
	    }
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6405
#ifdef xxCACHE_LAST_DC
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6406
/* mhmh - this should not be needed */
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6407
	    lastGcData = dstGcData;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6408
	    lastGcOwnerThreadID = dstGcOwnerThreadID;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6409
#else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6410
	    _releaseDC(dstGcData);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6411
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6412
	    RETURN ( self );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  6413
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6414
    }
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  6415
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  6416
 fail: ;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6417
%}.
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6418
    self primitiveFailed.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6419
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6420
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6421
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6422
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
  6423
		width:w height:h
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6424
    "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
  6425
     copy bits from the rectangle defined by
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6426
     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
  6427
     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
  6428
     argument is not integer."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6429
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6430
    ^ self
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6431
	copyFromId:sourceId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6432
		 x:srcX y:srcY gc:srcDCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6433
		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
  6434
	     width:w height:h
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6435
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6436
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6437
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
  6438
    "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
  6439
     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
  6440
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6441
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6442
    int __x, __y, w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6443
    float angle1, angle2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6444
    double f;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6445
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6446
    if (__isSmallInteger(startAngle))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6447
	angle1 = (float)(__intVal(startAngle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6448
    else if (__isFloat(startAngle)) {
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6449
	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
  6450
    } else if (__isShortFloat(startAngle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  6451
	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
  6452
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6453
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6454
    if (__isSmallInteger(angle))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6455
	angle2 = (float)(__intVal(angle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6456
    else if (__isFloat(angle)) {
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6457
	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
  6458
    } else if (__isShortFloat(angle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  6459
	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
  6460
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6461
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6462
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6463
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6464
     && __bothSmallInteger(x, y)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6465
     && __bothSmallInteger(width, height)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6466
     {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6467
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6468
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6469
	POINT p;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6470
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6471
	w = __intVal(width);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6472
	h = __intVal(height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6473
	__x = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6474
	__y = __intVal(y);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6475
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6476
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6477
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6478
	if (! GcDataGetPen(hDC, gcData)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6479
	    DPRINTF(("displayArc: no pen\n"));
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6480
	} else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6481
	    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
  6482
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6483
	    xR = w / 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6484
	    yR = h / 2;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6485
	    if (angle2 - angle1 >= 360) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6486
		xB = xE = __x + xR + 0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6487
		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
  6488
	    } else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6489
		double sin(), cos();
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6490
		float rad1, rad2;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6491
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6492
		if (angle1 <= 180)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6493
		  angle1 = 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6494
		else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6495
		  angle1 = 360 + 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6496
		angle2 = angle1 - angle2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6497
		/* sigh - compute the intersections ... */
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6498
		rad1 = (angle1 * 3.14159265359) / 180.0;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6499
		rad2 = (angle2 * 3.14159265359) / 180.0;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6500
		xB = cos(rad1) * xR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6501
		yB = sin(rad1) * yR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6502
		xE = cos(rad2) * xR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6503
		yE = sin(rad2) * yR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6504
		xB = __x + xR - xB + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6505
		yB = __y + yR - yB + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6506
		xE = __x + xR - xE + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  6507
		yE = __y + yR - yE + 0.5;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6508
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6509
	    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
  6510
	    Arc(hDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6511
		__x, __y,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6512
		__x + w, __y + h,
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6513
		(int)xB, (int)yB,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6514
		(int)xE, (int)yE);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6515
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6516
	    GcDataReleasePen(hDC, gcData);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6517
	}
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6518
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6519
	_releaseDC(gcData);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6520
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6521
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6522
    }
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6523
    bad: ;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6524
%}.
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6525
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6526
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6527
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6528
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
  6529
    "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
  6530
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6531
%{  /* NOCONTEXT */
2000
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(x0, y0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6535
     && __bothSmallInteger(x1, y1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6536
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6537
	int __x1 = __intVal(x1), __y1 = __intVal(y1);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6538
	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
  6539
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6540
/*      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
  6541
		    __intVal(x0), __intVal(y0),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6542
		    __x1, __y1,_HWNDVal(aDrawableId)));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6543
*/
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6544
	if (! GcDataGetPen(hDC, gcData)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6545
	    DPRINTF(("displayLine: no pen\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6546
	} else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6547
	    MoveToEx(hDC, __intVal(x0), __intVal(y0), NULL);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6548
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6549
	    LineTo(hDC, __x1, __y1);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6550
	    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6551
	     * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6552
	     */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6553
	    LineTo(hDC, __x1+1, __y1);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6554
	    GcDataReleasePen(hDC, gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6555
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6556
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6557
	_releaseDC(gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6558
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6559
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6560
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6561
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6562
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6563
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6564
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
  6565
    "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
  6566
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6567
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6568
    if (__isExternalAddress(aGCId)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6569
     /* && __isExternalAddress(aDrawableId) */
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6570
     && __bothSmallInteger(px, py)) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6571
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6572
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6573
	POINT p;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6574
	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
  6575
	int savedLStyle = gcData->lStyle;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6576
	int savedLWidth = gcData->lineWidth;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6577
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6578
	/*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6579
	 * 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
  6580
	 */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6581
	if ((gcData->lStyle != PS_SOLID)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  6582
	 || (gcData->lineWidth > 1)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6583
	    FLUSH_CACHED_DC(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6584
	    gcData->lStyle = PS_SOLID;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6585
	    gcData->lineWidth = 0;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6586
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6587
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6588
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6589
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6590
	if (! GcDataGetPen(hDC,gcData)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6591
	    DPRINTF(("displayPoint: no pen\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6592
	} else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6593
	    MoveToEx(hDC, __x, __y, NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6594
	    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6595
	     * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6596
	     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6597
	    LineTo(hDC, __x+1, __y);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6598
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6599
	    GcDataReleasePen(hDC, gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6600
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6601
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6602
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6603
	_releaseDC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6604
#endif
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6605
	if ((gcData->lStyle != savedLStyle)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6606
	 || (gcData->lineWidth != savedLWidth)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6607
	    FLUSH_CACHED_DC(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6608
	    gcData->lStyle = savedLStyle;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6609
	    gcData->lineWidth = savedLWidth;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6610
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6611
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6612
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6613
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6614
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6615
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6616
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6617
displayPolygon:aPolygon in:aDrawableId with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6618
    "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
  6619
     which define the polygon.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6620
     If any coordinate is not integer, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6621
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6622
    |numberOfPoints|
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6623
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6624
    numberOfPoints := aPolygon size.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6625
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6626
%{
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6627
    OBJ point, px, py;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6628
    int i, num;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6629
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6630
    if (__isExternalAddress(aGCId)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6631
     /* && __isExternalAddress(aDrawableId) */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6632
     && __isSmallInteger(numberOfPoints)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6633
	struct gcData *gcData = _GCDATA(aGCId);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6634
	HDC hDC = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6635
	POINT p;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6636
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6637
	num = __intVal(numberOfPoints);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6638
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6639
	for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6640
	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6641
	    if (! __isPoint(point)) goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6642
	    px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6643
	    py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6644
	    if (! __bothSmallInteger(px, py)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6645
		goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6646
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6647
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6648
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6649
	hDC = _getDC(gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6650
	if (! GcDataGetPen(hDC,gcData)) {
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6651
	    DPRINTF(("displayPolygon: no pen\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6652
	} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6653
	    for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6654
		point = __AT_(aPolygon, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6655
		px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6656
		py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6657
		p.x = __intVal(px);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6658
		p.y = __intVal(py);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6659
		if (i == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6660
		    MoveToEx(hDC, p.x, p.y, NULL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6661
		} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6662
		    if (i == (num-1)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6663
			PolylineTo(hDC, &p, 1);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6664
		    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6665
			LineTo(hDC, p.x, p.y);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6666
			/*
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6667
			 * end-point ...
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6668
			 */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6669
			LineTo(hDC, p.x+1, p.y);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6670
		    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6671
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6672
	    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6673
	    GcDataReleasePen(hDC, gcData);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6674
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6675
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6676
#ifndef CACHE_LAST_DC
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6677
	_releaseDC(gcData);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6678
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6679
	RETURN ( self );
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6680
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6681
fail: ;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6682
%}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6683
!
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6684
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6685
displayPolylines:aPolyline in:aDrawableId with:aGCId
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6686
    "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
  6687
     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
  6688
     If any coordinate is not integer, an error is triggered."
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6689
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6690
    |numberOfPoints|
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6691
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6692
    numberOfPoints := aPolyline size.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6693
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6694
%{
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6695
    OBJ point, px, py;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6696
    int i, num;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6697
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6698
    if (__isExternalAddress(aGCId)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6699
     /* && __isExternalAddress(aDrawableId) */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6700
     && __isSmallInteger(numberOfPoints)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6701
	struct gcData *gcData = _GCDATA(aGCId);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6702
	HDC hDC = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6703
	POINT p;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6704
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6705
	num = __intVal(numberOfPoints);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6706
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6707
	for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6708
	    point = __AT_(aPolyline, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6709
	    if (! __isPoint(point)) goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6710
	    px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6711
	    py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6712
	    if (! __bothSmallInteger(px, py)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6713
		goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6714
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6715
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6716
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6717
	hDC = _getDC(gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6718
	if (! GcDataGetPen(hDC,gcData)) {
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6719
	    DPRINTF(("displayPolygon: no pen\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6720
	} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6721
	    for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6722
		point = __AT_(aPolyline, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6723
		px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6724
		py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6725
		p.x = __intVal(px);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6726
		p.y = __intVal(py);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6727
		if ((i & 1) == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6728
		    MoveToEx(hDC, p.x, p.y, NULL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6729
		} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6730
		    LineTo(hDC, p.x, p.y);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6731
		    /*
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6732
		     * end-point ...
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6733
		     */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6734
		    LineTo(hDC, p.x+1, p.y);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6735
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6736
	    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6737
	    GcDataReleasePen(hDC, gcData);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6738
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6739
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6740
#ifndef CACHE_LAST_DC
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6741
	_releaseDC(gcData);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6742
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6743
	RETURN ( self );
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6744
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6745
fail: ;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  6746
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6747
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6748
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6749
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
  6750
    "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
  6751
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6752
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6753
    int w, h;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6754
    int xL, yT;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6755
    if (__isExternalAddress(aGCId)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6756
     /* && __isExternalAddress(aDrawableId) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6757
     && __bothSmallInteger(x, y)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6758
     && __bothSmallInteger(width, height)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6759
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6760
	HDC hDC = _getDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6761
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6762
	xL = __intVal(x);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6763
	yT = __intVal(y);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6764
	w = __intVal(width);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6765
	h = __intVal(height);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6766
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6767
	DPRINTF(("displayRectangle: %d/%d -> %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6768
			xL, yT, w, h));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6769
	/*
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  6770
	 * 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
  6771
	 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6772
	if ((w >= 0) && (h >= 0)) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6773
	    if (! GcDataGetPen(hDC,gcData)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6774
		DPRINTF(("displayRect: no pen\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6775
	    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6776
		MoveToEx(hDC, xL, yT, NULL);
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  6777
		LineTo(hDC, xL+w, yT);
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  6778
		LineTo(hDC, xL+w, yT+h);
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  6779
		LineTo(hDC, xL, yT+h);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6780
		LineTo(hDC, xL, yT);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6781
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  6782
		GcDataReleasePen(hDC, gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6783
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6784
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6785
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6786
	_releaseDC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  6787
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6788
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6789
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6790
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6791
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6792
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6793
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
  6794
    "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
  6795
     foreground and background characters.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6796
     If the coordinates are not integers, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6797
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6798
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6799
    unsigned char *cp;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6800
    OBJ cls;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6801
    int  i1, i2, l, n;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6802
#   define NLOCALBUFFER 200
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6803
    short xlatebuffer[NLOCALBUFFER];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6804
    int nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6805
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6806
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6807
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6808
     && __isNonNilObject(aString)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6809
     && __bothSmallInteger(index1, index2)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6810
     && __bothSmallInteger(x, y)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6811
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6812
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6813
	int pX, pY;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6814
	HDC hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6815
	HFONT hOldFont;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6816
	pX = __intVal(x);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6817
	pY = __intVal(y);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6818
	pY -= gcData->fontAscent;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6819
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6820
	if (opaque == true) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6821
	    if (gcData->bkMode != BK_OPAQUE) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6822
		SetBkMode(hDC, OPAQUE);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6823
		gcData->bkMode = BK_OPAQUE;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6824
	    }
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6825
	} else {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6826
	    if (gcData->bkMode != BK_TRANSPARENT) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6827
		SetBkMode(hDC, TRANSPARENT);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6828
		gcData->bkMode = BK_TRANSPARENT;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6829
	    }
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6830
	}
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6831
#if 0
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6832
	hOldFont = SelectObject(hDC, gcData->hFont);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6833
	SetTextColor(hDC, gcData->fgColor);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6834
	SetBkColor(hDC, gcData->bgColor);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6835
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6836
	cls = __qClass(aString);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6837
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6838
	i1 = __intVal(index1) - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6839
	if (i1 >= 0) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6840
	    i2 = __intVal(index2) - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6841
	    if (i2 < i1) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6842
		goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6843
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6844
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6845
	    cp = _stringVal(aString);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6846
	    l = i2 - i1 + 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6847
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6848
	    if ((cls == @global(String)) || (cls == @global(Symbol))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6849
		n = _stringSize(aString);
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6850
		if (i2 < n) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6851
		    cp += i1;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  6852
		    DDPRINTF(("string1: %s pos=%d/%d l=%d hDC=%x hWnd=%x\n", cp, pX, pY,l,hDC,_HWNDVal(aDrawableId)));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6853
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6854
		    if (!TextOut(hDC, pX, pY, (char *)cp, l)) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  6855
		       PRINTF(("Textout failed. %d\n", GetLastError()));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6856
		    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6857
		    goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6858
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6859
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6860
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6861
	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6862
	    cp += nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6863
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6864
	    if (__isBytes(aString)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6865
		n = __byteArraySize(aString) - nInstBytes - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6866
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6867
		if (i2 < n) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6868
		    cp += i1;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  6869
		    DDPRINTF(("string: %s pos=%d/%d\n", cp, pX, pY));
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6870
		    if (!TextOut(hDC, pX, pY, (char *)cp, l)) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6871
		       PRINTF(("Textout failed. %d\n", GetLastError()));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6872
		    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6873
		    goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6874
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6875
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6876
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6877
#ifdef NOTDEF 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6878
	    /* TWOBYTESTRINGS */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6879
	    if (__isWords(aString)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6880
		n = (__byteArraySize(aString) - nInstBytes) / 2;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6881
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6882
		if (i2 < n) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6883
		    union {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6884
			char b[2];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6885
			unsigned short s;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6886
		    } u;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6887
		    int i;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6888
		    XChar2b *cp2 = (XChar2b *)0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6889
		    int mustFree = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6890
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6891
		    cp += (i1 * 2);
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6892
# if 0
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6893
		    /*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6894
		     * ST/X TwoByteStrings store the asciiValue in native byteOrder;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6895
		     * X expects them MSB first
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6896
		     * convert as required
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6897
		     */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6898
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6899
		    u.s = 0x1234;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6900
		    if (u.b[0] != 0x12) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6901
			if (l <= NLOCALBUFFER) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6902
			    cp2 = xlatebuffer;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6903
			} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6904
			    cp2 = (XChar2b *)(malloc(l * 2));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6905
			    mustFree = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6906
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6907
			for (i=0; i<l; i++) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6908
			    cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6909
			    cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6910
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6911
			cp = (char *) cp2;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6912
		    }
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  6913
# endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6914
		    if (opaque == true)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6915
			XDrawImageString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6916
		    else
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6917
			XDrawString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6918
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6919
		    if (mustFree) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6920
			free(cp2);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6921
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6922
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6923
		    goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6924
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6925
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6926
#endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6927
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6928
ret:   
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6929
#if 0
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6930
	SelectObject(hDC, hOldFont);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6931
	_releaseDC(gcData); 
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  6932
#endif
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
#undef NLOCALBUFFER
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6935
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6936
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6937
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6938
drawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6939
			  width:imageWidth height:imageHeight
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6940
			      x:srcx y:srcy
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6941
			   into:aDrawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6942
			      x:dstx y:dsty
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6943
			  width:w height:h
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6944
			   with:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6945
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6946
    "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
  6947
     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
  6948
     Individual source pixels have bitsPerPixel bits, allowing to draw
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6949
     depth and pixel-units to be different.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6950
     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
  6951
     depth - otherwise, primitive failure will be signalled.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6952
     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
  6953
     colors are allocated - otherwise the colors may be wrong."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6954
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6955
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6956
     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
  6957
     an unlimited stack, and thus cannot send primitiveFailed
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6958
    "
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6959
    (self primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6960
					width:imageWidth height:imageHeight
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6961
					     x:srcx y:srcy
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6962
					  into:aDrawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6963
					     x:dstx y:dsty
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6964
					 width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6965
					  with:aGCId)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6966
    ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6967
	"
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6968
	 also happens, if a segmentation violation occurs in the
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6969
	 XPutImage ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6970
	"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6971
	self primitiveFailed
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6972
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6973
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6974
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6975
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
  6976
	       in:aDrawableId with:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6977
    "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
  6978
     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
  6979
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6980
%{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6981
    int __x, __y, w, h;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6982
    float angle1, angle2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6983
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6984
    if (__isSmallInteger(startAngle))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6985
	angle1 = (float)(__intVal(startAngle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6986
    else if (__isFloat(startAngle)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6987
	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
  6988
    } else if (__isShortFloat(startAngle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  6989
	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
  6990
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6991
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6992
    if (__isSmallInteger(angle))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6993
	angle2 = (float)(__intVal(angle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6994
    else if (__isFloat(angle)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6995
	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
  6996
    } else if (__isShortFloat(angle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  6997
	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
  6998
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6999
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7000
    if (__isExternalAddress(aGCId)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7001
     /* && __isExternalAddress(aDrawableId) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7002
     && __bothSmallInteger(x, y)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7003
     && __bothSmallInteger(width, height)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7004
     {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7005
	struct gcData *gcData = _GCDATA(aGCId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7006
	HDC hDC;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7007
	HBRUSH hBrush;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7008
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7009
	w = __intVal(width);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7010
	h = __intVal(height);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7011
	__x = __intVal(x);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7012
	__y = __intVal(y);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7013
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7014
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7015
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7016
	if (!(hBrush = GcDataGetBrush(hDC, gcData))) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7017
	    DPRINTF(("fillArc: no brush\n"));
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  7018
	} else {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7019
	    HPEN hPen = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7020
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7021
	    if (__isWinNT) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7022
		if (! (hPen = GcDataGetPen(hDC, gcData))) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7023
		    DPRINTF(("displayArc: no pen\n"));
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7024
		    goto failpen;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7025
		}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7026
	    } else {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7027
		SelectObject(hDC, __nullPen);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7028
		w++;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7029
		h++;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7030
	    }
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7031
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7032
	    {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7033
		double xB, yB, xE, yE, xR, yR;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7034
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7035
		xR = w / 2;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7036
		yR = h / 2;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7037
		if (angle2 - angle1 >= 360) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7038
		    xB = xE = __x + xR + 0.5;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7039
		    yB = yE = __y /*+ yR + 0.5*/;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7040
		} else {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7041
		    double sin(), cos();
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7042
		    float rad1, rad2;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7043
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7044
		    if (angle1 <= 180)
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7045
			angle1 = 180 - angle1;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7046
		    else
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7047
			angle1 = 360 + 180 - angle1;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7048
		    angle2 = angle1 - angle2;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7049
		    /* sigh - compute the intersections ... */
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7050
		    rad1 = (angle1 * 3.14159265359) / 180.0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7051
		    rad2 = (angle2 * 3.14159265359) / 180.0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7052
		    xB = cos(rad1) * xR;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7053
		    yB = sin(rad1) * yR;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7054
		    xE = cos(rad2) * xR;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7055
		    yE = sin(rad2) * yR;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7056
		    xB = __x + xR - xB + 0.5;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7057
		    yB = __y + yR - yB + 0.5;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7058
		    xE = __x + xR - xE + 0.5;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7059
		    yE = __y + yR - yE + 0.5;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7060
		}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7061
		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));
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7062
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7063
		Pie(hDC,
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7064
		    __x, __y,
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7065
		    __x + w, __y + h,
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7066
		    (int)xB, (int)yB,
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7067
		    (int)xE, (int)yE);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7068
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7069
		if (hPen) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7070
		    GcDataReleasePen(hDC, gcData);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7071
		}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7072
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7073
failpen:
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7074
	    GcDataReleaseBrush(hDC, gcData);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7075
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7076
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7077
	_releaseDC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7078
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7079
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7080
    }
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  7081
    bad: ;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  7082
%}.
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  7083
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7084
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7085
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7086
fillPolygon:aPolygon in:aDrawableId with:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7087
    "fill a polygon given by its points.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7088
     If any coordinate is not integer, an error is triggered."
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
    |numberOfPoints|
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
    numberOfPoints := aPolygon size.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7093
    self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7094
	primFillPolygon:aPolygon n:numberOfPoints 
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7095
	in:aDrawableId with:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7096
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7097
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7098
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
  7099
    "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
  7100
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7101
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7102
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7103
    int w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7104
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7105
     && __isExternalAddress(aDrawableId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7106
     && __bothSmallInteger(x, y)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7107
     && __bothSmallInteger(width, height)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7108
	w = __intVal(width);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7109
	h = __intVal(height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7110
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7111
	if ((w >= 0) && (h >= 0)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7112
	    struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7113
	    HDC hDC;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7114
	    HBRUSH hBrush;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7115
	    RECT rct;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7116
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7117
	    hDC = _getDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7118
	    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
  7119
	    if (! hBrush) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7120
		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
  7121
	    } else {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  7122
		HPEN hSavePen;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  7123
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  7124
		rct.left = __intVal(x);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  7125
		rct.top = __intVal(y);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  7126
		rct.right = rct.left + w + 1;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  7127
		rct.bottom = rct.top + h + 1;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  7128
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  7129
		/*
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  7130
		 * for solid draws (without function), can use FillRect,
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  7131
		 * which is faster and does not need a pen.
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  7132
		 */
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  7133
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  7134
		if ((gcData->rop2 != R2_COPYPEN)
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  7135
		 || (gcData->bitbltrop2 != BITBLT_COPY)) {
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  7136
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  7137
		    DDPRINTF(("fillRectangle:%d.%d -> %d.%d\n",rct.left,rct.top,rct.right,rct.bottom));
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7138
		    hSavePen = SelectObject(hDC, __nullPen);
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  7139
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  7140
		    Rectangle(hDC, rct.left, rct.top, rct.right, rct.bottom);
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  7141
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7142
		    GcDataReleaseBrush(hDC, gcData);
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  7143
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  7144
		    SelectObject(hDC, hSavePen);
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  7145
		} else {                              
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  7146
		    FillRect(hDC, &rct, hBrush);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7147
		    GcDataReleaseBrush(hDC, gcData);
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  7148
		}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7149
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7150
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7151
	    _releaseDC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7152
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7153
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7154
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7155
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7156
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7157
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7158
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7159
primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7160
			      width:imageWidth height:imageHeight
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7161
				  x:srcx y:srcy
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7162
			       into:aDrawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7163
				  x:dstx y:dsty
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7164
			      width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7165
			       with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7166
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7167
    "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
  7168
     (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
  7169
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7170
%{  /* xxLIMITEDSTACK */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7171
    unsigned char fastBits[10000];
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7172
    unsigned char *b_bits = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7173
    unsigned char *allocatedBits = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7174
    struct gcData *gcData = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7175
    HDC hDC = (HDC)0;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7176
    unsigned char *__imageBits = 0;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7177
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7178
    if (__isByteArray(imageBits)) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7179
	__imageBits = __ByteArrayInstPtr(imageBits)->ba_element;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7180
    } else if (__isExternalBytes(imageBits)) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7181
	__imageBits = (unsigned char *)(__externalBytesAddress(imageBits));
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7182
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7183
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7184
    if (ISCONNECTED
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7185
     && __isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7186
     && __isExternalAddress(aDrawableId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7187
     && __bothSmallInteger(srcx, srcy)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7188
     && __bothSmallInteger(dstx, dsty)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7189
     && __bothSmallInteger(w, h)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7190
     && __bothSmallInteger(imageWidth, imageHeight)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7191
     && __bothSmallInteger(imageDepth, bitsPerPixel)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7192
     && __isSmallInteger(padd)
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7193
     && __imageBits)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7194
     {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7195
	struct
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7196
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7197
	  BITMAPINFOHEADER bmiHeader;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7198
	  DWORD r;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7199
	  DWORD g;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7200
	  DWORD b;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7201
	} bitmap;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7202
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7203
	gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7204
	if (! gcData )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7205
	    goto fail;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7206
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7207
	DDPRINTF(("hDC = %x\n", hDC));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7208
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7209
	if (__intVal(padd) != WIN32PADDING) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7210
	    int row, col;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7211
	    unsigned char *cp;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7212
	    unsigned char *pBits;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7213
	    int b_width, b_height, bytesPerRowST, bytesPerRowWN, padding, nBytes;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7214
	    int bi = __intVal(bitsPerPixel);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7215
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7216
	    b_width = __intVal(w);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7217
	    b_height = __intVal(h);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7218
	    bytesPerRowST = (b_width * bi + (__intVal(padd)-1)) / __intVal(padd);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7219
	    bytesPerRowWN = (b_width * bi + (WIN32PADDING-1)) / WIN32PADDING * (WIN32PADDING/8);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7220
	    padding = bytesPerRowWN - bytesPerRowST;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7221
	    nBytes = b_height * bytesPerRowWN;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7222
	    /*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
  7223
	    if (padding) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7224
		if (nBytes < sizeof(fastBits)) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7225
		    cp = b_bits = fastBits;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7226
		} else {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7227
		    cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7228
		}
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7229
		if (cp) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7230
		    pBits = __imageBits;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7231
		    for (row = b_height; row; row--) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7232
			for (col = bytesPerRowST; col; col--) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7233
			    *cp++ = *pBits++;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7234
			}
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7235
			cp += padding;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7236
		    }
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7237
		} else
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7238
		    goto fail;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7239
	    }
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7240
	}
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7241
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7242
	if (b_bits == 0) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7243
	    b_bits = __imageBits;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7244
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7245
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7246
	bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7247
	bitmap.bmiHeader.biPlanes = 1;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7248
	if (__intVal(imageDepth) == 24) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7249
	    /*bitmap.bmiHeader.biCompression = BI_BITFIELDS;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7250
	    bitmap.r = 0xff0000;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7251
	    bitmap.g = 0x00ff00;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7252
	    bitmap.b = 0x0000ff;*/
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7253
	    bitmap.bmiHeader.biCompression = BI_RGB;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7254
	} else if (__intVal(imageDepth) == 16) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7255
	    /*bitmap.bmiHeader.biCompression = BI_RGB;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7256
	    bitmap.bmiHeader.biCompression = BI_BITFIELDS;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7257
	    bitmap.b = 0x001f;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7258
	    bitmap.g = 0x07e0;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7259
	    bitmap.r = 0xf800;*/
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7260
	    bitmap.b = 0;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7261
	    bitmap.g = 0;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7262
	    bitmap.r = 0;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7263
	    bitmap.bmiHeader.biCompression = BI_RGB;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7264
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7265
	bitmap.bmiHeader.biSizeImage = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7266
	bitmap.bmiHeader.biXPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7267
	bitmap.bmiHeader.biYPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7268
	bitmap.bmiHeader.biClrUsed = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7269
	bitmap.bmiHeader.biClrImportant = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7270
	bitmap.bmiHeader.biWidth = __intVal(imageWidth);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7271
	bitmap.bmiHeader.biHeight = -(__intVal(imageHeight));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7272
	bitmap.bmiHeader.biBitCount = __intVal(bitsPerPixel);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7273
	/*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
  7274
	SetDIBitsToDevice(hDC,__intVal(dstx),__intVal(dsty),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7275
			      __intVal(w), __intVal(h),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7276
			      __intVal(srcx), __intVal(srcy),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7277
			      0,__intVal(h),
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7278
			      (void *)b_bits,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7279
			      (BITMAPINFO*)&bitmap,DIB_RGB_COLORS);
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7280
	if (allocatedBits) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7281
	    free(allocatedBits);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7282
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7283
	_releaseDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7284
	RETURN ( true );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7285
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7286
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7287
fail: ;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7288
    PRINTF(("create temp bitmap FAILED!!!\n"));
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7289
    if (allocatedBits) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7290
	PRINTF(("freeing up temp bitmap bits ...\n"));
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7291
	free(allocatedBits);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7292
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7293
    if (gcData && hDC) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7294
	_releaseDC(gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7295
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7296
%}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7297
.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7298
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7299
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7300
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7301
primFillPolygon:aPolygon n:numberOfPoints in:aDrawableId with:aGCId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7302
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7303
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7304
    OBJ point, px, py;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7305
    int i, num;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7306
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7307
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7308
     && __isExternalAddress(aDrawableId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7309
     && __isSmallInteger(numberOfPoints)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7310
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7311
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  7312
	POINT p;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  7313
	HBRUSH hBrush;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7314
        
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7315
	num = __intVal(numberOfPoints);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7316
	if (num < 3) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7317
	    RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7318
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7319
	for (i=0; i<num; i++) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7320
	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7321
	    if (! __isPoint(point)) goto fail;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  7322
	    px = _point_X(point);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  7323
	    py = _point_Y(point);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  7324
	    if (! __bothSmallInteger(px, py))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7325
		goto fail;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7326
	}
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  7327
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7328
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7329
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7330
	if (!(hBrush = GcDataGetBrush(hDC,gcData))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7331
	    DPRINTF(("fillPolygon: no brush\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7332
	} else {
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  7333
	    BeginPath(hDC);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  7334
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7335
	    for (i=0; i<num; i++) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7336
		point = __AT_(aPolygon, __MKSMALLINT(i+1));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7337
		px = _point_X(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7338
		py = _point_Y(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7339
		if (i == 0) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7340
		    MoveToEx(hDC, __intVal(px), __intVal(py), NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7341
		} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7342
		    if (i == (num-1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7343
			p.x = __intVal(px);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7344
			p.y = __intVal(py);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7345
			PolylineTo(hDC, &p, 1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7346
		    } else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7347
			LineTo(hDC, __intVal(px), __intVal(py));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7348
		    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7349
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7350
	    }
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  7351
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  7352
	    EndPath(hDC);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  7353
	    FillPath(hDC);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7354
	    GcDataReleaseBrush(hDC, gcData);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7355
	}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7356
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7357
	_releaseDC(gcData);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7358
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7359
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7360
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7361
fail: ;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7362
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7363
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7364
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7365
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7366
!WinWorkstation methodsFor:'event forwarding'!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7367
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7368
activate:aBoolean view:aView
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7369
    "some view was activated/deactivated.
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7370
     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
  7371
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7372
    aBoolean ifFalse:[
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7373
	activeView := nil.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7374
	self focusOutView:aView.
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7375
    ] ifTrue:[
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7376
	activeView := aView.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7377
	self focusInView:aView.
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7378
    ].
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7379
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7380
    "Created: / 28.4.1999 / 14:51:51 / cg"
2599
9c0749ee47ed #activate:view: via sensor
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  7381
    "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
  7382
!
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7383
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7384
displayChange
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7385
    "the display metrics/settings have changed.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7386
     This is a speciality of windows.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7387
     TODO: Tell the viewStyle to update itself,
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7388
	   and tell all views to reinit their style.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7389
     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
  7390
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7391
    self initializeVariableScreenProperties.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7392
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7393
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7394
fontChange
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7395
    "the system fonts (users preferences) have changed.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7396
     This is a speciality of windows.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7397
     TODO: Tell the viewStyle to update itself,
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7398
	   and tell all views to reinit their style.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7399
     For now,this is ignored."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7400
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  7401
    IgnoreFontChanges ~~ true ifTrue:[
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  7402
	'WinWorkstation [info]: fontChange ignored for now.' infoPrintCR
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  7403
    ]
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7404
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7405
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7406
queryEndSession
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7407
    "system is about to be shut down.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7408
     This is a speciality of windows.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7409
     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
  7410
     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
  7411
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7412
    '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
  7413
    ^ true
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7414
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7415
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7416
systemColorChange:aWindow
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7417
    "the system colors (users preferences) have changed.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7418
     This is a speciality of windows.
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  7419
     Tell the viewStyle to update itself,
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  7420
     and tell all view to reinit its style."
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7421
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7422
"/    'WinWorkstation [info]: systemColorChange for ' infoPrint.
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7423
"/    aWindow printCR.
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7424
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  7425
    IgnoreSysColorChanges ~~ true ifTrue:[
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  7426
	"/ TODO: this should go through the sensor ...
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  7427
	"/ ...and handled as an event by the views thread.
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  7428
	View updateAllStyleCaches.
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  7429
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  7430
	aWindow withAllSubViewsDo:[:aView |
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  7431
	    aView reinitStyle
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  7432
	]
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7433
    ]
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7434
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7435
    "Modified: / 10.9.1998 / 21:53:34 / cg"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7436
! !
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7437
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7438
!WinWorkstation methodsFor:'event handling'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7439
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7440
dispatchEventFor:aViewIdOrNil withMask:eventMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7441
    "central event handling method:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7442
     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
  7443
     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
  7444
     otherwise only events for the view with given id are processed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7445
     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
  7446
     handled.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7447
     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
  7448
	      pending event before calling this."
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7449
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7450
    (self getEventFor:aViewIdOrNil withMask:eventMask) ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7451
	AbortSignal handle:[:ex |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7452
	    ex return
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7453
	] do:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7454
	    self dispatchLastEvent.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7455
	]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7456
    ].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7457
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7458
    "Modified: 19.8.1997 / 17:10:42 / cg"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7459
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7460
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7461
dispatchExposeEventFor:aViewIdOrNil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7462
    "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
  7463
     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
  7464
     otherwise only events for the view with given id are processed."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7465
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7466
    self dispatchEventFor:aViewIdOrNil withMask:(self eventMaskFor:#expose)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7467
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7468
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7469
dispatchLastEvent
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7470
    |theView symS arg butt sibling windowID siblingID propertyID selectionID targetID requestorID
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7471
     eventType|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7472
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7473
%{  /* xxSTACK: 8000 */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7474
    struct queuedEvent *ev = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7475
    struct queuedEvent _ev_buf;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7476
    struct inlineCache *ipS;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7477
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7478
    static struct inlineCache vid = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7479
    static struct inlineCache conf = _ILC5;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7480
    static struct inlineCache skp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7481
    static struct inlineCache skr = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7482
    static struct inlineCache exp = _ILC5;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7483
    static struct inlineCache gexpS = _ILC6;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7484
    static struct inlineCache nexpS = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7485
    static struct inlineCache clr = _ILC5;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7486
    static struct inlineCache bp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7487
    static struct inlineCache br = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7488
    static struct inlineCache bmp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7489
    static struct inlineCache bsp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7490
    static struct inlineCache mot = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7491
    static struct inlineCache unmap = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7492
    static struct inlineCache map = _ILC1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7493
    static struct inlineCache termS = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7494
    static struct inlineCache destr = _ILC1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7495
    static struct inlineCache setCurs = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7496
    static struct inlineCache focOut = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7497
    static struct inlineCache focIn = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7498
    static struct inlineCache act = _ILC2;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7499
    static struct inlineCache pe = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7500
    static struct inlineCache pl = _ILC2;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7501
    static struct inlineCache vis = _ILC1;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  7502
    static struct inlineCache sysClrChg = _ILC1;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7503
    static struct inlineCache fontChg = _ILC0;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7504
    static struct inlineCache qEndSess = _ILC0;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7505
    static struct inlineCache powerDown = _ILC0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7506
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7507
    int x, y, w, h;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7508
    int keyCode, modifiers, isDoubleClick = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7509
    int isDown = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7510
    int state;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7511
    OBJ upDown;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7512
    OBJ eB;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7513
    char nameBuffer[100];
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7514
    HWND hWnd = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7515
    DDPRINTF(("dispatchLast\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7516
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7517
    eB = __INST(eventBuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7518
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7519
    if (__isByteArray(eB)) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7520
	ev = (struct queuedEvent *)(__ByteArrayInstPtr(eB)->ba_element);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7521
    } else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7522
	fprintf(stderr, "WinWorkstation [error]: no eventBuffer\n");
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7523
	RETURN (false);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7524
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7525
    if (ev) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7526
	_ev_buf = *ev;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7527
	ev = &_ev_buf;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7528
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7529
    hWnd = ev->ev_hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7530
    if (!(hWnd /*&& IsWindow(hWnd)*/)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7531
	DPRINTF(("wrong hWnd in event in dispatchLastEvent\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7532
	RETURN (false);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7533
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7534
    {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7535
	OBJ t;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7536
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7537
	/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7538
	 * 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
  7539
	 * avoid creation & lookup then.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7540
	 */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7541
#if 1
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7542
	if ((t = __INST(lastId)) != nil) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7543
	    if (__isExternalAddress(t)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7544
		if (_HWNDVal(t) == hWnd) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7545
		    theView = __INST(lastView);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7546
		    if (__isNonNilObject(theView)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7547
			if (__qClass(theView) == nil) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7548
			    theView = nil;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7549
			}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7550
		    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7551
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7552
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7553
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7554
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7555
	if (theView == nil) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7556
	    windowID = __MKOBJ(ev->ev_hWnd);
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7557
	    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
  7558
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7559
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7560
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7561
    if (theView == nil) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7562
	DPRINTF(("nil view [hWnd=%x] in dispatchEvent\n", ev->ev_hWnd));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7563
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7564
	RETURN (false);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7565
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7566
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7567
    switch (ev->ev_message) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7568
	    case WM_WINDOWPOSCHANGED:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7569
		{
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7570
		    RECT rct;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7571
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7572
		    DPRINTF((">>> WM_WINDOWPOSCHANGED -> configureX:y:width:height:view:\n"));
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7573
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7574
		    x = ev->ev_x;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7575
		    y = ev->ev_y;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7576
		    w = ev->ev_w;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7577
		    h = ev->ev_h;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7578
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7579
		    /*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
  7580
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7581
		    (*conf.ilc_func)(self,
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7582
				 @symbol(configureX:y:width:height:view:),
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7583
				 nil, &conf,
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7584
				 __MKSMALLINT(x),
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7585
				 __MKSMALLINT(y),
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7586
				 __MKSMALLINT(w),
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7587
				 __MKSMALLINT(h),
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7588
				 theView);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7589
		}
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7590
		break;
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7591
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7592
	    case WM_DROPFILES:
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7593
		{
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7594
		  int i;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7595
		  char buf[MAXPATH];
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7596
		  HDROP hDrop = (HDROP)ev->ev_wParam;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7597
		  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
  7598
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7599
		  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
  7600
		  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
  7601
		      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
  7602
		      PRINTF(("Filename:%s\n",buf));
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7603
		  }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7604
		  DragFinish(hDrop);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7605
		}
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7606
		break;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7607
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7608
	    case WM_SHOWWINDOW:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7609
		if (ev->ev_wParam == TRUE) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7610
		    DPRINTF((">>> WM_SHOWWINDOW -> mappedView:\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7611
		    arg = @symbol(unobscured);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7612
		    (*vis.ilc_func)(theView, @symbol(visibilityChange:), nil, &vis, arg);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7613
		    (*map.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7614
				     @symbol(mappedView:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7615
				     nil, &map, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7616
		} else {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7617
		    DPRINTF((">>> WM_SHOWWINDOW -> unMappedView:\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7618
		    arg = @symbol(fullyObscured);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7619
		    (*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
  7620
		    (*unmap.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7621
				       @symbol(unmappedView:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7622
				       nil, &unmap, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7623
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7624
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7625
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7626
	    case WM_CLOSE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7627
		    (*termS.ilc_func)(self,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7628
				      @symbol(terminateView:), nil, &termS, theView);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7629
		    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7630
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7631
	    case WM_DESTROY:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7632
		DPRINTF((">>> WM_DESTROY -> destroyedView\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7633
		(*destr.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7634
				   @symbol(destroyedView:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7635
				   nil, &destr, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7636
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7637
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7638
	    case WM_ACTIVATE:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7639
		DPRINTF((">>> WM_ACTIVATE h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7640
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7641
		switch (LOWORD(ev->ev_wParam)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7642
		    case WA_INACTIVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7643
			(*act.ilc_func)(self,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7644
					@symbol(activate:view:),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7645
					nil,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7646
					&act,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7647
					false,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7648
					theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7649
			break;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7650
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7651
		    case WA_ACTIVE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7652
		    case WA_CLICKACTIVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7653
			(*act.ilc_func)(self,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7654
					@symbol(activate:view:),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7655
					nil,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7656
					&act,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7657
					true,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7658
					theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7659
			break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7660
		    default:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7661
			break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7662
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7663
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7664
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7665
	    case WM_MOUSEACTIVATE:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7666
		DPRINTF((">>> WM_MOUSEACTIVATE h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7667
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7668
		(*focIn.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7669
				   @symbol(focusInView:),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7670
				   nil,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7671
				   &focIn,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7672
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7673
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7674
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7675
	    case WM_SETFOCUS:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7676
		DPRINTF((">>> WM_SETFOCUS h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7677
		(*focIn.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7678
				   @symbol(focusInView:),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7679
				   nil,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7680
				   &focIn,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7681
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7682
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7683
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7684
	    case WM_KILLFOCUS:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7685
		DPRINTF((">>> WM_KILLFOCUS h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7686
		(*focOut.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7687
				   @symbol(focusOutView:),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7688
				   nil,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7689
				   &focOut,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7690
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7691
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7692
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7693
	    case __WM_GEXPOSE:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7694
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7695
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7696
		w = ev->ev_w;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7697
		h = ev->ev_h;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7698
		(*gexpS.ilc_func)(self,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7699
			 @symbol(graphicsExposeX:y:width:height:final:view:), nil, &gexpS,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7700
			 __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7701
			 __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7702
			 __MKSMALLINT(w),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7703
			 __MKSMALLINT(h),
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7704
			 true,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7705
			 theView);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7706
		break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7707
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7708
	    case __WM_NOGEXPOSE:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7709
		 (*nexpS.ilc_func)(self,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7710
			 @symbol(noExposeView:), nil, &nexpS,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7711
			 theView);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7712
		break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7713
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7714
	    case WM_PAINT:
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  7715
		x = ev->ev_x;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  7716
		y = ev->ev_y;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  7717
		w = ev->ev_w;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  7718
		h = ev->ev_h;
2620
519011e49878 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2619
diff changeset
  7719
#ifdef LATE_BG_PAINT
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  7720
		{
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7721
		    RECT rec;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7722
		    HDC dc = (HDC)GetDC(ev->ev_hWnd);
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  7723
		    HBRUSH br;
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  7724
		    int mustDeleteBrush = 0;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  7725
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  7726
		    br = GetWindow_viewBgBrush(ev->ev_hWnd);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  7727
		    if (! br) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  7728
			br = CreateSolidBrush(GetWindow_viewBgColor(ev->ev_hWnd));
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  7729
			mustDeleteBrush = 1;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  7730
		    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7731
		    if (br) {
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  7732
			rec.left = x;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  7733
			rec.top = y;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  7734
			rec.right = x + w - 1;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  7735
			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
  7736
			// 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
  7737
			SelectClipRgn(dc,0);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7738
			FillRect(dc, &rec, br);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  7739
			if (mustDeleteBrush) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  7740
			    _DeleteObject(br, __LINE__);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  7741
			}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7742
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7743
		    ReleaseDC(ev->ev_hWnd,dc);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  7744
		}
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  7745
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7746
		/*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
  7747
	    /*expose:*/
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7748
		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
  7749
		(*exp.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7750
			 @symbol(exposeX:y:width:height:view:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7751
			 nil, &exp,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7752
			 __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7753
			 __MKSMALLINT(y),
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  7754
			 __MKSMALLINT(w),
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  7755
			 __MKSMALLINT(h),
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7756
			 theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7757
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7758
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7759
	    case WM_LBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7760
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7761
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7762
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7763
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7764
	    case WM_LBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7765
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7766
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7767
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7768
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7769
	    case WM_LBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7770
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7771
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7772
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7773
	    case WM_MBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7774
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7775
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7776
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7777
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7778
	    case WM_MBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7779
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7780
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7781
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7782
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7783
	    case WM_MBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7784
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7785
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7786
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7787
	    case WM_RBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7788
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7789
		butt = __MKSMALLINT(Button3);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7790
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7791
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7792
	    case WM_RBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7793
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7794
		butt = __MKSMALLINT(Button3);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7795
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7796
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7797
	    case WM_RBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7798
		butt = __MKSMALLINT(Button3);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7799
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7800
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7801
	    commonButtonDown:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7802
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7803
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7804
		modifiers = ev->ev_modifiers;
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
		if (__INST(buttonTranslation) != nil) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7807
		    butt = __AT_(__INST(buttonTranslation), butt);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7808
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7809
		arg = butt;
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
		__INST(altDown) = (modifiers & AltMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7812
		__INST(metaDown) = (modifiers & MetaMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7813
		__INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7814
		__INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7815
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7816
		if (isDoubleClick) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7817
		    multiClickState = 1;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7818
		    nextMultiClickTime = lastMSGTime + multiClickTime;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7819
		    ipS = &bmp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7820
		    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
  7821
		} else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7822
		    if (isDown) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7823
			if (multiClickState && (lastMSGTime < nextMultiClickTime)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7824
			    nextMultiClickTime = lastMSGTime + multiClickTime;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7825
			    ipS = &bmp;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7826
			    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
  7827
			} else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7828
			    multiClickState = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7829
			    ipS = &bp;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7830
			    symS = @symbol(buttonPress:x:y:view:);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7831
			}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7832
		    } else {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7833
			ipS = &br;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7834
			symS = @symbol(buttonRelease:x:y:view:);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7835
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7836
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7837
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7838
		if (__isSymbol(arg)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7839
		    DPRINTF(("buttonPress/buttonRelease: %s %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7840
				__stringVal(arg), x, y));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7841
		} else {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7842
		    DPRINTF(("buttonPress/buttonRelease: %d %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7843
				__intVal(arg), x, y));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7844
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7845
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7846
		(*(*ipS).ilc_func)(self, symS, nil, ipS,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7847
				   arg,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7848
				   __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7849
				   __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7850
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7851
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7852
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7853
	    case __WM_MOUSEENTER:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7854
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7855
		y = ev->ev_y;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7856
		state = ev->ev_modifiers;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7857
		DPRINTF((">>> WM_MOUSEENTER: %d/%d %x\n", x, y, state));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7858
		(*pe.ilc_func)(self, @symbol(pointerEnter:x:y:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7859
				    nil, &pe,
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7860
				    __MKSMALLINT(state),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7861
				    __MKSMALLINT(x),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7862
				    __MKSMALLINT(y),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7863
				    theView);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7864
		break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7865
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7866
	    case __WM_MOUSELEAVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7867
		state = ev->ev_modifiers;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7868
		DPRINTF((">>> WM_MOUSELEAVE: %d/%d %x\n", x, y, state));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7869
		(*pl.ilc_func)(self, @symbol(pointerLeave:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7870
				    nil, &pl,
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7871
				    __MKSMALLINT(state),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7872
				    theView);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7873
		break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7874
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7875
	    case WM_MOUSEMOVE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7876
		x = ev->ev_x;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7877
		y = ev->ev_y;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7878
		state = ev->ev_modifiers;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7879
		DPRINTF((">>> WM_MOUSEMOVE: %d/%d %x\n", x, y, state));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7880
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7881
		(*mot.ilc_func)(self, @symbol(buttonMotion:x:y:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7882
				    nil, &mot,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7883
				    __MKSMALLINT(state),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7884
				    __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7885
				    __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7886
				    theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7887
		break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7888
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7889
	    case WM_CHAR:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7890
		DPRINTF((">>> WM_CHAR: %d/%d\n", x, y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7891
		symS = @symbol(keyPress:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7892
		ipS = &skp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7893
		upDown = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7894
		goto keyPressAndRelease;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7895
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7896
	    case WM_SYSKEYUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7897
	    case WM_KEYUP:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7898
		DPRINTF((">>> WM_KEYUP / SYSKEYUP: %d/%d\n", x, y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7899
		symS = @symbol(keyRelease:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7900
		ipS = &skr;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7901
		upDown = false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7902
		goto keyPressAndRelease;
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
	    case WM_SYSKEYDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7905
	    case WM_KEYDOWN:
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7906
#ifdef EXIT_WITH_3_CTRL_Cs
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7907
		if (ev->ev_keyCode == 0x11) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7908
		    c_count = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7909
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7910
#endif
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7911
		DPRINTF((">>> WM_KEYDOWN / SYSKEYDOWN: %d/%d\n", x, y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7912
		symS = @symbol(keyPress:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7913
		ipS = &skp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7914
		upDown = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7915
		/* FALL INTO */
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
	    keyPressAndRelease: ;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7918
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7919
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7920
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7921
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7922
#ifdef NOTDEF
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7923
		{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7924
		    BYTE vKeyState[256];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7925
		    char buff[5];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7926
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7927
		    GetKeyboardState(vKeyState);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7928
		    ToAscii(ev->ev_keyCode, ev->ev_scanCode, vKeyState, &buff; 0);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7929
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7930
#endif
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
		keyCode = ev->ev_keyCode;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7933
		modifiers = ev->ev_modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7934
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7935
		if (modifiers & TRANSLATED_KEY) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7936
		    if (modifiers & ControlMask) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7937
			if (keyCode < 0x20) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7938
			    keyCode = keyCode + 'a' - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7939
			    if (modifiers & ShiftMask) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7940
				keyCode = keyCode - 'a' + 'A';
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7941
			    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7942
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7943
		    } else if (modifiers & (MetaMask | AltMask)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7944
			if (! (modifiers & ShiftMask)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7945
			    if ((keyCode >= 'A') && (keyCode <= 'Z')) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7946
				keyCode = keyCode - 'A' + 'a';
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7947
			    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7948
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7949
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7950
		    arg = __MKCHARACTER(keyCode & 0xFF);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7951
		} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7952
		    switch (keyCode) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7953
			case VK_F1:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7954
			    arg = @symbol(F1);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7955
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7956
			case VK_F2:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7957
			    arg = @symbol(F2);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7958
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7959
			case VK_F3:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7960
			    arg = @symbol(F3);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7961
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7962
			case VK_F4:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7963
			    arg = @symbol(F4);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7964
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7965
			case VK_F5:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7966
			    arg = @symbol(F5);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7967
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7968
			case VK_F6:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7969
			    arg = @symbol(F6);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7970
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7971
			case VK_F7:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7972
			    arg = @symbol(F7);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7973
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7974
			case VK_F8:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7975
			    arg = @symbol(F8);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7976
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7977
			case VK_F9:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7978
			    arg = @symbol(F9);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7979
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7980
			case VK_F10:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7981
			    arg = @symbol(F10);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7982
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7983
			case VK_F11:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7984
			    arg = @symbol(F11);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7985
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7986
			case VK_F12:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7987
			    arg = @symbol(F12);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7988
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7989
			case VK_PRIOR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7990
			    arg = @symbol(Prior);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7991
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7992
			case VK_NEXT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7993
			    arg = @symbol(Next);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7994
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7995
			case VK_END:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7996
			    arg = @symbol(End);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7997
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7998
			case VK_HOME:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7999
			    arg = @symbol(Home);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8000
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8001
			case VK_LEFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8002
			    arg = @symbol(CursorLeft);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8003
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8004
			case VK_RIGHT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8005
			    arg = @symbol(CursorRight);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8006
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8007
			case VK_UP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8008
			    arg = @symbol(CursorUp);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8009
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8010
			case VK_DOWN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8011
			    arg = @symbol(CursorDown);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8012
			    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8013
			case VK_MENU:  /*alt key with w95 ???*/
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8014
			    arg = @symbol(Menu);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8015
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8016
			case VK_LMENU:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8017
			    arg = @symbol(Menu_L);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8018
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8019
			case VK_RMENU:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8020
			    arg = @symbol(Menu_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8021
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8022
			case VK_PAUSE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8023
			    arg = @symbol(Pause);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8024
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8025
			case VK_HELP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8026
			    arg = @symbol(Help);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8027
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8028
			case VK_EXECUTE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8029
			    arg = @symbol(Execute);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8030
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8031
			case VK_CANCEL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8032
			    arg = @symbol(Cancel);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8033
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8034
			case VK_SELECT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8035
			    arg = @symbol(Select);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8036
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8037
			case VK_PRINT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8038
			    arg = @symbol(Print);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8039
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8040
			case VK_SNAPSHOT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8041
			    arg = @symbol(Snapshot);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8042
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8043
			case VK_INSERT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8044
			    arg = @symbol(Insert);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8045
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8046
			case VK_DELETE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8047
			    arg = @symbol(Delete);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8048
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8049
			case VK_BACK:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8050
			    arg = @symbol(BackSpace);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8051
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8052
			case VK_LWIN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8053
			    arg = @symbol(Win_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8054
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8055
			case VK_RWIN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8056
			    arg = @symbol(Win_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8057
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8058
			case VK_APPS:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8059
			    arg = @symbol(Appl);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8060
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8061
			case VK_NUMPAD0:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8062
			    arg = @symbol(KeyPad0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8063
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8064
			case VK_NUMPAD1:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8065
			    arg = @symbol(KeyPad1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8066
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8067
			case VK_NUMPAD2:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8068
			    arg = @symbol(KeyPad2);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8069
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8070
			case VK_NUMPAD3:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8071
			    arg = @symbol(KeyPad3);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8072
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8073
			case VK_NUMPAD4:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8074
			    arg = @symbol(KeyPad4);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8075
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8076
			case VK_NUMPAD5:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8077
			    arg = @symbol(KeyPad5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8078
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8079
			case VK_NUMPAD6:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8080
			    arg = @symbol(KeyPad6);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8081
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8082
			case VK_NUMPAD7:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8083
			    arg = @symbol(KeyPad7);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8084
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8085
			case VK_NUMPAD8:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8086
			    arg = @symbol(KeyPad8);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8087
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8088
			case VK_NUMPAD9:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8089
			    arg = @symbol(KeyPad9);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8090
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8091
			case VK_LSHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8092
			    arg = @symbol(Shift_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8093
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8094
			case VK_RSHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8095
			    arg = @symbol(Shift_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8096
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8097
			case VK_LCONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8098
			    arg = @symbol(Ctrl_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8099
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8100
			case VK_RCONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8101
			    arg = @symbol(Ctrl_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8102
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8103
			case VK_CONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8104
			    arg = @symbol(Ctrl);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8105
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8106
			case VK_SHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8107
			    arg = @symbol(Shift);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8108
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8109
			case VK_TAB:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8110
			    arg = @symbol(Tab);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8111
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8112
			case VK_ESCAPE:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8113
			    arg = @symbol(Escape);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8114
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8115
			case VK_NUMLOCK:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8116
			    arg = @symbol(NumLock);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8117
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8118
			case VK_SCROLL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8119
			    arg = @symbol(ScrollLock);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8120
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8121
			case VK_RETURN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8122
			    arg = @symbol(Return);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8123
			    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8124
			default:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8125
			    nameBuffer[0] = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8126
			    /*GetKeyNameText(ev->ev_scanCode, nameBuffer, sizeof(nameBuffer));*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8127
			    DPRINTF(("char is <%d>\n", keyCode));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8128
			    arg = __MKCHARACTER(keyCode & 0xFF);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8129
			    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8130
		    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8131
		 }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8132
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8133
		DPRINTF(("%s: code=%x mod=%x\n", __stringVal(symS),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8134
				keyCode, modifiers));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8135
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8136
		__INST(altDown) = (modifiers & AltMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8137
		__INST(metaDown) = (modifiers & MetaMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8138
		__INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8139
		__INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8140
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8141
		(*(*ipS).ilc_func)(self, symS, nil, ipS,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8142
				   arg,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8143
				   __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8144
				   __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8145
				   theView);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8146
		break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8147
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8148
	   case WM_SYSCOLORCHANGE:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8149
		DPRINTF((">>> WM_SYSCOLORCHANGE\n"));
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  8150
		(*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
  8151
		break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8152
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8153
	   case WM_FONTCHANGE:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8154
		DPRINTF((">>> WM_FONTCHANGE\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8155
		(*fontChg.ilc_func)(self, @symbol(fontChange), nil, &fontChg);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8156
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8157
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8158
	   case WM_DISPLAYCHANGE:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8159
		DPRINTF((">>> WM_DISPLAYCHANGE\n"));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8160
		(*fontChg.ilc_func)(self, @symbol(displayChange), nil, &fontChg);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8161
		break;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8162
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8163
	   case WM_QUERYENDSESSION:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8164
		DPRINTF((">>> WM_QUERYENDSESSION\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8165
		(*qEndSess.ilc_func)(self, @symbol(queryEndSession), nil, &qEndSess);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8166
		break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8167
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8168
#ifdef LATER
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8169
	   case WM_POWER:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8170
		DPRINTF((">>> WM_POWER\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8171
		(*power.ilc_func)(self, @symbol(powerDown), nil, &power);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8172
	       break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8173
#endif
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8174
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8175
	    default:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8176
		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
  8177
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8178
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8179
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8180
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8181
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8182
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8183
dispatchPendingEvents
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8184
    "central event handling method for modal operation.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8185
     (i.e. this is now only used in the modal debugger)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8186
     Dispatch any pending events; return when no more are pending.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8187
     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
  8188
     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
  8189
     we only handle exposes until the graphicsExpose arrives.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8190
     Other systems may not need such a kludge"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8191
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8192
    [self eventPendingWithSync:false] whileTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8193
	(self getEventFor:nil withMask:nil) ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8194
	    AbortSignal handle:[:ex |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8195
		ex return
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8196
	    ] do:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8197
		self dispatchLastEvent
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8198
	    ]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8199
	].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8200
    ]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8201
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8202
    "Modified: 19.8.1997 / 17:11:18 / cg"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8203
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8204
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8205
disposeEventsWithMask:aMask for:aWindowIdOrNil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8206
    "dispose (throw away) specific events. If aWindowId is nil,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8207
     events matching the mask are thrown away regardless of which
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8208
     view they are for. Otherwise, only matching events for that
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8209
     view are flushed."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8210
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8211
%{  /* NOCONTEXT */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8212
   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
  8213
   RETURN ( self );
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8214
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8215
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8216
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8217
eventMaskFor:anEventSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8218
    "return the eventMask bit-constant corresponding to an event symbol"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8219
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8220
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8221
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8222
    int m = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8223
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8224
    if (anEventSymbol == @symbol(keyPress)) m = KeyPressMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8225
    else if (anEventSymbol == @symbol(keyRelease)) m = KeyReleaseMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8226
    else if (anEventSymbol == @symbol(buttonPress)) m = ButtonPressMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8227
    else if (anEventSymbol == @symbol(buttonRelease)) m = ButtonReleaseMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8228
    else if (anEventSymbol == @symbol(buttonMotion)) m = ButtonMotionMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8229
    else if (anEventSymbol == @symbol(pointerMotion)) m = PointerMotionMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8230
    else if (anEventSymbol == @symbol(expose)) m = ExposureMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8231
    else if (anEventSymbol == @symbol(focusChange)) m = FocusChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8232
    else if (anEventSymbol == @symbol(enter)) m = EnterWindowMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8233
    else if (anEventSymbol == @symbol(leave)) m = LeaveWindowMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8234
    else if (anEventSymbol == @symbol(keymapState)) m = KeymapStateMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8235
    else if (anEventSymbol == @symbol(visibilityChange)) m = VisibilityChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8236
    else if (anEventSymbol == @symbol(structureNotify)) m = StructureNotifyMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8237
    else if (anEventSymbol == @symbol(resizeRedirect)) m = ResizeRedirectMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8238
    else if (anEventSymbol == @symbol(propertyChange)) m = PropertyChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8239
    else if (anEventSymbol == @symbol(colormapChange)) m = ColormapChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8240
    RETURN (__MKSMALLINT(m));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8241
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8242
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8243
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8244
eventPending
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8245
    "return true, if any event is pending.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8246
     This looks for both the internal queue and the display connection."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8247
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8248
    ^ self eventPendingWithSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8249
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8250
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8251
eventPending:anEventSymbol for:aWindowIdOrNil
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8252
    "return true, if a specific event is pending"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8253
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8254
    ^ self eventsPending:(self eventMaskFor:anEventSymbol) for:aWindowIdOrNil withSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8255
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8256
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8257
eventPendingWithSync:doSync
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8258
    "return true, if any event is pending.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8259
     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
  8260
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8261
    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
  8262
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8263
%{  /* xxLIMITEDSTACK (WIN95 only) */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8264
    if (hasEventQueued()) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8265
	RETURN (true);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8266
    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8267
%}.
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8268
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8269
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8270
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8271
eventQueued
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8272
    "return true, if any event is queued"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8273
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8274
    ^ self eventQueuedAlready
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8275
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8276
    "Created: 12.12.1995 / 21:43:00 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8277
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8278
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8279
eventQueuedAlready
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8280
    "return true, if any event is queued internally.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8281
     (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
  8282
      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
  8283
      the display connection)."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8284
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8285
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8286
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8287
    DDPRINTF(("peek q - "));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8288
    if (hasEventQueued()) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8289
	DDPRINTF(("true\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8290
	RETURN (true);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8291
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8292
    DDPRINTF(("false\n"));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8293
%}.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8294
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8295
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8296
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8297
eventsPending:anEventMask for:aWindowIdOrNil withSync:doSync
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8298
    "return true, if any of the masked events is pending.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8299
     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
  8300
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8301
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8302
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8303
    DPRINTF(("eventsPending mask %x - not implemented\n", __intVal(anEventMask)));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8304
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8305
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8306
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8307
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8308
exposeEventPendingFor:aWindowIdOrNil withSync:doSync
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8309
    "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
  8310
     or any view (if the arg is nil).
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8311
     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
  8312
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8313
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8314
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8315
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8316
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8317
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8318
getEventFor:aViewIdOrNil withMask:eventMask
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8319
    "read next event - put into local eventBuffer.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8320
     If aViewIdOrNil is nil, events for any view are fetched;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8321
     otherwise only events for that specific view will be fetched.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8322
     Returns true, if there was an event, false otherwise."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8323
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8324
%{  /* xxLIMITEDSTACK */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8325
    HWND win, wWanted;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8326
    int evMask;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8327
    OBJ eB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8328
    struct queuedEvent *ev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8329
    struct queuedEvent *qev;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8330
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8331
    eB = __INST(eventBuffer);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8332
    if (! __isByteArray(eB)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8333
	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
  8334
	/* RETURN (false); */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8335
    } else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8336
	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
  8337
	ev->ev_message = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8338
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8339
	if (__isSmallInteger(eventMask)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8340
	    evMask = __intVal(eventMask);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8341
	} else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8342
	    evMask = ~0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8343
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8344
	if (__isExternalAddress(aViewIdOrNil)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8345
	    wWanted = _HWNDVal(aViewIdOrNil);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8346
	} else{
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8347
	    wWanted = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8348
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8349
	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
  8350
	    RETURN ( true );
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8351
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8352
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8353
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8354
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8355
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8356
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8357
handleAllEvents
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8358
    "from now on, handle any kind of event.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8359
     Always with win32."
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8360
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8361
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8362
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8363
handleExposeOnlyFor:aView
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8364
    "from now on, handle expose events only.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8365
     Never with win32."
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8366
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8367
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8368
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8369
mappingChanged:what event:eB
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8370
    "One of Keyboard-, Modifier- or PointerMap has change, probably by xmodmap.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8371
     Tell xlib about the fact."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8372
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8373
    (what == #mappingKeyboard or:[what == #mappingModifier]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8374
	self refreshKeyboardMapping:eB.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8375
	"Maybe some of our modifiers have been changed"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8376
	self initializeModifierMappings.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8377
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8378
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8379
    "Created: 1.12.1995 / 16:28:23 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8380
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8381
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8382
setEventMask:aMask in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8383
    "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
  8384
     is the bitwise or of the eventMask bits (see 'eventMaskFor:')"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8385
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8386
%{  /* NOCONTEXT */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8387
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8388
    if (__isExternalAddress(aWindowId)
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8389
     && __isSmallInteger(aMask)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8390
	HWND hWnd = _HWNDVal(aWindowId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8391
	int mask = __intVal(aMask);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8392
	localWindowInfo *lI;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8393
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8394
	if (lI = GETLOCALWINDOWINFOPTR(hWnd)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8395
	    DPRINTF(("new eventMask %x\n",mask));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8396
#ifdef DEBUGMASK
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8397
	    PRINTF(("new eventMask %x\n",mask));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8398
	    printMask(mask);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8399
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8400
	    lI->eventMask = mask;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8401
	    RETURN ( self );
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8402
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8403
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8404
%}.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8405
    self primitiveFailed
2232
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
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8408
!WinWorkstation methodsFor:'event sending'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8409
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8410
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
  8411
    "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
  8412
     TypeSymbol must be one of: #keyPress, #keyRelease, #buttonPress , #buttonRelease.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8413
     For buttonEvents, the keySymCodeOrButtonNr must be the buttons number (1, 2 ...);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8414
     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
  8415
     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
  8416
     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
  8417
     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
  8418
     (not very user friendly)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8419
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8420
    ^ false
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
simulateKeyboardInput:aCharacterOrString inViewId:viewId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8424
    "send input to some other view, by simulating keyPress/keyRelease
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8425
     events.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8426
     Only a few control characters are supported.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8427
     Notice: not all alien views allow this kind of synthetic input;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8428
	     some simply ignore it."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8429
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8430
    |control code state|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8431
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8432
    aCharacterOrString isString ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8433
	aCharacterOrString do:[:char |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8434
	    self simulateKeyboardInput:char inViewId:viewId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8435
	].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8436
	^ self
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8437
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8438
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8439
    control := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8440
    code := aCharacterOrString asciiValue.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8441
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8442
    (aCharacterOrString == Character cr) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8443
	code := #Return
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8444
    ] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8445
	(aCharacterOrString == Character tab) ifTrue:[
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8446
	    code := #Tab
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8447
	] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8448
	    (aCharacterOrString == Character esc) ifTrue:[
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8449
		code := #Escape
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8450
	    ]
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
    ].
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
    control ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8455
	state := self controlMask
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
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
    "/ the stuff below should not be needed 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8460
    "/ (sendKeyOrButtonevent should be able to figure out things itself)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8461
    "/ however, on some linux systems it seems to not work correctly.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8462
    "/ Hopefully, this is correct ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8463
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8464
    code isNumber ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8465
	code >= $A asciiValue ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8466
	    code <= $Z asciiValue ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8467
		state := self shiftMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8468
	    ]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8469
	]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8470
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8471
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8472
    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
  8473
    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
  8474
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8475
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8476
      sending input to some (possibly alien) view:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8477
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8478
      |point id|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8479
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8480
      point :=  Display pointFromUser.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8481
      id := Display viewIdFromPoint:point.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8482
      Display simulateKeyboardInput:'Hello_world' inViewId:id
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8483
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8484
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8485
    "Modified: 11.6.1996 / 10:59:42 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8486
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8487
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8488
!WinWorkstation methodsFor:'font stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8489
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8490
createFontFor:aFontName
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8491
    "a basic method for font allocation; this method allows
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8492
     any font to be aquired (even those not conforming to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8493
     standard naming conventions, such as cursor, fixed or k14)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8494
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8495
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8496
    HGDIOBJ hFont;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8497
    char *fn;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8498
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8499
    if (__isString(aFontName) || __isSymbol(aFontName)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8500
	fn = __stringVal(aFontName);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8501
	if ((strcmp(fn, "fixed") == 0) || (strcmp(fn, "ANSI_FIXED_FONT") == 0)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8502
	    hFont = GetStockObject(ANSI_FIXED_FONT);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8503
	} else if ((strcmp(fn, "variable") == 0) || (strcmp(fn, "ANSI_VAR_FONT") == 0)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8504
	    hFont = GetStockObject(ANSI_VAR_FONT);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8505
	} else if ((strcmp(fn, "system") == 0) || (strcmp(fn, "SYSTEM_FONT") == 0)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8506
	    hFont = GetStockObject(SYSTEM_FONT);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8507
	} else if ((strcmp(fn, "systemFixed") == 0) || (strcmp(fn, "SYSTEM_FIXED_FONT") == 0)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8508
	    hFont = GetStockObject(SYSTEM_FIXED_FONT);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8509
	} else if ((strcmp(fn, "deviceDefault") == 0) || (strcmp(fn, "DEVICE_DEFAULT_FONT") == 0)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8510
	    hFont = GetStockObject(DEVICE_DEFAULT_FONT);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8511
	} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8512
	    hFont = GetStockObject(ANSI_FIXED_FONT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8513
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8514
	if (hFont) {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8515
	    DPRINTF(("createFontFor:aFontName: %s -> %x\n", fn, hFont));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8516
	    RETURN ( __MKOBJ(hFont) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8517
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8518
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8519
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8520
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8521
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8522
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8523
fontMetricsOf:fontId into:aBlock
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8524
    "evaluate aBlock, passing a fonts metrics as arguments"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8525
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8526
    |data|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8527
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8528
    data := Array new:10.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8529
    (self primFontMetricsOf:fontId intoArray:data) isNil ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8530
	self primitiveFailed.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8531
	^ self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8532
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8533
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8534
    aBlock value:#iso8859
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8535
	   value:(data at:1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8536
	   value:(data at:2)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8537
	   value:(data at:3)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8538
	   value:(data at:4)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8539
	   value:(data at:5)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8540
	   value:(data at:6)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8541
	   value:(data at:7)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8542
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8543
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8544
fontsInFamily:aFamilyName face:aFaceName filtering:filter
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8545
    "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
  8546
     On WinWorkStations there is curently Face
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8547
     But only thise matching filter (if nonNil)."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8548
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8549
    |allFonts fonts|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8550
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8551
    allFonts := self listOfAvailableFonts.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8552
    allFonts isNil ifTrue:[^ nil].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8553
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8554
    fonts := Set new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8555
    allFonts do:[:fntDescr |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8556
	(aFamilyName sameAs:(fntDescr family)) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8557
	    (filter isNil or:[filter value:fntDescr]) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8558
		fonts add:fntDescr
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8559
	    ]
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8560
	]
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8561
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8562
    ^ fonts
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8563
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8564
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8565
fontsInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8566
    "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
  8567
     on this display.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8568
     On WinWorkStations there is curently no style or Face
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8569
     But only those matching filter (if nonNIl)."
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8570
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8571
    |allFonts fonts|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8572
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8573
    allFonts := self listOfAvailableFonts.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8574
    allFonts isNil ifTrue:[^ nil].
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8575
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8576
    fonts := Set new.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8577
    allFonts do:[:fntDescr |
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8578
	(aFamilyName sameAs:(fntDescr family)) ifTrue:[
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8579
	    (filter isNil or:[filter value:fntDescr]) ifTrue:[
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8580
		fonts add:fntDescr
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8581
	    ]
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8582
	]
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8583
    ].
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8584
    ^ fonts
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8585
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8586
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8587
fullNameOf:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8588
    "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
  8589
     used for user feed-back (for example: in the fontPanel).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8590
     If the display/font do not provide that info, return nil."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8591
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8592
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8593
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8594
getAvailableFontsMatching:pattern
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8595
    "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
  8596
    self halt.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8597
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8598
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8599
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8600
getDefaultFont
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8601
    "return a default font id - used when class Font cannot
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8602
     find anything usable"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8603
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8604
     ^ self createFontFor:'fixed'
2232
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
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8607
getFontWithFamily:familyString face:faceString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8608
	    style:styleArgString size:sizeArg encoding:encodingSym
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8609
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8610
    "try to get the specified font, if not available, try the next smaller
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8611
     font."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8612
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8613
    |styleString theName theId xlatedStyle id spacing|
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
    styleString := styleArgString.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8616
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8617
    "special: if face is nil, allow access to X-fonts"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8618
    faceString isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8619
	sizeArg notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8620
	    theName := familyString , '-' , sizeArg printString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8621
	] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8622
	    theName := familyString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8623
	].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8624
	theName isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8625
	    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8626
	     mhmh - fall back to the default font
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8627
	    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8628
	    theName := 'fixed'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8629
	].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8630
	theId := self createFontFor:theName.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8631
	theId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8632
	    theId := self getDefaultFont
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8633
	].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8634
	^ theId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8635
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8636
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8637
    "/ spacing other than 'normal' is contained as last component
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8638
    "/ in style
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8639
    styleString notNil ifTrue:[
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8640
	((styleString endsWith:'-narrow')
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8641
	 or:[styleString endsWith:'-semicondensed']) ifTrue:[
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8642
	    |i|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8643
	    i := styleString lastIndexOf:$-.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8644
	    spacing := styleString copyFrom:(i+1).
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8645
	    styleString := styleString copyTo:(i-1).
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8646
	] ifFalse:[
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8647
	    spacing := 'normal'.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8648
	].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8649
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8650
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8651
    xlatedStyle := styleString.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8652
    xlatedStyle notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8653
	xlatedStyle := xlatedStyle first asString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8654
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8655
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8656
    id := self
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8657
	    getFontWithFoundry:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8658
	    family:familyString asLowercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8659
	    weight:faceString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8660
	    slant:xlatedStyle
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8661
	    spacing:spacing
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8662
	    pixelSize:nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8663
	    size:sizeArg
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8664
	    registry:encodingSym
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8665
	    encoding:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8666
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8667
    id isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8668
	(encodingSym notNil and:[encodingSym ~= '*']) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8669
	    "/ too stupid: encodings come in both cases
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8670
	    "/ and X does not ignore case
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8671
	    "/
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8672
	    id := self
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8673
		    getFontWithFoundry:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8674
		    family:familyString asLowercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8675
		    weight:faceString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8676
		    slant:xlatedStyle
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8677
		    spacing:spacing
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8678
		    pixelSize:nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8679
		    size:sizeArg
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8680
		    registry:encodingSym asUppercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8681
		    encoding:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8682
	    id isNil ifTrue:[
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8683
		id := self
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8684
			getFontWithFoundry:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8685
			family:familyString asLowercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8686
			weight:faceString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8687
			slant:xlatedStyle
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8688
			spacing:spacing
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8689
			pixelSize:nil
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8690
			size:sizeArg
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8691
			registry:encodingSym asLowercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8692
			encoding:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8693
	    ]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8694
	]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8695
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8696
    ^ id
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8697
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8698
    "Modified: 24.2.1996 / 22:37:24 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8699
    "Modified: 4.7.1996 / 11:38:47 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8700
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8701
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8702
getFontWithFoundry:foundry family:family weight:weight
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8703
	      slant:slant spacing:spc pixelSize:pSize size:size
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8704
	      registry:registry encoding:encoding
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8705
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8706
    "get the specified font, if not available, return nil.
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8707
     For now, this is a poor (incomplete) emulation of the X code ...
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8708
     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
  8709
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8710
     foundry:   'adobe', 'misc', 'dec', 'schumacher' ... usually '*'
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8711
     family:    'helvetica' 'courier' 'times' ...
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8712
     weight:    'bold' 'medium' 'demi' ...
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8713
     slant:     'r(oman)' 'i(talic)' 'o(blique)'
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8714
     spacing:   'narrow' 'normal' semicondensed' ... usually '*'
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8715
     pixelSize: 16,18 ... usually left empty
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8716
     size:      size in point (1/72th of an inch)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8717
     registry:  iso8859, sgi ... '*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8718
     encoding:  vendor specific encoding (usually '*')
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8719
    "
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8720
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8721
    "
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8722
     Windows-NT/95 allows the creation of a font with the following parameters
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8723
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8724
	nHeight
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8725
	nWidth
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8726
	nEscapement
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8727
	nOrientation
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8728
	fnWeight        FW_DONTCARE, FW_NORMAL, FW_MEDIUM, FW_BOLD, ...
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8729
	fdwItalic       TRUE or FALSE
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8730
	fdwUnderline    TRUE or FALSE
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8731
	fdwStrikeOut    TRUE or FALSE
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8732
	fdwCharSet      ANSI_CHARSET, UNICODE_, SYMBOL_, SHIFTJIS_,...
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8733
	fdwOutputPrecision      DEFAULT, STRING, CHAR, ...
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8734
	fdwClipPrecision        DEFAULT, CHAR, STROKE, MASK, ...
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8735
	fdwQuality      DEFAULT, DRAFT, or PROOF.
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8736
	fdwPitchAndFamily
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8737
		DEFAULT, FIXED or VARIABLE pitch
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8738
		DECORATIVE, DONTCASE, MODERN, ROMAN, SCRIPT, or SWISS.
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8739
	lpszFace
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8740
		Typeface Name
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8741
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8742
      These two above descriptions will be matched as follows:
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8743
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8744
	foundry   - ignored
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8745
	family    - mapped to type face name.
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8746
	weight    - mapped to fnWeight
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8747
	slant     - used for style
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8748
	spacing   - NOT USED INITIALLY
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8749
	pixelSize - NOT USED INITIALLY
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8750
	size      - mapped to nHeight
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8751
	registry  - NOT USED INITIALLY
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8752
	encoding  - NOT USED INITIALLY used for dwType device, raster or truetype
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8753
     "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8754
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8755
%{  /* xxLIMITEDSTACK (WIN95 only) */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8756
    HGDIOBJ hFont;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8757
    int  nHeight, nWidth, nEscapement, nOrientation;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8758
    char* work;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8759
    char* work2;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8760
    DWORD fnWeight;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8761
    DWORD fdwItalic;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8762
    DWORD fdwUnderline;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8763
    DWORD fdwStrikeOut;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8764
    DWORD fdwCharSet;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8765
    DWORD fdwOutputPrecision;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8766
    DWORD fdwClipPrecision;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8767
    DWORD fdwQuality;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8768
    DWORD fdwPitchAndFamily;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8769
    LPCTSTR lpszFace;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8770
    static char temp[33];
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8771
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8772
/* INITIALIZE */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8773
    strcpy( temp, "                           " );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8774
    lpszFace = &temp[0];
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8775
    strcpy( (char *)lpszFace, "NULL" );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8776
    nHeight  = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8777
    nWidth   = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8778
    nEscapement = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8779
    nOrientation = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8780
    fnWeight = FW_NORMAL;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8781
    fdwItalic = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8782
    fdwUnderline = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8783
    fdwStrikeOut = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8784
    fdwCharSet   = ANSI_CHARSET;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8785
    fdwOutputPrecision = OUT_DEFAULT_PRECIS;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8786
    fdwClipPrecision   = CLIP_DEFAULT_PRECIS;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8787
    fdwQuality         = DEFAULT_QUALITY;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8788
    fdwPitchAndFamily  = FF_DONTCARE;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8789
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8790
/* SET VALUES */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8791
    if ( __isString( family ) ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8792
	work = __stringVal( family );
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8793
	if (strcmp( work, "nil" ) != 0 ) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8794
	    strncpy( (char *)lpszFace, work, 32 );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8795
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8796
    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8797
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8798
    fnWeight = FW_MEDIUM;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8799
    if( __isString( weight ) ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8800
	work = __stringVal( weight );
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8801
	if (strcmp( work, "bold" ) == 0 ) {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8802
	    fnWeight = FW_BOLD;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8803
	} else {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8804
	    if (strcmp( work, "medium" ) == 0 ) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8805
		fnWeight = FW_MEDIUM;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8806
	    } else {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8807
		if (strcmp( work, "demi" ) == 0 )
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8808
		    fnWeight = FW_LIGHT;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8809
	    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8810
	}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8811
    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8812
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8813
    if(__isSmallInteger( size )) {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8814
	nHeight = __intVal( size );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8815
    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8816
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8817
    if (__isString(slant)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8818
	work2 = __stringVal( slant );
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8819
	work  = __stringVal( slant );
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8820
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8821
	if (strncmp( work2, "italic", 6 ) == 0 ) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8822
	    fdwItalic = TRUE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8823
	    if ( work2[6] = '-' )
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8824
		strncpy( work, &work2[7], ( strlen( work2 ) - 7 ) );
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8825
	}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8826
	if (strncmp( work, "underline", 9 ) == 0 ) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8827
	    fdwUnderline = TRUE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8828
	    if( work[10] == '-' )
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8829
		strncpy( work2, &work[11], ( strlen( work ) - 10 ) );
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8830
	}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8831
	if (strncmp( work2, "strikeOut", 9 ) == 0 ) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8832
	    fdwStrikeOut = TRUE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8833
	}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8834
    }
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8835
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8836
    nHeight = -MulDiv(nHeight, __logPixelSY, 72);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8837
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8838
    DPRINTF(("CreateFont %s h=%d\n",lpszFace,nHeight));
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8839
    hFont = CreateFont( nHeight,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8840
			nWidth,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8841
			nEscapement,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8842
			nOrientation,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8843
			fnWeight,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8844
			fdwItalic,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8845
			fdwUnderline,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8846
			fdwStrikeOut,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8847
			fdwCharSet,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8848
			fdwOutputPrecision,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8849
			fdwClipPrecision,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8850
			fdwQuality,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8851
			fdwPitchAndFamily,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8852
			lpszFace );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8853
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8854
    if( hFont != NULL ) {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8855
	DPRINTF(("createFontWithFoundry: %x\n", hFont));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8856
#ifdef COUNT_RESOURCES
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8857
	__cnt_font++;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8858
	RES1PRINTF(("CreateFont %d\n",__cnt_font));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8859
#endif
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8860
	RETURN ( __MKOBJ(hFont) );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8861
    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8862
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8863
    DPRINTF(("***** ERROR createFontWithFoundry failed ERROR *****\n" ));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8864
%}.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8865
    ^ nil
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8866
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8867
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8868
     Display getFontWithFoundry:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8869
			 family:'courier'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8870
			 weight:'medium'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8871
			  slant:'r'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8872
			spacing:nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8873
		      pixelSize:nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8874
			   size:13
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8875
		       registry:'iso8859'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8876
		       encoding:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8877
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8878
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8879
    "new NT Version: 20.2.1997 / 22:33:29 / dq"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8880
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8881
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8882
listOfAvailableFonts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8883
    "return a list with all available fonts on this display.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8884
     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
  8885
     next time. The elements of the returned collection are instances of
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8886
     FontDescription."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8887
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8888
    |list typeFaceList|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8889
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8890
    listOfFonts notNil ifTrue:[^ listOfFonts].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8891
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8892
    list := OrderedCollection new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8893
    typeFaceList := OrderedCollection new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8894
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8895
    [
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8896
      self primEnumFontTypesInto:typeFaceList.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8897
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8898
      "/Transcript showCR:typeFaceList.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8899
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8900
      typeFaceList do:[:typeFace |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8901
	  self primEnumFontsIn:typeFace into:list.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8902
	  0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8903
      ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8904
    ] valueUninterruptably.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8905
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8906
    "/Transcript showCR:list.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8907
    listOfFonts := list
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8908
		       collect:[:anArray |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8909
			| fntDescr family face style size encoding |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8910
			family := anArray at:14.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8911
			face   := anArray at:5.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8912
			style  := anArray at:16.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8913
			size   := anArray at:1.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8914
			encoding := anArray at:15.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8915
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8916
			fntDescr := FontDescription
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8917
					family:family
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8918
					face:face
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8919
					style:style
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8920
					size:size
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8921
					encoding:encoding.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8922
			fntDescr
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8923
		       ].
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8924
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8925
    ^ listOfFonts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8926
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8927
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8928
     Display listOfAvailableFonts.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8929
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8930
     Display getAvailableFontsMatching:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8931
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8932
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8933
    "Modified: 27.9.1995 / 10:54:47 / stefan"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8934
    "Modified: 17.4.1996 / 15:27:57 / cg"
2232
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
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8937
primEnumFontTypesInto:typeFaceList
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8938
%{      /* xxLIMITEDSTACK (WIN95) */
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8939
    if (__tmpDC) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8940
	if ( EnumFontFamilies( __tmpDC, NULL, EnumFPTypeFaceProc, (DWORD)&(typeFaceList))) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8941
	    DPRINTF(("EnumFonts successful\n"));
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8942
	}
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8943
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8944
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8945
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8946
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8947
primEnumFontsIn:typeFace into:fontList
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8948
%{      /* xxLIMITEDSTACK (WIN95) */
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8949
    char *cp;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8950
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8951
    if (__isString(typeFace)) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8952
	if (__tmpDC) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8953
	    if (EnumFontFamilies(__tmpDC, __stringVal(typeFace), EnumFontsProc, (DWORD)&(fontList))) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8954
		DPRINTF(("EnumFonts Successful\n"));
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8955
	    }
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8956
	}
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8957
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8958
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8959
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8960
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8961
primFontMetricsOf:fontId intoArray:data
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8962
    "evaluate aBlock, passing a fonts metrics as arguments"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8963
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8964
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8965
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8966
    if (__isExternalAddress(fontId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8967
	SIZE size;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8968
	int avgWidth;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8969
	HGDIOBJ hFont;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8970
	HGDIOBJ prevFont;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8971
	TEXTMETRIC tmet;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8972
	static char *s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8973
	static int len;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8974
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8975
	hFont = _HGDIOBJVal(fontId);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8976
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8977
	/*
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8978
	 * temporarily set this font in the root context
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8979
	 */
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8980
	prevFont = SelectObject(__tmpDC, hFont);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8981
	GetTextMetrics(__tmpDC, &tmet);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8982
	if (len == 0) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8983
	    len = strlen(s);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8984
	}
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8985
	GetTextExtentPoint32(__tmpDC, s, len, &size);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8986
	SelectObject(__tmpDC, prevFont);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8987
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  8988
	avgWidth = (size.cx / (len / 2) + 1) / 2;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8989
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8990
	__ArrayInstPtr(data)->a_element[0] = __MKSMALLINT(tmet.tmAscent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8991
	__ArrayInstPtr(data)->a_element[1] = __MKSMALLINT(tmet.tmDescent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8992
	__ArrayInstPtr(data)->a_element[2] = __MKSMALLINT(tmet.tmAscent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8993
	__ArrayInstPtr(data)->a_element[3] = __MKSMALLINT(tmet.tmDescent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8994
	__ArrayInstPtr(data)->a_element[4] = __MKSMALLINT(avgWidth);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8995
	__ArrayInstPtr(data)->a_element[5] = __MKSMALLINT(tmet.tmMaxCharWidth);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8996
	__ArrayInstPtr(data)->a_element[6] = __MKSMALLINT(avgWidth);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8997
	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
  8998
		    hFont, tmet.tmAscent, tmet.tmDescent, avgWidth, tmet.tmMaxCharWidth,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8999
		    tmet.tmAveCharWidth));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9000
	RETURN (self);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9001
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9002
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9003
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9004
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9005
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9006
releaseFont:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9007
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9008
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9009
    if (__isExternalAddress(aFontId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9010
	HGDIOBJ hFont = _HGDIOBJVal(aFontId);
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  9011
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  9012
	if (hFont) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9013
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9014
	    __cnt_font--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9015
	   RES1PRINTF(("DestroyFont %d\n",__cnt_font));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9016
#endif
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9017
	  _DeleteObject(hFont, __LINE__);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9018
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9019
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9020
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9021
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9022
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9023
sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9024
    "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
  9025
     on this display.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9026
     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
  9027
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9028
    |sizes|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9029
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9030
    sizes := super sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9031
    (sizes notNil and:[sizes includes:0]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9032
	"special: in X11R5 and above, size 0 means:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9033
	 there are scaled versions in all sizes available"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9034
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9035
	^ #(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
  9036
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9037
    ^ sizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9038
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9039
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9040
     Display sizesInFamily:'courier' face:'bold' style:'roman'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9041
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9042
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9043
    "Created: 27.2.1996 / 01:38:15 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9044
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9045
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9046
widthOf:aString from:index1 to:index2 inFont:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9047
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9048
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9049
    char *cp;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9050
    int len, n, i1, i2, l;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9051
    OBJ cls;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9052
    int nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9053
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9054
    if (__bothSmallInteger(index1, index2)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9055
     && __isExternalAddress(aFontId)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9056
     && __isNonNilObject(aString)) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9057
	HGDIOBJ hFont,prevFont;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9058
	SIZE tsize;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9059
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9060
	hFont = _HGDIOBJVal(aFontId);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9061
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9062
	i1 = __intVal(index1) - 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9063
	cls = __qClass(aString);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9064
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9065
	if (i1 >= 0) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9066
	    i2 = __intVal(index2) - 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9067
	    if (i2 < i1) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9068
		RETURN ( __MKSMALLINT( 0 ) );
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9069
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9070
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9071
	    cp = (char *) _stringVal(aString);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9072
	    l = i2 - i1 + 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9073
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9074
	    if ((cls == @global(String)) || (cls == @global(Symbol))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9075
		n = _stringSize(aString);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9076
		if (i2 < n) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9077
		    cp += i1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9078
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9079
		    prevFont = SelectObject(__tmpDC, hFont);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9080
		    GetTextExtentPoint32(__tmpDC, cp, l, &tsize);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9081
#ifdef SUPERDEBUG
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9082
		    if (__debug__) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9083
		      char buf[80];
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9084
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9085
		      GetTextFace(__tmpDC,80,buf);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9086
		      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
  9087
		    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9088
#endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9089
		    SelectObject(__tmpDC, prevFont);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9090
		    RETURN ( __MKSMALLINT(tsize.cx) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9091
		}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9092
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9093
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9094
	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9095
	    cp += nInstBytes;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9096
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9097
	    if (__isBytes(aString)) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9098
		n = __byteArraySize(aString) - nInstBytes;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9099
		if (i2 < n) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9100
		    cp += i1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9101
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9102
		    prevFont = SelectObject(__tmpDC, hFont);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9103
		    GetTextExtentPoint32(__tmpDC, cp, l, &tsize);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9104
#ifdef SUPERDEBUG
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9105
		    if (__debug__) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9106
		      char buf[80];
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9107
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9108
		      GetTextFace(__tmpDC,80,buf);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9109
		      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
  9110
		    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9111
#endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9112
		    SelectObject(__tmpDC, prevFont);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9113
		    RETURN ( __MKSMALLINT(tsize.cx) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9114
		}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9115
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9116
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9117
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9118
#undef NLOCALBUFFER
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9119
%}.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9120
"/  'no stringlen' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9121
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9122
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9123
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9124
!WinWorkstation methodsFor:'grabbing '!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9125
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9126
allowEvents:mode
2232
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
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9129
grabKeyboardIn:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9130
    "grab the keyboard"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9131
%{    
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9132
#ifdef NOT_YET_IMPLEMENTED
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9133
    if (__isExternalAddress(aWindowId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9134
      HWND hWnd = _HWNDVal(aWindowId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9135
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9136
      CPRINTF(("grabKeyboard in %x\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9137
    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9138
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9139
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9140
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9141
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9142
grabPointerIn:aWindowId withCursor:aCursorId pointerMode:pMode keyboardMode:kMode confineTo:confineId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9143
    "grap the pointer - return true if ok"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9144
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9145
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9146
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9147
	HWND hWnd = _HWNDVal(aWindowId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9148
	HCURSOR hCursor = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9149
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  9150
	if (__currentCapture != CAPTURE_NONE) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  9151
	    PostMessage(__currentPointerView, WM_THREADSETCAPTURE, 0, 0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9152
	    //ReleaseCapture();
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9153
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9154
#if 1
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9155
	/*
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9156
	 * place a special, invisible view above the root
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9157
	 */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9158
	if (hWnd == __rootWin) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9159
	    hWnd = __rootWinSpezial;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9160
	    ShowWindow(hWnd, SW_SHOWNOACTIVATE);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9161
	    //EnableWindow(hWnd,TRUE);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9162
	    SetWindowPos(hWnd, HWND_TOP,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  9163
			 0, 0, 0, 0, 
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  9164
			 SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  9165
			 | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9166
	    CPRINTF(("setRootCapture %x\n",hWnd));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9167
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9168
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9169
	if (__isExternalAddress(aCursorId)) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9170
	    hCursor = _HCURSORVal(aCursorId);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9171
	    CPRINTF(("grabPointerIn  SetCapture %x\n",hWnd));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9172
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9173
	PostMessage(hWnd, WM_THREADSETCAPTURE, (INT)hWnd, (INT)hCursor);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9174
	RETURN (true);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9175
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9176
%}.
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9177
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9178
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9179
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9180
ungrabKeyboard
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9181
    "release the keyboard"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9182
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9183
    activeKeyboardGrab := nil.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9184
%{    
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9185
#ifdef NOT_YET_IMPLEMENTED
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9186
    CPRINTF(("ungrabKeyboard\n"));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9187
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9188
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9189
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9190
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9191
ungrabPointer
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9192
    "release the pointer"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9193
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9194
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9195
    CPRINTF(("ungrabPointer 1\n"));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9196
    PostThreadMessage(_dispatchThreadId, WM_THREADSETCAPTURE, 0, 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9197
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9198
    activePointerGrab := nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9199
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9200
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9201
!WinWorkstation methodsFor:'graphic context stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9202
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9203
noClipIn:aWindowId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9204
    "disable clipping rectangle"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9205
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9206
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9207
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9208
    if (__isExternalAddress(aWindowId)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9209
     && __isExternalAddress(aGCId)) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9210
	struct gcData *gcData = _GCDATA(aGCId);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9211
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9212
	if (gcData->clipping != FALSE) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9213
	    gcData->clipping = FALSE;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9214
	    FLUSH_CACHED_DC(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9215
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9216
	RETURN (self);
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
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9219
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9220
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9221
setBackground:bgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9222
    "set background color to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9223
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9224
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9225
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9226
    if (__isExternalAddress(aGCId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9227
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9228
	COLORREF bgColor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9229
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9230
	bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9231
	if (bgColor != gcData->bgColor) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9232
	    gcData->bgColor = bgColor;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9233
	    if (lastGcData == gcData) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9234
		SetBkColor(gcData->_hDC, bgColor);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9235
		/*
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9236
		 * no need to flush pen - it does not depend upon
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9237
		 * the bg color
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9238
		 */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9239
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9240
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9241
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9242
	DDPRINTF(("setBackground: %x\n", bgColor));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9243
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9244
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9245
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9246
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9247
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9248
setBitmapMask:aBitmapId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9249
    "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
  9250
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9251
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9252
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9253
    if (__isExternalAddress(aGCId)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9254
	struct gcData *gcData = _GCDATA(aGCId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9255
	HBITMAP oldM;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9256
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9257
	oldM = gcData->hMask;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9258
	if (__isExternalAddress(aBitmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9259
	    gcData->hMask = _HBITMAPVAL(aBitmapId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9260
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9261
	    gcData->hMask = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9262
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9263
	if (oldM != gcData->hMask) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9264
	    FLUSH_CACHED_DC(gcData);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9265
	    DPRINTF(("masks set to %x\n",gcData->hMask));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9266
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9267
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9268
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9269
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9270
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9271
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  9272
setClipByChildren:aBool in:aWindowId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9273
    "enable/disable drawing into child views"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9274
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9275
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9276
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9277
    if (ISCONNECTED && __isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9278
	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
  9279
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9280
	if (gcData && gcData->hWnd) {
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9281
	    int newClip;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9282
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9283
	    newClip = (aBool == true) ? TRUE : FALSE;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9284
	    if (newClip != gcData->clipByChildren) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9285
		/* set/clear clip by children */
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9286
		gcData->clipByChildren = newClip;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9287
		FLUSH_CACHED_DC(gcData);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9288
	    }
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  9289
	} else {
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  9290
	    DPRINTF(("clipping by child failed - invalid win\n" ));
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  9291
	}
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  9292
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9293
%}.
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9294
    ^ self
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9295
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9296
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9297
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
  9298
    "clip to a rectangle"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9299
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9300
"
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9301
      p--w---
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9302
      |     |
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9303
      h     |  the clipping rectangle
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9304
      |     |
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9305
      -------
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9306
	  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
  9307
"
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9308
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9309
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9310
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9311
    if (  __isExternalAddress(aGCId)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9312
       && __bothSmallInteger(clipX, clipY)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9313
       && __bothSmallInteger(clipWidth, clipHeight) ) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9314
	struct gcData *gcData = _GCDATA(aGCId);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9315
	int cX, cY, cW, cH;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9316
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9317
	cX = __intVal(clipX);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9318
	cY = __intVal(clipY);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9319
	cW = __intVal(clipWidth);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9320
	cH = __intVal(clipHeight);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9321
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9322
	if ((gcData->clipping != TRUE)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9323
	 || (cX != gcData->clipX)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9324
	 || (cY != gcData->clipY)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9325
	 || (cW != gcData->clipW)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9326
	 || (cH != gcData->clipH)) {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9327
	    gcData->clipping = TRUE;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9328
	    gcData->clipX = cX; 
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9329
	    gcData->clipY = cY; 
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9330
	    gcData->clipW = cW; 
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9331
	    gcData->clipH = cH; 
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9332
	    FLUSH_CACHED_DC(gcData);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9333
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9334
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9335
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9336
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9337
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9338
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9339
setDashes:dashList dashOffset:offset in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9340
    "set line attributes"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9341
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9342
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9343
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9344
    if (__isExternalAddress(aGCId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9345
	PRINTF(("dashes not yet implemented\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9346
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9347
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9348
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9349
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9350
setFont:aFontId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9351
    "set font to be drawn in"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9352
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9353
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9354
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9355
    if (__isExternalAddress(aGCId)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9356
     && __isExternalAddress(aFontId))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9357
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9358
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9359
	HDC hDC;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9360
	HGDIOBJ prevFont, hFont;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9361
	TEXTMETRIC tmet;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9362
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9363
	hDC = _getDC(gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9364
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9365
	hFont = _HGDIOBJVal(aFontId);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9366
	if (gcData->hFont != hFont) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9367
	    gcData->hFont = hFont;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9368
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9369
	    prevFont = SelectObject(__tmpDC, hFont);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9370
	    GetTextMetrics(__tmpDC, &tmet);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9371
	    gcData->fontAscent = tmet.tmAscent;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9372
#ifdef SUPERDEBUG
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9373
	    if (__debug__) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9374
		char buf[80];
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9375
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9376
		GetTextFace(__tmpDC, 80, buf);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9377
		PRINTF(("setFont: %x %s\n", hFont, buf));
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9378
	    }
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9379
#endif
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9380
	    SelectObject(__tmpDC, prevFont);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9381
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9382
#if 0
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9383
	    _releaseDC(gcData);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9384
	    FLUSH_CACHED_DC(gcData);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9385
#else
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9386
	    if (lastGcData == gcData) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9387
		prevFont = SelectObject(gcData->_hDC, hFont);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9388
		if (! gcData->save_hFont) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9389
		    gcData->save_hFont = prevFont;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9390
		}
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9391
	    }
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9392
#endif
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9393
	    RETURN ( self );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9394
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9395
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9396
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9397
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9398
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9399
setForeground:fgColorIndex background:bgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9400
    "set foreground and background colors to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9401
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9402
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9403
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9404
    if (__isExternalAddress(aGCId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9405
	struct gcData *gcData = _GCDATA(aGCId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9406
	COLORREF fg, bg, oldFg, oldBg;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9407
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9408
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9409
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9410
	oldFg = gcData->fgColor;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9411
	oldBg = gcData->bgColor;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9412
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9413
	if ((fg != oldFg) || (bg != oldBg)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9414
	    gcData->fgColor = fg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9415
	    gcData->bgColor = bg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9416
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9417
	    if (lastGcData == gcData) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9418
		/* Pen only depends upon fg-color */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9419
		if (fg != oldFg) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9420
		    SetTextColor(gcData->_hDC, fg);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9421
		    FLUSH_CACHED_PEN(gcData);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9422
		}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9423
		if (bg != oldBg) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9424
		    SetBkColor(gcData->_hDC, bg);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9425
		}
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9426
		FLUSH_CACHED_BRUSH(gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9427
	    }
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9428
	    DDPRINTF(("setForeground: %x background: %x\n", gcData->fgColor, gcData->bgColor));
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9429
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9430
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9431
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9432
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9433
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9434
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9435
setForeground:fgColorIndex background:bgColorIndex mask:aBitmapId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9436
    "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
  9437
     solid (if aBitmapId is nil)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9438
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9439
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9440
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9441
    if (__isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9442
	struct gcData *gcData = _GCDATA(aGCId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9443
	COLORREF fg, bg, oldFg, oldBg;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9444
	HBITMAP m, oldM;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9445
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9446
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9447
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9448
	if (__isExternalAddress(aBitmapId))
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9449
	    m = _HBITMAPVAL(aBitmapId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9450
	else
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9451
	    m = 0;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9452
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9453
	oldFg = gcData->fgColor;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9454
	oldBg = gcData->bgColor;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9455
	oldM = gcData->hMask;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9456
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9457
	if ((oldFg != fg) || (oldBg != bg) || (oldM != m)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9458
	    gcData->fgColor = fg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9459
	    gcData->bgColor = bg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9460
	    gcData->hMask = m;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9461
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9462
	    if (lastGcData == gcData) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9463
		if (oldM == m) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9464
		    /*
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9465
		     * only fg/bg changed
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9466
		     */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9467
		    /* Pen only depends upon fg-color */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9468
		    if (fg != oldFg) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9469
			SetTextColor(gcData->_hDC, fg);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9470
			FLUSH_CACHED_PEN(gcData);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9471
		    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9472
		    if (bg != oldBg) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9473
			SetBkColor(gcData->_hDC, bg);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9474
		    }
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9475
		    FLUSH_CACHED_BRUSH(gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9476
		} else {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9477
		    FLUSH_CACHED_DC(gcData);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9478
		}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9479
	    }
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9480
	    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
  9481
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9482
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9483
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9484
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9485
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9486
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9487
setForeground:fgColorIndex background:bgColorIndex mask:aBitmapId lineWidth:aLineWidth in:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9488
    "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
  9489
     solid (if aBitmapId is nil); also set lineWidth"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9490
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9491
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9492
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9493
    if (__isExternalAddress(aGCId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9494
	struct gcData *gcData = _GCDATA(aGCId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9495
	COLORREF fg, bg, oldFg, oldBg;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9496
	HBITMAP m, oldM;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9497
	int lw, oldLw;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9498
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9499
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9500
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9501
	if (__isExternalAddress(aBitmapId))
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9502
	    m = _HBITMAPVAL(aBitmapId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9503
	else
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9504
	    m = 0;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9505
	lw = __intVal(aLineWidth);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9506
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9507
	oldFg = gcData->fgColor;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9508
	oldBg = gcData->bgColor;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9509
	oldLw = gcData->lineWidth;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9510
	oldM = gcData->hMask;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9511
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9512
	if ((oldFg != fg) || (oldBg != bg)
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9513
	 || (oldLw != lw) || (oldM != m)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9514
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9515
	    gcData->fgColor = fg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9516
	    gcData->bgColor = bg;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9517
	    gcData->lineWidth = lw;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9518
	    gcData->hMask = m;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9519
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9520
	    if (lastGcData == gcData) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9521
		if (oldM == m) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9522
		    if (oldLw == lw) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9523
			/*
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9524
			 * only fg/bg changed
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9525
			 */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9526
			/* Pen only depends upon fg-color */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9527
			if (fg != oldFg) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9528
			    SetTextColor(gcData->_hDC, fg);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9529
			    FLUSH_CACHED_PEN(gcData);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9530
			}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9531
			if (bg != oldBg) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9532
			    SetBkColor(gcData->_hDC, bg);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9533
			}
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9534
			FLUSH_CACHED_BRUSH(gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9535
		    } else {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9536
			FLUSH_CACHED_DC(gcData);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9537
		    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9538
		} else {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9539
		    FLUSH_CACHED_DC(gcData);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9540
		}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9541
	    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9542
	    DDPRINTF(("setForeground: %x background: %x mask: %x linewidth: %d\n", 
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9543
			gcData->fgColor, gcData->bgColor,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9544
			gcData->hMask, gcData->lineWidth));
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9545
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9546
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9547
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9548
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9549
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9550
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9551
setForeground:fgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9552
    "set foreground color to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9553
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9554
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9555
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9556
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9557
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9558
    if (__isExternalAddress(aGCId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9559
	struct gcData *gcData = _GCDATA(aGCId);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9560
	COLORREF fg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9561
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9562
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9563
	if (fg != gcData->fgColor) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9564
	    gcData->fgColor = fg;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9565
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9566
	    if (lastGcData == gcData) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9567
		/* Pen depends upon fg-color */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9568
		SetTextColor(gcData->_hDC, fg);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9569
		FLUSH_CACHED_PEN(gcData);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9570
		FLUSH_CACHED_BRUSH(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9571
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9572
	    DDPRINTF(("setForeground: %x\n", gcData->fgColor));
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9573
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9574
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9575
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9576
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9577
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9578
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9579
setFunction:aFunctionSymbol in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9580
    "set alu function to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9581
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9582
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9583
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9584
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9585
    if (__isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9586
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9587
	int fun = -1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9588
	int bfun = -1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9589
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9590
	if (aFunctionSymbol == @symbol(copy)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9591
	    fun = R2_COPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9592
	    bfun = BITBLT_COPY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9593
	} else if (aFunctionSymbol == @symbol(copyInverted)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9594
	    fun = R2_NOTCOPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9595
	    bfun = BITBLT_COPYINVERTED;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9596
	} else if (aFunctionSymbol == @symbol(xor)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9597
	    fun = R2_XORPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9598
	    bfun = BITBLT_XOR;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9599
	} else if (aFunctionSymbol == @symbol(and)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9600
	    fun = R2_MASKPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9601
	    bfun = BITBLT_AND;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9602
	} else if (aFunctionSymbol == @symbol(or)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9603
	    fun = R2_MERGEPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9604
	    bfun = BITBLT_OR;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9605
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9606
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9607
	if (fun != -1) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9608
#if 0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9609
	    printf("set func to");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9610
	    switch (bfun) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9611
		case BITBLT_COPY:
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9612
		    printf("BITBLT_COPY\n");
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9613
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9614
		case BITBLT_COPYINVERTED:
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9615
		    printf("BITBLT_COPYINVERTED\n");
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9616
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9617
		case BITBLT_XOR:
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9618
		    printf("BITBLT_XOR\n");
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9619
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9620
		case BITBLT_AND:
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9621
		    printf("BITBLT_AND\n");
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9622
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9623
		case BITBLT_OR:
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9624
		    printf("BITBLT_OR\n");
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9625
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9626
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9627
#endif
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9628
	} else {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9629
	    INFOPRINT( (stderr, "WinWorkstat [warning]: unsuported Rasterfunction\n") );
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9630
	    fun = R2_COPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9631
	    bfun = BITBLT_COPY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9632
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9633
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9634
	if ((fun != gcData->rop2)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9635
	 || (bfun != gcData->bitbltrop2)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9636
	    gcData->rop2 = fun;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9637
	    gcData->bitbltrop2 = bfun;
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9638
	    if (gcData == lastGcData) {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9639
		SetROP2(gcData->_hDC, fun);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9640
	    } else {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9641
		FLUSH_CACHED_DC(gcData);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9642
	    }
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9643
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9644
    } else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9645
	INFOPRINT((stderr, "WinWorkstation [warning]: Rasterfunction no GC\n"));
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9646
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9647
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9648
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9649
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9650
setGraphicsExposures:aBoolean in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9651
    "set or clear the graphics exposures flag"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9652
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9653
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9654
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9655
setLineWidth:aNumber style:lineStyle cap:capStyle join:joinStyle in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9656
    "set line attributes"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9657
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9658
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9659
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9660
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9661
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9662
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9663
     && __isSmallInteger(aNumber)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9664
	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
  9665
	int style;
1127
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
	gcData->lineWidth = __intVal(aNumber);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9668
	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
  9669
	    style = PS_SOLID;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9670
	} 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
  9671
	    style= PS_DASH;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  9672
	} 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
  9673
	    style= PS_DOT;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  9674
	} 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
  9675
	    style= PS_DASHDOT;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  9676
	} 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
  9677
	    style= PS_DASHDOTDOT;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9678
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9679
	    style= PS_SOLID;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9680
	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
  9681
	gcData->lStyle |= style;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9682
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9683
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9684
	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
  9685
	    style = PS_ENDCAP_ROUND;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9686
	} 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
  9687
	    style = PS_ENDCAP_SQUARE;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9688
	} 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
  9689
	    style = PS_ENDCAP_FLAT;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9690
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9691
	    style = PS_ENDCAP_FLAT;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9692
	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
  9693
	gcData->lStyle |= style;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9694
        
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9695
	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
  9696
	    style = PS_JOIN_BEVEL;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9697
	} 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
  9698
	    style = PS_JOIN_MITER;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9699
	} 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
  9700
	    style = PS_JOIN_ROUND;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9701
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9702
	    style = PS_JOIN_MITER;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9703
	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
  9704
	gcData->lStyle |= style;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9705
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9706
	FLUSH_CACHED_DC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9707
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9708
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9709
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9710
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9711
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9712
setMaskOriginX:orgX y:orgY in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9713
    "set the mask origin"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9714
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9715
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9716
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9717
    if (__isExternalAddress(aGCId)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9718
     && __bothSmallInteger(orgX,orgY)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9719
	struct gcData *gcData = _GCDATA(aGCId);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9720
	int oX, oY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9721
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9722
	oX = __intVal(orgX);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9723
	oY = __intVal(orgY);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9724
	if ((oX != gcData->maskOrgX)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9725
	 || (oY != gcData->maskOrgY)) {
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9726
	    gcData->maskOrgX = __intVal(orgX);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9727
	    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
  9728
	    FLUSH_CACHED_DC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9729
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9730
	RETURN (self);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9731
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9732
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9733
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9734
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9735
setPixmapMask:aPixmapId in:aGCId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9736
    "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
  9737
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9738
%{  /* xxLIMITEDSTACK (WIN95 only) */
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9739
    if (__isExternalAddress(aGCId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9740
	struct gcData *gcData = _GCDATA(aGCId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9741
	HBITMAP oldM;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9742
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9743
	oldM = gcData->hMask;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9744
	if (__isExternalAddress(aPixmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9745
	    gcData->hMask = _HBITMAPVAL(aPixmapId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9746
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  9747
	    gcData->hMask = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9748
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9749
	if (oldM != gcData->hMask) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9750
	    FLUSH_CACHED_DC(gcData);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9751
	    DPRINTF(("PixmapMasks set to %x\n",gcData->hMask));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9752
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9753
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9754
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9755
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9756
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9757
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9758
!WinWorkstation methodsFor:'initialize / release'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9759
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9760
close
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9761
    "close down the connection to the display"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9762
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9763
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9764
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9765
initializeDefaultValues
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9766
    focusMode := #activeWindow.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9767
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9768
    buttonTranslation := ButtonTranslation.
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9769
"/    multiClickTimeDelta := MultiClickTimeDelta.  "/ ignored - defined by preference-panel
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9770
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9771
    self initializeModifierMappings
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9772
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9773
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9774
initializeEventBuffer
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9775
    |sz|
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9776
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9777
%{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9778
    sz = __MKSMALLINT(sizeof(struct queuedEvent) + 100);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9779
%}.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9780
    eventBuffer isNil ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9781
	eventBuffer := ByteArray new:sz.
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
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9784
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9785
initializeFor:aDisplayName
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9786
    "initialize the receiver for a connection to an X-Server;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9787
     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
  9788
     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
  9789
     as hostname:number"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9790
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9791
    displayId notNil ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9792
	"/ already connected - trying to trick me ?
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9793
	^ self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9794
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9795
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9796
    displayId := self primInitializeFor:aDisplayName.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9797
    displayId isNil ifTrue:[^ self].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9798
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9799
    dispatching := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9800
    isSlow := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9801
    shiftDown := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9802
    ctrlDown := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9803
    metaDown := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9804
    altDown := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9805
    motionEventCompression := true.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9806
    buttonsPressed := 0.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9807
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9808
    self initializeScreenProperties.
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9809
    self initializeDeviceResourceTables.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9810
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9811
    self initializeDefaultValues.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9812
    self initializeEventBuffer.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9813
    self initializeSpecialFlags.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9814
    self initializeKeyboardMap.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9815
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9816
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9817
initializeModifierMappings
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9818
    shiftModifiers := #(#'Shift_L' #'Shift_R' #'Shift').
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9819
    ctrlModifiers := #(#'Ctrl_L' #'Ctrl_R' #'Ctrl').
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9820
    metaModifiers := #(#'Alt_L' #'Alt').
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9821
    altModifiers := #(#'Alt_R').
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9822
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9823
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9824
initializeScreenProperties
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9825
    super initializeScreenProperties.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9826
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9827
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
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
    int scr;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9830
    int maxRGBDepth;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9831
    int rgbRedMask, rgbGreenMask, rgbBlueMask;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9832
    int nvi, i;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9833
    char *type, *nm;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9834
    int dummy;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9835
    int mask, shift, nBits;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9836
    HDC _rootDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9837
    OBJ id;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9838
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9839
    if (firstInstance) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9840
	OSVERSIONINFO osvi;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9841
	WNDCLASS wc;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9842
	firstInstance = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9843
	DPRINTF(("first create - registerClass\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9844
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9845
	memset(&osvi, 0, sizeof(OSVERSIONINFO));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9846
	osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9847
	GetVersionEx (&osvi);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9848
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  9849
	if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) {
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  9850
	    __isWinNT = 1;
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  9851
	    __INST(isWin95) = false;
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  9852
	} else {
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  9853
	    __isWinNT = 0;
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  9854
	    __INST(isWin95) = true;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9855
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9856
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9857
	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
  9858
	wc.lpfnWndProc = (WNDPROC) MainWndProc;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9859
	wc.cbClsExtra = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9860
	wc.cbWndExtra = N_WINDOW_PRIVATE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9861
	wc.hInstance = (HANDLE) __getHInstance();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9862
	wc.hIcon = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9863
	wc.hCursor = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9864
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9865
	wc.hbrBackground = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9866
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9867
	wc.lpszMenuName =  NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9868
	wc.lpszClassName = app_name;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9869
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9870
	if (!RegisterClass(&wc)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9871
	    DPRINTF(("RegisterClass failed\n"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9872
    /*            return NULL;     */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9873
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9874
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9875
	wc.style = 0;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9876
	wc.lpfnWndProc = (WNDPROC) MainWndProc;// Root;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9877
	wc.cbClsExtra = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9878
	wc.cbWndExtra = N_WINDOW_PRIVATE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9879
	wc.hInstance = (HANDLE) __getHInstance();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9880
	wc.hIcon = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9881
	wc.hCursor = 0;
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
	wc.hbrBackground = GetStockObject(HOLLOW_BRUSH);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9884
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9885
	wc.lpszMenuName =  NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9886
	wc.lpszClassName = app_nameroot;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9887
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9888
	if (!RegisterClass(&wc)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9889
	    DPRINTF(("RegisterClass failed\n"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9890
    /*            return NULL;     */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9891
	}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9892
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9893
	hCreateEvent = CreateEvent(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9894
	    NULL,        /* no security attributes */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9895
	    FALSE,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9896
	    FALSE,
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9897
	    "CreateEvents");  /* name of mutex */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9898
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9899
	if (hCreateEvent == NULL) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9900
	    DPRINTF(("CreateEvent failed\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9901
/*            return NULL;     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9902
	}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9903
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9904
	hInputEvent = CreateEvent(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9905
	    NULL,        /* no security attributes */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9906
	    FALSE,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9907
	    FALSE,
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9908
	    "InputEvents");
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9909
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9910
	if (hInputEvent == NULL) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9911
	    DPRINTF(("InputEvent failed\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9912
/*            return NULL;     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9913
	}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9914
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9915
	hEventQMutex = CreateMutex(
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9916
	    NULL,                       /* no security attributes */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9917
	    FALSE,                      /* initially not owned */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9918
	    "EvQMutex");                /* name of mutex */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9919
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9920
	if (hEventQMutex == NULL) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9921
	    DPRINTF(("CreateMutex failed\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9922
/*            return NULL;     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9923
	}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9924
	DuplicateHandle(GetCurrentProcess(), 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9925
			hEventQMutex, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9926
			GetCurrentProcess(), 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9927
			&hEventQMutex, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9928
			DUPLICATE_SAME_ACCESS, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9929
			FALSE, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9930
			DUPLICATE_SAME_ACCESS);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9931
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9932
	hEventFreeListMutex = CreateMutex(
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9933
	    NULL,                       /* no security attributes */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9934
	    FALSE,                      /* initially not owned */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9935
	    "EvFMutex");                /* name of mutex */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9936
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9937
	if (hEventFreeListMutex == NULL) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9938
	    DPRINTF(("CreateMutex failed\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9939
/*            return NULL;     */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9940
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9941
	DuplicateHandle(GetCurrentProcess(), 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9942
			hEventFreeListMutex, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9943
			GetCurrentProcess(), 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9944
			&hEventFreeListMutex, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9945
			DUPLICATE_SAME_ACCESS, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9946
			FALSE, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9947
			DUPLICATE_SAME_ACCESS);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9948
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9949
	/*__setWaitInputEvent(waitInputEvent);*/
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9950
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  9951
#ifndef WIN32THREADS
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9952
	_masterThreadId = GetCurrentThreadId();
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9953
	DuplicateHandle(GetCurrentProcess(),
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9954
			GetCurrentThread(),
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9955
			GetCurrentProcess(),
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9956
			&_masterThread,
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9957
			DUPLICATE_SAME_ACCESS,
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9958
			FALSE,
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9959
			DUPLICATE_SAME_ACCESS);
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  9960
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9961
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  9962
	initqueue();
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9963
	__beginthread(dispatchThread, EVENT_THREAD_STACKSIZE, 0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9964
	{
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9965
	    DWORD dwWaitResult;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9966
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9967
	    dwWaitResult = WaitForSingleObject(
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9968
			    hCreateEvent,   /* handle of mutex */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9969
			    5000L);         /* time-out interval */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9970
	    if (dwWaitResult != WAIT_OBJECT_0) {
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9971
		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
  9972
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9973
	}
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9974
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9975
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9976
#if 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9977
    __rootDesk = OpenDesktop ("Desktop0", 0, FALSE, GENERIC_ALL);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9978
    if (!__rootDesk) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9979
	PRINTF(("OpenDesktop fail\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9980
	__rootDesk = CreateDesktop ("Desktop0", NULL,NULL,0,DESKTOP_WRITEOBJECTS,NULL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9981
	if (!__rootDesk) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9982
	    PRINTF(("CreateDesktop fail\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9983
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9984
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9985
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9986
    __rootWin = GetDesktopWindow();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9987
    __PROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9988
    id = __MKOBJ(__rootWin);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9989
    __UNPROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9990
    __INST(rootWin) = id; __STORE(self, id);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9991
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9992
    _rootDC = __rootDC = CreateDC("DISPLAY", NULL, NULL, NULL);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9993
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9994
    __tmpDC = CreateCompatibleDC(_rootDC);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9995
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9996
    __nullPen = GetStockObject(NULL_PEN);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9997
    __blackPen = GetStockObject(BLACK_PEN);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9998
    __whitePen = GetStockObject(WHITE_PEN);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9999
    __blackBrush = GetStockObject(BLACK_BRUSH);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10000
    __whiteBrush = GetStockObject(WHITE_BRUSH);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10001
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10002
    __PROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10003
    id = __MKOBJ(_rootDC);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10004
    __UNPROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10005
    __INST(rootDC) = id; __STORE(self, id);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10006
%}.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10007
    self initializeVariableScreenProperties.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10008
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10009
2604
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 10010
initializeSpecialFlags
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 10011
    "perform additional special server implementation flags"
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 10012
!
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 10013
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10014
initializeVariableScreenProperties
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10015
    "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
 10016
     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
 10017
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10018
%{
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10019
    int nvi, i, val, capabilities, planes, numcolors, numpens;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10020
    RECT rect;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10021
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10022
    multiClickTime = GetDoubleClickTime();
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10023
    DPRINTF(("multiClickTime = %d\n",multiClickTime));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10024
    __INST(multiClickTimeDelta) = __MKSMALLINT(multiClickTime);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10025
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10026
    GetWindowRect(__rootWin, &rect);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10027
    __INST(width) = __MKSMALLINT(rect.right - rect.left);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10028
    __INST(height) = __MKSMALLINT(rect.bottom - rect.top);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10029
    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
 10030
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10031
    __realDepth = GetDeviceCaps(__rootDC, BITSPIXEL);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10032
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10033
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10034
    __depth = 24;  /* its a hack */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10035
#else
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10036
    __depth = __realDepth;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10037
    if (__depth == 15)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10038
	__depth = 16;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10039
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10040
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10041
#if 0
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10042
    numcolors = GetDeviceCaps(__rootDC, NUMCOLORS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10043
    numpens = GetDeviceCaps(__rootDC, NUMPENS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10044
    planes = GetDeviceCaps(__rootDC, PLANES);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10045
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10046
    DPRINTF(("screen has %d planes\n", planes));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10047
    DPRINTF(("numcolors is %d\n", numcolors));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10048
    DPRINTF(("numpens is %d\n", numpens));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10049
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10050
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10051
    __INST(depth) = __MKSMALLINT(__depth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10052
    __INST(ncells) = __MKSMALLINT(1<<__depth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10053
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10054
    val = GetDeviceCaps(__rootDC, HORZSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10055
    DPRINTF(("HORSIZE=%d\n",val));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10056
    __INST(widthMM) = __MKSMALLINT(val);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10057
    val = GetDeviceCaps(__rootDC, VERTSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10058
    DPRINTF(("VERTSIZE=%d\n",val));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10059
    __INST(heightMM) = __MKSMALLINT(val);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10060
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10061
    __logPixelSY = GetDeviceCaps(__rootDC, LOGPIXELSY);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10062
    capabilities = GetDeviceCaps(__rootDC, RASTERCAPS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10063
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10064
#ifdef LATER
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10065
    printf("device support:\n");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10066
    if (capabilities & RC_BANDING)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10067
	printf(" RC_BANDING");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10068
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10069
    if (capabilities & RC_BITBLT)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10070
	printf(" RC_BITBLT");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10071
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10072
    if (capabilities & RC_BITMAP64)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10073
	printf(" RC_BITMAP64");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10074
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10075
    if (capabilities & RC_DI_BITMAP)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10076
	printf(" RC_DI_BITMAP");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10077
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10078
    if (capabilities & RC_DIBTODEV)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10079
	printf(" RC_DIBTODEV");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10080
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10081
    if (capabilities & RC_FLOODFILL)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10082
	printf(" RC_FLOODFILL");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10083
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10084
    if (capabilities & RC_PALETTE)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10085
	printf(" RC_PALETTE");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10086
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10087
    if (capabilities & RC_SCALING)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10088
	printf(" RC_SCALING");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10089
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10090
    if (capabilities & RC_STRETCHBLT)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10091
	printf(" RC_STRETCHBLT");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10092
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10093
    if (capabilities & RC_STRETCHDIB)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10094
	printf(" RC_STRETCHDIB");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10095
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10096
    printf("\n");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10097
    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
 10098
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10099
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10100
    __INST(whitepixel) = __MKSMALLINT(WhitePixel);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10101
    __INST(blackpixel) = __MKSMALLINT(BlackPixel);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10102
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10103
    __INST(monitorType) = @symbol(unknown);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10104
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10105
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10106
    __INST(hasColors) = true;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10107
    __INST(hasGreyscales) = true;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10108
    __INST(visualType) = @symbol(TrueColor);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10109
    __INST(redShift) = __MKSMALLINT(0);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10110
    __INST(greenShift) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10111
    __INST(blueShift) = __MKSMALLINT(16);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10112
    switch (__realDepth) {
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10113
	case 15:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10114
	case 16:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10115
	    __INST(bitsPerRGB) = __MKSMALLINT(5);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10116
	    break;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10117
	default:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10118
	    __INST(bitsPerRGB) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10119
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10120
    __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10121
    __INST(redMask) = __MKSMALLINT(0xFF);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10122
    __INST(greenMask) = __MKSMALLINT(0xFF00);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10123
    __INST(blueMask) = __MKSMALLINT(0xFF0000);
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 (! (capabilities & RC_PALETTE)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10126
	DPRINTF(("no palette\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10127
	if (__depth == 1) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10128
	    __INST(hasColors) = false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10129
	    __INST(hasGreyscales) = false;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10130
	    __INST(visualType) = @symbol(GrayScale);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10131
	    __INST(monitorType) = @symbol(monochrome);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10132
	} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10133
	    __INST(hasColors) = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10134
	    __INST(hasGreyscales) = true;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10135
	    if ((__depth == 16) || (__depth == 15)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10136
	      __INST(visualType) = @symbol(TrueColor);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10137
	      __INST(blueShift) = __MKSMALLINT(0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10138
	      __INST(greenShift) = __MKSMALLINT(5);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10139
	      __INST(redShift) = __MKSMALLINT(11);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10140
	      __INST(bitsPerRGB) = __MKSMALLINT(5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10141
	      __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10142
	      __INST(blueMask) = __MKSMALLINT(0x1f);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10143
	      __INST(greenMask) = __MKSMALLINT(0x7e0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10144
	      __INST(redMask) = __MKSMALLINT(0xf800);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10145
	    } else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10146
	      __INST(visualType) = @symbol(TrueColor);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10147
	      __INST(redShift) = __MKSMALLINT(0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10148
	      __INST(greenShift) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10149
	      __INST(blueShift) = __MKSMALLINT(16);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10150
	      __INST(bitsPerRGB) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10151
	      __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10152
	      __INST(redMask) = __MKSMALLINT(0xFF);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10153
	      __INST(greenMask) = __MKSMALLINT(0xFF00);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10154
	      __INST(blueMask) = __MKSMALLINT(0xFF0000);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10155
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10156
	}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10157
    } else {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10158
	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
 10159
	// printf("SizeofPalette %d\n",val);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10160
	__INST(ncells) = __MKSMALLINT(val);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10161
	__INST(blackpixel) = __MKSMALLINT(0);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10162
	__INST(whitepixel) = __MKSMALLINT(1);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10163
	__INST(hasColors) = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10164
	__INST(hasGreyscales) = true;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10165
	// __INST(usingSystemPalette) = true;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10166
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10167
	__INST(redShift) = __MKSMALLINT(0);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10168
	__INST(greenShift) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10169
	__INST(blueShift) = __MKSMALLINT(4);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10170
	__INST(bitsPerRGB) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10171
	__INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10172
	__INST(redMask) = __MKSMALLINT(0x3);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10173
	__INST(greenMask) = __MKSMALLINT(0xc); 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10174
	__INST(blueMask) = __MKSMALLINT(0x30);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10175
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10176
#endif /* ! ALWAYSTRUECOLOR */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10177
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10178
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10179
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10180
primInitializeFor:aDisplayName
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10181
    "initialize the receiver for a connection to a display;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10182
     the argument, aDisplayName may be nil (for the default display)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10183
     or the name of the display server as hostname:number
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10184
     (not yet under WIN32)"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10185
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10186
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10187
    RETURN ( __MKSMALLINT(1) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10188
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10189
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10190
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10191
reinitialize
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10192
    rootWin := rootDC := nil.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10193
    super reinitialize.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10194
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10195
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10196
!WinWorkstation methodsFor:'keyboard mapping'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10197
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10198
altModifierMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10199
    "return the mask (in motionEvents) for the alt-key modifier.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10200
     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
 10201
     therefore return a variable here, which can be changed during startup."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10202
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10203
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10204
    RETURN (__MKSMALLINT(AltMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10205
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10206
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10207
    "Created: 23.3.1996 / 12:43:22 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10208
    "Modified: 23.3.1996 / 12:44:56 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10209
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10210
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10211
leftAltMask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10212
    "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
 10213
     See comment in altModifierMask: / metaModifierMask: for what
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10214
     this could be used."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10215
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10216
%{  /* NOCONTEXT */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10217
    RETURN (__MKSMALLINT(LeftAltMask));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10218
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10219
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10220
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10221
metaModifierMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10222
    "return the mask (in motionEvents) for the meta-key modifier.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10223
     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
 10224
     therefore return a variable here, which can be changed during startup."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10225
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10226
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10227
    RETURN (__MKSMALLINT(MetaMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10228
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10229
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10230
    "Created: 23.3.1996 / 12:43:39 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10231
    "Modified: 23.3.1996 / 12:45:09 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10232
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10233
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10234
modifierMapping
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10235
    "Get the Modifier Mapping.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10236
     We return an array of arrays of keycodes"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10237
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10238
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10239
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10240
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10241
rightAltMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10242
    "return the mask bit for the right Alt modifier key.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10243
     See comment in altModifierMask: / metaModifierMask: for what
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10244
     this could be used."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10245
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10246
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10247
    RETURN (__MKSMALLINT(RightAltMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10248
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10249
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10250
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10251
stringFromKeycode:code
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10252
    "Get a KeySymbol (a smalltalk symbol) from the keycode."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10253
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10254
    ^ ''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10255
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10256
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10257
	Display stringFromKeycode:28
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10258
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10259
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10260
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10261
!WinWorkstation methodsFor:'misc'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10262
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10263
beep
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10264
    "output an audible beep"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10265
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
 10266
%{  
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
 10267
    MessageBeep( MB_ICONEXCLAMATION);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10268
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10269
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10270
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10271
flush
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10272
    "send all buffered drawing to the display.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10273
     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
 10274
     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
 10275
     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
 10276
     (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
 10277
     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
 10278
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10279
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10280
     GdiFlush();
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10281
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10282
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10283
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10284
refreshKeyboardMapping:eB
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10285
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10286
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10287
setInputFocusTo:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10288
    self setInputFocusTo:aWindowId revertTo:nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10289
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10290
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10291
setInputFocusTo:aWindowId revertTo:revertSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10292
    "set the focus to the view as defined by aWindowId.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10293
     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
 10294
     input until a new focus is set.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10295
     RevertSymbol specifies what should happen if the view becomes invisible;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10296
     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
 10297
     given to the parent view, the root view or no view."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10298
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10299
%{  /* xxLIMITEDSTACK (WIN95 only) */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10300
    if (__isExternalAddress(aWindowId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10301
	HWND hWnd = _HWNDVal(aWindowId);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 10302
	int r = 0;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10303
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10304
	if (revertSymbol == @symbol(parent)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10305
	    r = 1;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10306
	} else if (revertSymbol == @symbol(root)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10307
	    r = 2;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10308
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10309
	if (hWnd) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10310
	    if (GetFocus() != hWnd) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10311
		CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10312
#ifdef SET_FOCUS_IN_WINTHREAD
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10313
		PostMessage(hWnd, WM_THREADSETFOCUS, (INT)hWnd, GetCurrentThreadId());
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10314
#else
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10315
		if (SetFocus(hWnd) == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10316
		    PRINTF(("SetFocus to %x failed.\n",hWnd));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10317
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10318
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10319
	    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10320
		CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r));
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 10321
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10322
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10323
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10324
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10325
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10326
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10327
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10328
!WinWorkstation methodsFor:'pointer queries '!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10329
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10330
anyButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10331
    "return an integer for masking out any button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10332
     buttonStates value."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10333
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10334
    "/ should use ``Display buttonXMotionMask bitOr:....''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10335
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10336
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10337
    RETURN ( __MKSMALLINT(Button1Mask|Button2Mask|Button3Mask) );
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10338
%}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10339
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10340
    "Modified: 23.3.1996 / 12:41:33 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10341
    "Created: 23.3.1996 / 12:46:35 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10342
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10343
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10344
buttonStates
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10345
    "return an integer representing the state of the pointer buttons;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10346
     a one-bit in positions 0.. represent a pressed button.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10347
     See the button1Mask/button2Mask/button3Mask,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10348
     shiftMask/controlMask and modifierMask methods for the meaning of the bits."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10349
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10350
    |s |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10351
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10352
%{
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10353
    int modifiers = 0;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10354
    int b1m = Button1Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10355
    int b3m = Button3Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10356
    if (GetSystemMetrics(SM_SWAPBUTTON))
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10357
    {
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10358
      b3m = Button1Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10359
      b1m = Button3Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10360
    }
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10361
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10362
    if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10363
	modifiers |= b1m;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10364
    if (GetAsyncKeyState(VK_MBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10365
	modifiers |= Button2Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10366
    if (GetAsyncKeyState(VK_RBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10367
	modifiers |= b3m;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10368
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 10369
    s = __MKSMALLINT(modifiers);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10370
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10371
    ^ s
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10372
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10373
    "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10374
     Display buttonStates
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10375
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10376
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10377
    "is the control-key pressed ?
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10378
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10379
     Display buttonStates bitTest:(Display controlMask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10380
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10381
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10382
    "is the alt/meta-key pressed ?
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10383
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10384
     Display buttonStates bitTest:(Display altModifierMask)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10385
     Display buttonStates bitTest:(Display metaModifierMask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10386
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10387
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10388
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10389
leftButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10390
    "return an integer for masking out the left button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10391
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10392
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10393
    "/ should use ``Display button1MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10394
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10395
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10396
    RETURN ( __MKSMALLINT(Button1Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10397
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10398
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10399
    "Modified: 23.3.1996 / 12:41:33 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10400
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10401
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10402
middleButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10403
    "return an integer for masking out the middle button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10404
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10405
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10406
    "/ should use ``Display button2MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10407
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10408
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10409
    RETURN ( __MKSMALLINT(Button2Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10410
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10411
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10412
    "Modified: 23.3.1996 / 12:41:43 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10413
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10414
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10415
pointerPosition
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10416
    "return the current pointer position in root-window coordinates"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10417
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10418
%{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10419
    POINT p;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10420
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10421
    if (! GetCursorPos(&p)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10422
	p.x = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10423
	p.y = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10424
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10425
    RETURN (__MKPOINT_INT(p.x, p.y));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10426
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10427
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10428
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10429
rightButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10430
    "return an integer for masking out the right button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10431
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10432
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10433
    "/ should use ``Display button3MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10434
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10435
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10436
    RETURN ( __MKSMALLINT(Button3Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10437
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10438
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10439
    "Modified: 23.3.1996 / 12:41:52 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10440
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10441
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10442
rootPositionOfLastEvent
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10443
    "return the position in root-window coordinates
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10444
     of the last button, key or pointer event"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10445
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10446
%{
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10447
    RETURN (__MKPOINT_INT(evRootX, evRootY));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10448
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10449
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10450
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10451
setPointerPosition:newPosition
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10452
    "change the pointer position in root-window coordinates."
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10453
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10454
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10455
    if (__isPoint(newPosition)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10456
	OBJ xpos, ypos;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10457
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10458
	xpos = __point_X(newPosition);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10459
	ypos = __point_Y(newPosition);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10460
	if (__bothSmallInteger(xpos, ypos)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10461
	    SetCursorPos(__intVal(xpos), __intVal(ypos));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10462
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10463
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10464
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10465
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10466
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10467
setPointerPosition:newPosition in:aWindowId
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10468
    "change the pointer position to a new position relative to the
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10469
     given windows origin (which may be the rootWindow).
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10470
     Be careful with this - its usually not very ergonimically
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10471
     to change the mousePointer position.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10472
     This interface is provided for special applications (presentation
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10473
     playback) and should not be used in normal applications."
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10474
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10475
    self setCursorPosition:(self translatePoint:newPosition from:aWindowId to:rootView id).
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10476
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10477
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10478
!WinWorkstation methodsFor:'retrieving pixels'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10479
1461
6d8b022bfcd8 renamed getBitsFrom to getBitsFromId
Claus Gittinger <cg@exept.de>
parents: 1426
diff changeset
 10480
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
 10481
    "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
 10482
     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
 10483
     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
 10484
     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
 10485
     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
 10486
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10487
    |rawInfo info|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10488
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10489
    ((w <= 0) or:[h <= 0]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10490
	self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10491
	^ nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10492
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10493
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10494
    rawInfo := Array new:8.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10495
		  "1 -> bit order"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10496
		  "2 -> depth"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10497
		  "3 -> bytes_per_line"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10498
		  "4 -> byte_order"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10499
		  "5 -> format"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10500
		  "6 -> bitmap_unit"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10501
		  "7 -> bitmap_pad"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10502
		  "8 -> bits_per_pixel"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10503
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10504
    "/ 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
 10505
    "/ unlimitedStack (some implementations use alloca and require huge amounts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10506
    "/ of temporary stack space
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10507
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10508
    (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
 10509
	info := IdentityDictionary new.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10510
	info at:#bitOrder put:(rawInfo at:1).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10511
	info at:#depth put:(rawInfo at:2).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10512
	info at:#bytesPerLine put:(rawInfo at:3).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10513
	info at:#byteOrder put:(rawInfo at:4).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10514
	info at:#format put:(rawInfo at:5).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10515
	info at:#bitmapUnit put:(rawInfo at:6).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10516
	info at:#bitmapPad put:(rawInfo at:7).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10517
	info at:#bitsPerPixel put:(rawInfo at:8).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10518
	^ info
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10519
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10520
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10521
     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
 10522
     or is too small to hold the bits
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10523
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10524
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10525
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10526
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10527
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
 10528
    "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
 10529
     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
 10530
     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
 10531
     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
 10532
     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
 10533
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10534
    |rawInfo info|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10535
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10536
    ((w <= 0) or:[h <= 0]) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10537
	self primitiveFailed.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10538
	^ nil
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10539
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10540
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10541
    rawInfo := Array new:8.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10542
		  "1 -> bit order"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10543
		  "2 -> depth"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10544
		  "3 -> bytes_per_line"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10545
		  "4 -> byte_order"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10546
		  "5 -> format"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10547
		  "6 -> bitmap_unit"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10548
		  "7 -> bitmap_pad"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10549
		  "8 -> bits_per_pixel"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10550
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10551
    "/ 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
 10552
    "/ 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
 10553
    "/ of temporary stack space
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10554
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10555
    (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
 10556
	info := IdentityDictionary new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10557
	info at:#bitOrder put:(rawInfo at:1).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10558
	info at:#depth put:(rawInfo at:2).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10559
	info at:#bytesPerLine put:(rawInfo at:3).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10560
	info at:#byteOrder put:(rawInfo at:4).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10561
	info at:#format put:(rawInfo at:5).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10562
	info at:#bitmapUnit put:(rawInfo at:6).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10563
	info at:#bitmapPad put:(rawInfo at:7).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10564
	info at:#bitsPerPixel put:(rawInfo at:8).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10565
	^ info
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10566
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10567
    "
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10568
     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
 10569
     or is too small to hold the bits
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10570
    "
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10571
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10572
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10573
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10574
getPixelX:x y:y from:aDrawableId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10575
    "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
 10576
     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
 10577
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10578
    'getPixelX:y:from: not yet implemented' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10579
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10580
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10581
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10582
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
 10583
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10584
%{  /* xxLIMITEDSTACK */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10585
    int            height, width;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10586
    int            numBytes;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10587
    HWND        hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10588
    HBITMAP hBitmap = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10589
    HDC bDC = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10590
    struct
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10591
    {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10592
	BITMAPINFOHEADER bmiHeader;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10593
	DWORD r;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10594
	DWORD g;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10595
	DWORD b;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10596
    } bitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10597
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10598
    if (__isExternalAddress(aDrawableId)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10599
     && __bothSmallInteger(srcX, srcY)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10600
     && __bothSmallInteger(w, h)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10601
     && __isArray(info)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10602
     && __isByteArray(imageBits))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10603
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10604
	hWnd = _HWNDVal( aDrawableId );
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10605
	DPRINTF(("primGetBits %x\n",hWnd));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10606
	if( hWnd != 0 ) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10607
	    HDC wDC = GetDC(hWnd);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10608
	    bDC = CreateCompatibleDC(__rootDC);
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10609
	    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
 10610
	    height =  __intVal(h);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10611
	    width  =  __intVal(w);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10612
	    DPRINTF(("width %d height %d\n",width,height));
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
 10613
	    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
 10614
	    if (!hBitmap)
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10615
		goto fail;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10616
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10617
	    bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10618
	    bitmap.bmiHeader.biPlanes = 1;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10619
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10620
	    bitmap.bmiHeader.biCompression = BI_RGB;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10621
#else
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10622
	    if (__depth == 24) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10623
		bitmap.bmiHeader.biCompression = BI_RGB;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10624
	    } else if (__depth == 16) {
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10625
# if 0
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10626
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10627
		bitmap.b = 0x001f;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10628
		bitmap.g = 0x07e0;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10629
		bitmap.r = 0xf800;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10630
# else
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10631
		bitmap.b = 0;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10632
		bitmap.g = 0;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10633
		bitmap.r = 0;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10634
		bitmap.bmiHeader.biCompression = BI_RGB;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10635
# endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10636
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10637
#endif /* ALWAYSTRUECOLOR */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10638
	    bitmap.bmiHeader.biSizeImage = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10639
	    bitmap.bmiHeader.biXPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10640
	    bitmap.bmiHeader.biYPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10641
	    bitmap.bmiHeader.biClrUsed = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10642
	    bitmap.bmiHeader.biClrImportant = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10643
	    bitmap.bmiHeader.biBitCount = __depth;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10644
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
 10645
	    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
 10646
	    bitmap.bmiHeader.biHeight = -height;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10647
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10648
	    SelectObject(bDC,hBitmap);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10649
	    if (BitBlt(bDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10650
		   0,0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10651
		   width,height,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10652
		   wDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10653
		   __intVal(srcX), __intVal(srcY),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10654
		   SRCCOPY)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10655
		 == 0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10656
		)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10657
	    {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10658
		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
 10659
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10660
	    ReleaseDC(hWnd,wDC);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10661
	    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
 10662
	    {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10663
		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
 10664
		goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10665
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10666
	    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
 10667
	    numBytes = bitmap.bmiHeader.biSizeImage;
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10668
	    if( numBytes != 0 ) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10669
		char *cp = __ByteArrayInstPtr(imageBits)->ba_element;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10670
		int n = numBytes;
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10671
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10672
		if (numBytes > __byteArraySize(imageBits)) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10673
		    /* imageBits too small */
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10674
		    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
 10675
		    goto fail;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10676
		}
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10677
		DPRINTF(("numBytes %d\n",numBytes));
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10678
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10679
		bitmap.bmiHeader.biHeight = -height;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10680
		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
 10681
		{
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10682
		    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
 10683
		    goto fail;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10684
		}
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10685
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10686
		/* swap red and blue (windows delivers BGR) */
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10687
		for ( ;n > 0; n -= 3, cp += 3) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10688
		      char b = cp[0];
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10689
		      cp[0] = cp[2];
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10690
		      cp[2] = b;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10691
		}
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10692
	    } else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10693
		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
 10694
		goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10695
	    }
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10696
	} else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10697
	    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
 10698
	    goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10699
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10700
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10701
	__ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10702
	__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(1);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10703
	__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
 10704
	__ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10705
	__ArrayInstPtr(info)->a_element[4] = @symbol(XYPixmap);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10706
	__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10707
	__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(WIN32PADDING);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10708
	__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(bitmap.bmiHeader.biBitCount);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10709
	if (bDC)
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10710
	    DeleteDC(bDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10711
	if (hBitmap)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10712
	    _DeleteObject(hBitmap, __LINE__);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10713
	RETURN ( true );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10714
    }
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10715
fail: ;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10716
    if (bDC)
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 10717
	DeleteDC(bDC);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10718
    if (hBitmap)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10719
	_DeleteObject(hBitmap, __LINE__);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10720
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10721
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10722
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10723
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10724
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
 10725
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10726
%{  /* xxLIMITEDSTACK */
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10727
    int            height, width;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10728
    int            numBytes;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10729
    unsigned char* ep = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10730
    HBITMAP        xBitmap;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10731
    HBITMAP hBitmap = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10732
    HDC bDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10733
    HDC xDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10734
    struct
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10735
    {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10736
	BITMAPINFOHEADER bmiHeader;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10737
	DWORD rgb[2];
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10738
    } bitmap;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10739
    BITMAP bitmapInfo;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10740
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10741
    if (__isExternalAddress(aDrawableId)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10742
     && __bothSmallInteger(srcX, srcY)
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10743
     && __bothSmallInteger(w, h)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10744
     && __isArray(info)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10745
     && __isByteArray(imageBits))
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
	xBitmap = _HBITMAPVAL( aDrawableId );
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10748
	DPRINTF(("primGetBitsFromPixmap %x\n",xBitmap));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10749
	if( xBitmap != 0 )
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10750
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10751
	    xDC = GetDC(0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10752
	    SelectObject(xDC,xBitmap);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10753
	    GetObject(xBitmap,sizeof(bitmapInfo),&bitmapInfo);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10754
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10755
	    bDC = CreateCompatibleDC(__rootDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10756
	    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
 10757
	    height =  __intVal(h);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10758
	    width  =  __intVal(w);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10759
	    DPRINTF(("width %d height %d\n",width,height));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10760
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10761
	    hBitmap = CreateCompatibleBitmap(xDC,width,height);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10762
	    if (!hBitmap)
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10763
		goto fail;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10764
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10765
	    SelectObject(bDC,hBitmap);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10766
	    if (BitBlt(bDC,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10767
		   0,0,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10768
		   width,height,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10769
		   xDC,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10770
		   __intVal(srcX), __intVal(srcY),
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10771
		   SRCCOPY)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10772
		 == 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10773
		)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10774
	    {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10775
		 DPRINTF(("ERROR in primGetBitsFromPixmap: BitBlt\n"));
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10776
		 goto fail;
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
	    bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10779
	    bitmap.bmiHeader.biPlanes = 1;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10780
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10781
	    bitmap.bmiHeader.biCompression = BI_RGB;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10782
#else
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10783
	    if (__depth == 24) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10784
		/*bitmap.bmiHeader.biCompression = BI_BITFIELDS;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10785
		bitmap.r = 0xff0000;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10786
		bitmap.g = 0x00ff00;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10787
		bitmap.b = 0x0000ff;*/
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10788
		bitmap.bmiHeader.biCompression = BI_RGB;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10789
	    } else if (__depth == 16) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10790
		/*bitmap.bmiHeader.biCompression = BI_RGB;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10791
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10792
		bitmap.b = 0x001f;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10793
		bitmap.g = 0x07e0;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10794
		bitmap.r = 0xf800;*/
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10795
		bitmap.bmiHeader.biCompression = BI_RGB;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10796
	    } else {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10797
		DPRINTF(("primGetBitsFromPixmap: unsupported depth\n"));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10798
		got fail;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10799
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10800
#endif /* ALWAYSTRUECOLOR */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10801
	    bitmap.bmiHeader.biSizeImage = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10802
	    bitmap.bmiHeader.biXPelsPerMeter = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10803
	    bitmap.bmiHeader.biYPelsPerMeter = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10804
	    bitmap.bmiHeader.biClrUsed = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10805
	    bitmap.bmiHeader.biClrImportant = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10806
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10807
	    bitmap.bmiHeader.biWidth = width;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10808
	    bitmap.bmiHeader.biHeight = -height;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10809
	    bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10810
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10811
	    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
 10812
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10813
		DPRINTF(("noinfo returned\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10814
		goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10815
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10816
	    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
 10817
	    numBytes = bitmap.bmiHeader.biSizeImage;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10818
	    if ( numBytes != 0 ) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10819
		if (numBytes > __byteArraySize(imageBits)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10820
		    /* imageBits too small */
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10821
		    DPRINTF(("provided byteArray too small\n"));
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10822
		    goto fail;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10823
		}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10824
		DPRINTF(("numBytes %d\n",numBytes));
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10825
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10826
		bitmap.bmiHeader.biHeight = -height;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10827
		bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel; /*__depth;*/
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10828
		bitmap.rgb[0] = 0;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10829
		bitmap.rgb[1] = 0xffffff;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10830
		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
 10831
		{
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10832
		    DPRINTF(("zero bits returned\n"));
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10833
		    goto fail;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10834
		}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10835
	    } else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10836
		DPRINTF(("unacceptable bitmap\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10837
		goto fail;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10838
	    }
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10839
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10840
	else
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10841
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10842
	    DPRINTF(("unacceptable bitmap\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10843
	    goto fail;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10844
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10845
	__ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10846
	__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(1);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10847
	__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
 10848
	__ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10849
	__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
 10850
	__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10851
	__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(WIN32PADDING);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10852
	__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(bitmap.bmiHeader.biBitCount);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10853
	if (bDC)
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10854
	    DeleteDC(bDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10855
	if (xDC)
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10856
	    ReleaseDC(0,xDC);//DeleteDC(xDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10857
	if (hBitmap)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10858
	    _DeleteObject(hBitmap, __LINE__);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10859
	RETURN ( true );
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10860
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10861
fail:
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10862
    if (bDC)
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10863
	DeleteDC(bDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10864
    if (xDC)
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10865
	ReleaseDC(0,xDC);//DeleteDC(xDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10866
    if (hBitmap)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10867
	_DeleteObject(hBitmap, __LINE__);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10868
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10869
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10870
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10871
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10872
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10873
!WinWorkstation methodsFor:'selections'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10874
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10875
getClipboardData
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10876
%{
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10877
    HANDLE hClip;
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10878
    HANDLE hData;
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10879
    OBJ s;
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10880
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10881
    hClip = OpenClipboard(NULL);
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10882
    if (hClip) {
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10883
	hData = GetClipboardData(CF_TEXT);
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10884
	CloseClipboard();
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10885
	INFOPRINT((stderr, "WinWorkstation [info]: clipBoard data is <%s>\n", (char *)hData));
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10886
	s = __MKSTRING( (char *)hData );
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10887
	RETURN(s);
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10888
    }
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10889
    RETURN(nil);
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10890
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10891
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10892
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10893
getSelectionFor:drawableId
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10894
    'WinWorkstation [warning]:getSelectionFor: not yet implemented' errorPrintCR.
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10895
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10896
    ^ nil
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10897
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10898
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10899
setClipboardData:aString  
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10900
%{
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10901
    HANDLE hClip;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10902
    HANDLE hData;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10903
    char *s;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10904
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10905
    if (__isString(aString)) {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10906
	s = __stringVal(aString);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10907
	hClip = OpenClipboard(NULL);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10908
	if (hClip) {
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10909
	    EmptyClipboard();
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10910
	    hData = GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE,strlen(s)+1);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10911
	    if (hData) {
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10912
		char *t = GlobalLock(hData);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10913
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10914
		if (t) {
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10915
		    strcpy(t,s);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10916
		    //printf("setClipboardData:>%s<\n",t);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10917
		    GlobalUnlock(hData);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10918
		    if (SetClipboardData(CF_TEXT,hData) == 0) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10919
			DPRINTF(("SetClipboardData error:%d\n", GetLastError()));
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10920
		    }
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10921
		}
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10922
	    }
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10923
	    CloseClipboard();
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10924
	    RETURN(self);
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10925
	}
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10926
	RETURN(nil);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10927
    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10928
%}.
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 10929
    self primitiveFailed.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10930
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10931
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10932
!WinWorkstation methodsFor:'style defaults'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10933
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10934
defaultStyleValueFor:aKey
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10935
    "return a default style value, given a key.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10936
     These defaults are used if nothing is specified
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10937
     in the style sheet
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10938
     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
 10939
     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
 10940
     where the systemDefaults are used ..."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10941
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10942
    |clr|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10943
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10944
"/    aKey == #shadowColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10945
"/        ^ Color black
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10946
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10947
"/    aKey == #lightColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10948
"/        ^ Color white
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10949
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10950
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10951
    aKey == #viewBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10952
	clr := self getSystemColor:#COLOR_WINDOW.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10953
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10954
    aKey == #textForegroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10955
	clr := self getSystemColor:#COLOR_WINDOWTEXT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10956
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10957
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10958
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10959
"/    aKey == #scrollerViewBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10960
"/        ^ Color white
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10961
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10962
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10963
"/    aKey == #textBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10964
"/        ^ Color white.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10965
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10966
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10967
    clr notNil ifTrue:[^ clr].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10968
    ^ super defaultStyleValueFor:aKey
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10969
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10970
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10971
!WinWorkstation methodsFor:'window stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10972
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10973
activateWindow:aWindowId
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10974
    "make a window active"
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10975
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10976
%{  /* xxLIMITEDSTACK */
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10977
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10978
    if (__isExternalAddress(aWindowId)) {
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10979
	HWND win = _HWNDVal(aWindowId);
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10980
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10981
	if (win) {
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10982
	    CPRINTF(("activateWindow %x\n",win));
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10983
	    ShowWindowAsync(win, SW_SHOW | SW_SHOWNORMAL);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10984
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10985
//            ShowWindow(win, SW_SHOW);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10986
//            SetWindowPos(win, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW|/*SWP_NOACTIVATE|*/SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10987
//            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
 10988
	}
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10989
	RETURN ( self );
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10990
    }
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10991
%}
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10992
!
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 10993
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10994
configureWindow:aWindowId sibling:siblingId stackMode:modeSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10995
    "configure stacking operation of aWindowId w.r.t siblingId"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10996
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10997
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10998
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 10999
dropFilesWindow:aWindowId accept:doAccept
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 11000
    "window accept Files from Shell"
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 11001
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 11002
%{  /* xxLIMITEDSTACK (WIN95 only) */
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 11003
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 11004
    if (__isExternalAddress(aWindowId)) {
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 11005
	HWND hWnd = _HWNDVal(aWindowId);
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 11006
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 11007
	if (hWnd) {
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 11008
	    if (doAccept == true)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11009
	    DragAcceptFiles(hWnd, (doAccept == true) ? TRUE : FALSE);
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 11010
	}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 11011
	RETURN ( self );
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 11012
    }
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 11013
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 11014
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 11015
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11016
lowerWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11017
    "bring a window to back"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11018
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11019
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11020
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11021
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11022
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11023
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11024
	if (win) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 11025
	    CPRINTF(("lowerWindow %x\n",win));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11026
	    SetWindowPos(win, HWND_BOTTOM, 0, 0, 0, 0, 
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11027
			 SWP_NOSENDCHANGING |
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11028
			 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11029
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11030
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11031
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11032
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11033
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11034
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11035
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
 11036
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11037
    "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
 11038
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11039
    "/ 'mapView:id:iconified:...height: not yet implemented' errorPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11040
%{  /* xxLIMITEDSTACK */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11041
    RECT rec;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11042
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11043
     && __bothSmallInteger(x, y)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11044
     && __bothSmallInteger(w, h)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11045
	HWND win = _HWNDVal(aWindowId);
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11046
	int bw;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11047
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11048
	if (win)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11049
	{
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11050
	    bw = GetWindow_bw(win);
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11051
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11052
	    rec.left = __intVal(x) + bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11053
	    rec.top = __intVal(y) + bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11054
	    rec.right = rec.left + __intVal(w) - bw - bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11055
	    rec.bottom = rec.top + __intVal(h) - bw - bw;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11056
#ifdef ADJUSTWINDOW
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11057
	    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
 11058
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11059
	    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
 11060
			 rec.right - rec.left, rec.bottom - rec.top));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11061
	    SetWindowPos(win, (HWND)0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11062
			 rec.left, rec.top,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11063
			 rec.right - rec.left, rec.bottom - rec.top,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11064
			 SWP_NOSENDCHANGING | SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOOWNERZORDER);
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11065
	    if (aBoolean == true) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11066
		ShowWindow(win, SW_SHOWMINIMIZED);
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
 11067
		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
 11068
	    } else {
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
 11069
		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
 11070
		//ShowWindow(win, SW_RESTORE);
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11071
		ShowWindow(win, SW_SHOWNOACTIVATE);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11072
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11073
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11074
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11075
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11076
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11077
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11078
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11079
mapWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11080
    "make a window visible"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11081
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11082
%{  /* xxLIMITEDSTACK */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11083
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11084
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11085
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11086
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11087
	if (win) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 11088
	    CPRINTF(("mapWindow %x\n",win));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11089
	    ShowWindow(win, SW_SHOWNOACTIVATE);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11090
//            ShowWindow(win, SW_SHOW);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11091
//            SetWindowPos(win, HWND_TOP, 0, 0, 0, 0, SWP_NOSENDCHANGING|/*SWP_SHOWWINDOW|*/SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE/*|SWP_NOZORDER|SWP_NOOWNERZORDER */      );
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11092
//            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
 11093
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11094
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11095
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11096
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11097
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11098
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11099
moveResizeWindow:aWindowId x:x y:y width:w height:h
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11100
    "move and resize a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11101
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11102
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11103
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11104
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11105
     && __bothSmallInteger(x, y)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11106
     && __bothSmallInteger(w, h)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11107
	HWND win = _HWNDVal(aWindowId);
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11108
	int bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11109
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11110
	if (win) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11111
	    bw = GetWindow_bw(win);
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11112
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11113
	    rec.left = __intVal(x) + bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11114
	    rec.top = __intVal(y) + bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11115
	    rec.right = rec.left + __intVal(w) - bw - bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11116
	    rec.bottom = rec.top + __intVal(h) - bw - bw;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11117
#ifdef ADJUSTWINDOW
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11118
	    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
 11119
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11120
	    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
 11121
			 rec.right - rec.left, rec.bottom - rec.top));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11122
	    SetWindowPos(win, (HWND)0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11123
			 rec.left, rec.top,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11124
			 rec.right - rec.left, rec.bottom - rec.top,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11125
			 SWP_NOSENDCHANGING | SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOOWNERZORDER);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11126
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11127
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11128
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11129
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11130
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11131
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11132
moveWindow:aWindowId x:x y:y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11133
    "move a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11134
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11135
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11136
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11137
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11138
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11139
     && __bothSmallInteger(x, y)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11140
	HWND win = _HWNDVal(aWindowId);
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11141
	int bw;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11142
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11143
	if (win) {
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11144
	    bw = GetWindow_bw(win);
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11145
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11146
	    rec.left = __intVal(x) + bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11147
	    rec.top = __intVal(y) + bw;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11148
	    rec.right = rec.left + 10;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11149
	    rec.bottom = rec.top + 10;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11150
#ifdef ADJUSTWINDOW
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11151
	    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
 11152
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11153
	    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
 11154
	    SetWindowPos(win, (HWND)0,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11155
			 rec.left, rec.top,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11156
			 0, 0,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11157
			 SWP_NOSENDCHANGING | SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11158
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11159
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11160
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11161
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11162
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11163
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11164
primSetWindowIconId:wiconId maskId:wmaskId width:wiconWidth height:wiconHeight in:aWindowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11165
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11166
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11167
    HBITMAP        xBitMap, maskBitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11168
    ICONINFO       iconInfo;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11169
    int            height, width;
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11170
    HICON          xIcon = (HICON)0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11171
    unsigned char  *allocatedBits = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11172
    unsigned char  fastBits[10000];
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11173
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11174
    DPRINTF(("primSetWindowIconId\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11175
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11176
     && __isExternalAddress(wiconId)
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11177
     && __bothSmallInteger(wiconWidth, wiconHeight)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11178
	HWND win = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11179
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11180
	xBitMap = _HBITMAPVAL( wiconId );
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11181
	if ( xBitMap != 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11182
	    BITMAP bm;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11183
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11184
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11185
		BYTE *ep;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11186
		int privateMask = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11187
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11188
		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
 11189
		height = __intVal( wiconHeight );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11190
		width  = __intVal( wiconWidth  );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11191
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11192
		if ( __isExternalAddress(wmaskId) ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11193
		    maskBitmap = _HBITMAPVAL( wmaskId );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11194
		} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11195
		    if (wmaskId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11196
			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
 11197
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11198
		    maskBitmap = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11199
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11200
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11201
		/*
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11202
		 * if there is no mask, generate one
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11203
		 */
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11204
		if (maskBitmap == 0) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11205
		    int nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11206
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11207
		    nBytes = ( width + 31 ) / 8;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11208
		    nBytes = height * nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11209
		    if (nBytes < sizeof(fastBits)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11210
			ep = fastBits;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11211
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11212
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11213
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11214
		    if ( ep == 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11215
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11216
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11217
			memset(ep, 0, nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11218
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11219
			if ( maskBitmap == NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11220
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11221
			} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11222
			    privateMask = 1;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11223
			}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11224
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11225
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11226
		if ( maskBitmap != NULL ) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11227
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11228
		    iconInfo.fIcon = TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11229
		    iconInfo.hbmMask  =maskBitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11230
		    iconInfo.hbmColor = xBitMap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11231
		    xIcon = CreateIconIndirect( &iconInfo );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11232
		    DPRINTF(( "ICON CREATED!!!\n" ));
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11233
		    if (privateMask) {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 11234
			_DeleteObject( maskBitmap, __LINE__ );
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11235
		    } 
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11236
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11237
		    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
 11238
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11239
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11240
		if (allocatedBits) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11241
		    free(allocatedBits);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11242
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11243
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11244
	} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11245
	    DPRINTF(("WinWorkstat [warning]: xBitMap is zero \n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11246
	}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11247
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11248
	if (xIcon) {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 11249
#ifndef TOPWINDOWCLASS
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11250
	    HICON oldIcon = (HICON)0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11251
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11252
	    oldIcon = (HICON) GetClassLong(win, GCL_HICON);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11253
	    SetClassLong(win, GCL_HICON, (DWORD)xIcon);
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11254
/* It has to be checked whether this can be deleted!!!!! */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11255
	    if ( oldIcon ) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11256
		if (DestroyIcon( oldIcon )) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11257
		    DPRINTF(( "Old icon deleted\n" ));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11258
		} else {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11259
		    fprintf(stderr, "failed to delete old icon\n");
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11260
		}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11261
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 11262
#else
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11263
	    SendMessage(win, WM_SETICON,ICON_SMALL, (LPARAM)xIcon);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11264
	    SendMessage(win, WM_SETICON,ICON_BIG, (LPARAM)xIcon);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 11265
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11266
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11267
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11268
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11269
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11270
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11271
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11272
raiseWindow:aWindowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11273
    "bring a window to front"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11274
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11275
%{  /* xxLIMITEDSTACK (WIN95 only) */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11276
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11277
    if (__isExternalAddress(aWindowId)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11278
	HWND hWnd = _HWNDVal(aWindowId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11279
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11280
	if (hWnd) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 11281
	    CPRINTF(("raiseWindow %x\n",hWnd));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11282
#if 1
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11283
	    SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, 
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11284
			 /* SWP_NOOWNERZORDER |*/ 
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11285
			 SWP_NOSENDCHANGING | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 11286
#else
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 11287
	    BringWindowToTop(hWnd);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 11288
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11289
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11290
	RETURN ( self );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11291
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11292
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11293
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11294
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11295
resizeWindow:aWindowId width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11296
    "resize a window"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11297
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11298
%{  /* xxLIMITEDSTACK (WIN95 only) */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11299
    RECT rec;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11300
    if (__isExternalAddress(aWindowId)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11301
     && __bothSmallInteger(w, h)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11302
	HWND hWnd = _HWNDVal(aWindowId);
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11303
	int bw;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11304
2593
1d2dad16f32c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2554
diff changeset
 11305
	if (hWnd) {
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11306
	    bw = GetWindow_bw(hWnd);
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11307
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11308
	    rec.left = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11309
	    rec.top = 0;
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11310
	    rec.right = __intVal(w) - bw - bw;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11311
	    rec.bottom = __intVal(h) - bw - bw;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11312
#ifdef ADJUSTWINDOW
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11313
	    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
 11314
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11315
	    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
 11316
	    SetWindowPos(hWnd, (HWND)0,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11317
			 0, 0,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11318
			 rec.right - rec.left, rec.bottom - rec.top,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11319
			 SWP_NOSENDCHANGING | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11320
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11321
	RETURN ( self );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11322
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11323
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11324
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11325
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11326
setBackingStore:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11327
    "turn on/off backing-store for a window"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11328
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 11329
    'WinWorkstation [info]: setBackingStore:in: not yet implemented' errorPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11330
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11331
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11332
setBitGravity:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11333
    "set bit gravity for a window"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11334
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11335
    "/ 'setBitGravity:in: not yet implemented' errorPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11336
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11337
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11338
setCursor:aCursorId in:aWindowId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11339
    "define a windows cursor
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11340
     Ignored here, since in windows, an application
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11341
     has to manage the cursor itself."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11342
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11343
%{  /* xxLIMITEDSTACK (WIN95 only) */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11344
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11345
    HCURSOR newCursor;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11346
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11347
    if (ISCONNECTED
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11348
     && __isExternalAddress(aWindowId)
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11349
     && __isExternalAddress(aCursorId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11350
	HWND win = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11351
	POINT p;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11352
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
 11353
	/*printf("setCursor:in:\n");*/
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11354
	SetWindow_Cursor(win, _HCURSORVal(aCursorId));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 11355
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11356
	/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11357
	 * if the pointer is currently in that window ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11358
	 */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11359
	GetCursorPos(&p);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 11360
	if (WindowFromPoint(p) == win) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 11361
#ifdef SET_CURSOR_IN_WINTHREAD
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 11362
	    PostMessage(win, WM_THREADSETCURSOR, 0, (INT)_HCURSORVal(aCursorId));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 11363
#else
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 11364
	    SetCursor(_HCURSORVal(aCursorId));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 11365
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 11366
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11367
	RETURN ( self );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11368
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11369
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11370
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11371
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11372
setIconName:aString in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11373
    "define a windows iconname"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11374
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11375
%{  /* xxLIMITEDSTACK (WIN95 only) */
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11376
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 11377
#if 0
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11378
    if (__isExternalAddress(aWindowId)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11379
     && (__isString(aString) || __isSymbol(aString))) {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11380
	HWND win = _HWNDVal(aWindowId);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11381
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11382
	SetWindowText(win, __stringVal(aString));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11383
	RETURN (self);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11384
    }
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 11385
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11386
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11387
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11388
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11389
setSaveUnder:yesOrNo in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11390
    "turn on/off save-under for a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11391
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11392
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11393
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11394
setTransient:aWindowId for:aMainWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11395
    "set aWindowId to be a transient of aMainWindow"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11396
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11397
%{  /* NOCONTEXT */
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11398
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11399
    if (__isExternalAddress(aWindowId)) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11400
	HWND w;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11401
	HWND cw = _HWNDVal(aWindowId);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11402
	if ((aMainWindowId == nil) || (aMainWindowId == __MKSMALLINT(0))) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11403
	    w = (HWND) 0;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11404
	} else {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11405
	    if (__isExternalAddress(aMainWindowId)) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11406
		w = _HWNDVal(aMainWindowId);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11407
	    } else {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11408
		goto getOutOfHere;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11409
	    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11410
	}
2417
1e40a40e56e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2416
diff changeset
 11411
	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
 11412
	//SetParent(cw, w);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11413
	RETURN ( self );
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11414
    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11415
 getOutOfHere: ;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11416
%}.
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11417
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11418
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11419
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11420
setWindowBackground:aColorIndex in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11421
    "set the windows background color. This is the color with which
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11422
     the view is filled whenever exposed. Do not confuse this with
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11423
     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
 11424
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11425
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11426
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11427
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11428
     && (__isSmallInteger(aColorIndex))) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11429
	HWND hWnd = _HWNDVal(aWindowId);
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
 11430
	int clr;
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11431
	HBRUSH oldBrush;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11432
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11433
	if (oldBrush = GetWindow_viewBgBrush(hWnd)) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11434
	    SetWindow_viewBgBrush(hWnd, 0);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11435
	    _DeleteObject(oldBrush, __LINE__);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11436
	}
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
 11437
	clr = st2RGB(__intVal(aColorIndex), 0);
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
 11438
	SetWindow_viewBgColor(hWnd, clr);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11439
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11440
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11441
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11442
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11443
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11444
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11445
setWindowBackgroundPixmap:aPixmapId in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11446
    "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
 11447
     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
 11448
     Do not confuse this with the background drawing color, which is used
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11449
     with opaque drawing.
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11450
     NOTICE: due to the limitations of WIN95, 
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11451
	     background pixmaps which are not 8x8 pixels in size, 
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11452
	     are handled by smalltalk code in the WIN95 version."
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11453
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11454
%{  
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11455
    if (__isExternalAddress(aWindowId)) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11456
	HWND hWnd = _HWNDVal(aWindowId);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11457
	HBITMAP pixmap;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11458
	HBRUSH oldBrush, newBrush;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11459
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11460
	if (__isExternalAddress(aPixmapId))
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11461
	    pixmap = _HBITMAPVAL(aPixmapId);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11462
	else
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11463
	    pixmap = 0;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11464
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11465
	if (oldBrush = GetWindow_viewBgBrush(hWnd)) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11466
	    SetWindow_viewBgBrush(hWnd, 0);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11467
	    _DeleteObject(oldBrush, __LINE__);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11468
	}
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11469
	if (pixmap) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11470
	    newBrush = CreatePatternBrush(pixmap);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11471
	    SetWindow_viewBgBrush(newBrush, 0);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11472
/*
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11473
 *            SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);       
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11474
 */
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11475
	}
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11476
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11477
	RETURN (self);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11478
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11479
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11480
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11481
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11482
setWindowBorderColor:aColorIndex in:aWindowId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11483
    "set the windows border color.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11484
     NOTICE: borders are not supported by the win32 version."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11485
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11486
%{  /* NOCONTEXT */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 11487
    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
 11488
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11489
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11490
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11491
setWindowBorderPixmap:aPixmapId in:aWindowId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11492
    "set the windows border pattern.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11493
     NOTICE: border pixmaps are not supported by the win32 version."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11494
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11495
%{  /* NOCONTEXT */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 11496
    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
 11497
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11498
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11499
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11500
setWindowBorderWidth:aNumber in:aWindowId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11501
    "set the windows border width.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11502
     NOTICE: borderWidths other than 1 are not supported by the win32 version."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11503
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11504
%{  /* NOCONTEXT */
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11505
    int bw = (aNumber == __MKSMALLINT(0)) ? 0 : 1;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11506
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11507
    if (__isExternalAddress(aWindowId)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11508
	HWND win = _HWNDVal(aWindowId);
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11509
	int gwl;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11510
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11511
	gwl = GetWindowLong(win, GWL_STYLE);
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11512
	if (gwl & WS_CHILD) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11513
	    SetWindow_bw(win, bw);
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11514
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11515
	    if (bw) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11516
		gwl |= WS_BORDER;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11517
	    } else {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11518
		gwl &= ~WS_BORDER;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11519
	    }
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11520
	    SetWindowLong(win, GWL_STYLE, gwl);
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 11521
#if 0
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 11522
	    PostMessage(win,WM_NCPAINT,0,0);
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 11523
#endif
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11524
	}
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 11525
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11526
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11527
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11528
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11529
setWindowClass:wClass name:wName in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11530
    "define class and name of a window.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11531
     This may be used by the window manager to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11532
     select client specific resources."
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 11533
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11534
%{  /* NOCONTEXT */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 11535
    DPRINTF(("WinWorkstation [info]: setWindowClass:name:in: not yet implemented\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11536
%}.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11537
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11538
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11539
setWindowGravity:how in:aWindowId
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11540
    "set the window gravity - this makes the view to move
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11541
     automatically and can avoid redraws (if used properly)"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11542
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11543
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11544
    int gr = GRAVITY_NONE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11545
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11546
    if (__isExternalAddress(aWindowId)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11547
	HWND hWnd = _HWNDVal(aWindowId);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11548
	localWindowInfo *lI;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11549
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11550
	if (how == @symbol(South)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11551
	    gr = GRAVITY_S;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11552
	} else if (how == @symbol(SouthWest)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11553
	    gr = GRAVITY_SW;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11554
	} else if (how == @symbol(SouthEast)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11555
	    gr = GRAVITY_SE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11556
	} else if (how == @symbol(North)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11557
	    gr = GRAVITY_N;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11558
	} else if (how == @symbol(NorthWest)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11559
	    gr = GRAVITY_NW;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11560
	} else if (how == @symbol(NorthEast)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11561
	    gr = GRAVITY_NE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11562
	} else if (how == @symbol(East)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11563
	    gr = GRAVITY_E;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11564
	} else if (how == @symbol(West)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11565
	    gr = GRAVITY_W;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11566
	}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11567
	if (lI = GETLOCALWINDOWINFOPTR(hWnd)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11568
	    lI->viewGravity = gr;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11569
	}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11570
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11571
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11572
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11573
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11574
setWindowIcon:aForm in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11575
    "define a bitmap to be used as icon"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11576
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11577
    self
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11578
	setWindowIcon:aForm 
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11579
	mask:nil 
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11580
	in:aWindowId
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11581
!
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11582
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11583
setWindowIcon:aForm mask:aMaskForm in:aWindowId
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11584
    "set a windows icon & iconMask"
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11585
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11586
    |wiconId wmaskId wiconHeight wiconWidth|
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11587
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11588
    aForm notNil ifTrue:[
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11589
	wiconId := aForm id.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11590
	wiconHeight := aForm height.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11591
	wiconWidth  := aForm width.
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11592
	aMaskForm notNil ifTrue:[
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11593
	    wmaskId := aMaskForm id
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11594
	].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11595
	self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11596
	    primSetWindowIconId:wiconId
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 11597
	    maskId:wmaskId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11598
	    width:wiconWidth
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11599
	    height:wiconHeight
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11600
	    in:aWindowId
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11601
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11602
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11603
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11604
setWindowIconWindow:aView in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11605
    "define a window to be used as icon"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11606
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 11607
    'WinWorkstation [info]: setWindowIconWindow:in: not yet implemented' infoPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11608
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11609
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11610
setWindowName:aString in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11611
    "define a windows name"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11612
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11613
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11614
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11615
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11616
     && (__isString(aString) || __isSymbol(aString))) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11617
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11618
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11619
	SetWindowText(win, __stringVal(aString));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11620
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11621
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11622
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11623
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11624
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11625
unmapWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11626
    "make a window invisible"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11627
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11628
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11629
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11630
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11631
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11632
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11633
	if (win) {
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 11634
	    CPRINTF(("unmapWindow %x\n",win));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11635
	    ShowWindow(win, SW_HIDE);
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 11636
	    CPRINTF(("unmapWindow1 %x\n",win));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
 11637
	    //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
 11638
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11639
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11640
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11641
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11642
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11643
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11644
!WinWorkstation class methodsFor:'documentation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11645
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11646
version
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 11647
    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.113 1999-05-04 17:28:29 cg Exp $'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11648
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11649
WinWorkstation initialize!