WinWorkstation.st
author ca
Mon, 16 Feb 2004 15:59:16 +0100
changeset 4015 0ebf5ad92a72
parent 4014 d31004e61546
child 4059 5626bb30ca6b
permissions -rw-r--r--
bugfix in getClipboardData; allocation of string (too much space)
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
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
    13
"{ Package: 'stx:libview' }"
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
    14
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    15
DeviceWorkstation subclass:#WinWorkstation
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    16
	instanceVariableNames:'blackpixel whitepixel listOfFonts rootWin rootDC buttonsPressed
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
    17
		eventTrace eventBuffer isWin95 isWinXP'
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
    18
	classVariableNames:'BeepDuration NativeDialogs NativeWindows NativeWindowClassTable
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
    19
		StandardColorValues IgnoreSysColorChanges IgnoreFontChanges
3161
c32b47f8eedd textSelection fixes (added newLine);
Claus Gittinger <cg@exept.de>
parents: 3158
diff changeset
    20
		SystemColorValues ClipBoardObject'
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    21
	poolDictionaries:''
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    22
	category:'Interface-Graphics'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    23
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    24
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    25
!WinWorkstation primitiveDefinitions!
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    26
%{
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
    27
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    28
#define COUNT_RESOURCES       /* */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    29
#define COUNT_BMP_RESOURCES   /* */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    30
#define DEBUG_DELETEOBJECT    /* */
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    31
#define DEBUG_DC_REUSE        /* */
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    32
#define xxDEBUG_COLORIZE_WM_PAINT_RECTS1
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    33
#define xxDEBUG_COLORIZE_WM_PAINT_RECTS2
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    34
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    35
#define ADJUSTWINDOW
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    36
#define ALWAYSTRUECOLOR
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    37
#define WIN32THREADS
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    38
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
    39
/* #define DEBUGMASK            /* */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
    40
#define SET_FOCUS_IN_WINTHREAD
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
    41
#define SET_CURSOR_IN_WINTHREAD
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
    42
#define DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE /* */
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    43
#define xxBEEP_IN_WINTHREAD    /* */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    44
#define xxKEEP_STD_CURSORS     /* not useful - those are allocated only once, in any case */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    45
#define xxHANDLE_VIEWGRAVITY   /* not yet working */
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    46
#define COMPRESS_WINDOWPOSCHANGED
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    47
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
    48
#define USE_DRAW_MUTEX
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
    49
#define xxLATE_GENERATE_EXPOSE              /* get update region from stx thread */
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
    50
#define xxNO_CLEAR_FOR_WM_PAINT           /* do not fill exposed areas with bgColor */
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    51
#define xxLATE_CLEAR_FOR_WM_PAINT         /* fill exposed areas with bgColor in ST/X thread (instead of in event-thread) */
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
    52
					/* seems to be needed to avoid DC conflicts */
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
    53
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
    54
#if 0 /* DOES NOT WORK */
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
    55
#define CACHE_LAST_DC                   /* remember last DC in gcData */
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
    56
#define CACHE_LAST_PEN                  /* remember last pen in gcData */
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
    57
#define CACHE_LAST_BRUSH                /* remember last brush in gcData */
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
    58
#define CACHE_LAST_WM_PAINT_BRUSH       /* remember last viewBackground brush */
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
    59
#define CACHE_LAST_WM_PAINT_DC          /* remember last viewBackground paints dc */
3589
34e3adb59adb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3584
diff changeset
    60
#define CACHE_LAST_TMP_FONT             /* */
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
    61
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
    62
#endif
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
    63
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
    64
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    65
#define CACHE_PEN
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    66
#define CACHE_BRUSH
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
    67
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    68
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    69
#ifdef CACHE_PEN
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    70
# define NUM_PEN_CACHED_W95   8          /* that many solid pens are globally remembered */
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    71
# define NUM_PEN_CACHED_NT    16         /* that many solid pens are globally remembered */
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    72
# define MAX_NUM_PEN_CACHED   32         /* upper limit */
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    73
#else
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    74
# define NUM_PEN_CACHED_W95   0          
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    75
# define NUM_PEN_CACHED_NT    0         
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    76
# define MAX_NUM_PEN_CACHED   0         
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    77
#endif
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    78
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    79
#ifdef CACHE_BRUSH
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    80
# define NUM_BRUSH_CACHED_W95 8          /* that many brushes are globally remembered */
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    81
# define NUM_BRUSH_CACHED_NT  16         /* that many brushes are globally remembered */
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    82
# define MAX_NUM_BRUSH_CACHED 32         /* upper limit */
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    83
#else
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    84
# define NUM_BRUSH_CACHED_W95 0       
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    85
# define NUM_BRUSH_CACHED_NT  0        
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    86
# define MAX_NUM_BRUSH_CACHED 0        
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    87
#endif
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    88
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    89
#if defined(NO_CLEAR_FOR_WM_PAINT)
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    90
# define WM_PAINT_CLEAR_EARLY       0
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    91
# define WM_PAINT_CLEAR_LATE        0
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    92
#else
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    93
# if defined(LATE_CLEAR_FOR_WM_PAINT) 
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    94
#  define WM_PAINT_CLEAR_EARLY       0
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    95
#  define WM_PAINT_CLEAR_LATE        1
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    96
# else
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    97
#  define WM_PAINT_CLEAR_EARLY       1
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    98
#  define WM_PAINT_CLEAR_LATE        0
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    99
# endif
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
   100
#endif
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
   101
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   102
#undef INT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   103
#define INT WIN_INT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   104
#undef Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   105
#define Array WIN_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   106
#undef Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   107
#define Number WIN_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   108
#undef Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   109
#define Method WIN_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   110
#undef Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   111
#define Point WIN_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   112
#undef Rectangle
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   113
/* #define Rectangle WIN_Rectangle */
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   114
#undef True
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   115
#define True WIN_True
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   116
#undef False
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   117
#define False WIN_False
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   118
#undef Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   119
#define Block WIN_Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   120
#undef Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   121
#define Context WIN_Context
2766
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   122
#undef Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   123
#define Date WIN_Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   124
#undef Time
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   125
#define Time WIN_Time
3119
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   126
#undef Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   127
#define Delay WIN_Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   128
#undef Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   129
#define Signal WIN_Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   130
#undef Set
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   131
#define Set WIN_Set
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   132
2328
478ec9b5cbe1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2327
diff changeset
   133
#include <stdio.h>
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   134
#include <errno.h>
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   135
/* #include <malloc.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   136
/* #include <math.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   137
/* #include <string.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   138
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   139
/*#include <stdarg.h>   */
2328
478ec9b5cbe1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2327
diff changeset
   140
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   141
#ifdef __BORLANDC__
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   142
# define NOATOM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   143
# define NOGDICAPMASKS
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   144
# define NOMETAFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   145
# define NOMINMAX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   146
# define NOOPENFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   147
# define NOSOUND
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   148
# define NOWH
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   149
# define NOCOMM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   150
# define NOKANJI
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   151
# define NOCRYPT
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   152
# define NOMCX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   153
# define WIN32_LEAN_AND_MEAN
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   154
# include <windows.h>
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   155
# include <shellapi.h>
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   156
# include <sys\timeb.h>
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   157
# include <dir.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   158
#else
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   159
# define _USERENTRY /**/
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   160
# define NOATOM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   161
# define NOGDICAPMASKS
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   162
# define NOMETAFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   163
# define NOMINMAX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   164
# define NOOPENFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   165
# define NOSOUND
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   166
# define NOWH
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   167
# define NOCOMM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   168
# define NOKANJI
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   169
# define NOCRYPT
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   170
# define NOMCX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   171
# define WIN32_LEAN_AND_MEAN
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   172
# include <windows.h>
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   173
# include <sys\timeb.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   174
#endif
3521
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
   175
#include <commdlg.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   176
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   177
#include <process.h>
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   178
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   179
#ifdef __DEF_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   180
# undef Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   181
# define Array __DEF_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   182
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   183
#ifdef __DEF_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   184
# undef Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   185
# define Number __DEF_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   186
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   187
#ifdef __DEF_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   188
# undef Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   189
# define Method __DEF_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   190
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   191
#ifdef __DEF_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   192
# undef Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   193
# define Point __DEF_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   194
#endif
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   195
#ifdef __DEF_Rectangle
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   196
# undef Rectangle
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   197
# define Rectangle __DEF_Rectangle
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   198
#else
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   199
# undef Rectangle
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   200
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   201
#ifdef __DEF_Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   202
# undef Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   203
# define Block __DEF_Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   204
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   205
#ifdef __DEF_Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   206
# undef Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   207
# define Context __DEF_Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   208
#endif
2766
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   209
#ifdef __DEF_Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   210
# undef Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   211
# define Date __DEF_Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   212
#endif
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   213
#ifdef __DEF_Time
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   214
# undef Time
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   215
# define Time __DEF_Time
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   216
#endif
3119
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   217
# ifdef __DEF_Set
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   218
#  undef Set
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   219
#  define Set __DEF_Set
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   220
# endif
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   221
# ifdef __DEF_Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   222
#  undef Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   223
#  define Signal __DEF_Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   224
# endif
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   225
# ifdef __DEF_Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   226
#  undef Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   227
#  define Delay __DEF_Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   228
# endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   229
#undef INT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   230
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   231
#define INT int
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   232
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   233
/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   234
 * some defines - tired of typing ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   235
 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   236
#define _HANDLEVal(o)        (HANDLE)(__MKCP(o))
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   237
#define _HBITMAPVAL(o)       (HBITMAP)(__MKCP(o))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   238
#define _HWNDVal(o)          (HWND)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   239
#define _HPALETTEVal(o)      (HPALETTE)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   240
#define _HCURSORVal(o)       (HCURSOR)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   241
#define _HGDIOBJVal(o)       (HGDIOBJ)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   242
#define _LOGPALETTEVal(o)    (LOGPALETTE *)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   243
#define _COLORREFVal(o)      (COLORREF)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   244
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   245
#define _GCDATA(o)           ((struct gcData *)(__MKCP(o)))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   246
3498
890cfcba79a5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3497
diff changeset
   247
#define WIDECHAR unsigned short
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
   248
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   249
#ifdef LATER
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   250
  /* 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
   251
   * 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
   252
   * 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
   253
   */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   254
# define __rootDC             (HDC)(__MKCP(__INST(rootDC)))
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   255
#endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   256
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   257
#define ISCONNECTED         1
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   258
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   259
struct gcData {
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   260
    union {
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   261
	HDC         __hDC;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   262
	struct gcData *__nextFree;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   263
    } u;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   264
    HWND        hWnd;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   265
    HBITMAP     hBitmap;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   266
    HBITMAP     save_hBitmap;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   267
    HBITMAP     hMask;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   268
    short       clipX;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   269
    short       clipY;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   270
    short       clipW;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   271
    short       clipH;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   272
    char        clipping;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   273
    char        clipByChildren;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   274
    char        bkMode;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   275
    char        bitmapColorBitCount;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   276
    short       maskOrgX;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   277
    short       maskOrgY;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   278
    short       lineWidth;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   279
    short       fontAscent;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   280
    int         lStyle;   /* is lineStyle | joinStyle | capStyle */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   281
    int         rop2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   282
    int         bitbltrop2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   283
    COLORREF    fgColor;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   284
    COLORREF    bgColor;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   285
    HFONT       hFont;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   286
    HFONT       save_hFont;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   287
    HPEN        hPen;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   288
    HPEN        save_hPen;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   289
    HBRUSH      hBrush;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   290
    HBRUSH      save_hBrush;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   291
};
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   292
#define _hDC u.__hDC
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   293
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   294
/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   295
 * some synthetic values
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   296
 */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   297
/*****************************************************************
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   298
 * EVENT DEFINITIONS
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   299
 *****************************************************************/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   300
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   301
/* 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
   302
   to Grab requests.  Not to be confused with event names.  */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   303
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   304
#define NoEventMask                     0L
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   305
#define KeyPressMask                    (1L<<0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   306
#define KeyReleaseMask                  (1L<<1)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   307
#define ButtonPressMask                 (1L<<2)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   308
#define ButtonReleaseMask               (1L<<3)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   309
#define EnterWindowMask                 (1L<<4)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   310
#define LeaveWindowMask                 (1L<<5)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   311
#define PointerMotionMask               (1L<<6)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   312
#define PointerMotionHintMask           (1L<<7)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   313
#define Button1MotionMask               (1L<<8)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   314
#define Button2MotionMask               (1L<<9)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   315
#define Button3MotionMask               (1L<<10)
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   316
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   317
# define Button4MotionMask               (1L<<11)
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   318
# define Button5MotionMask               (1L<<12)
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   319
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   320
#define ButtonMotionMask                (1L<<13)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   321
#define KeymapStateMask                 (1L<<14)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   322
#define ExposureMask                    (1L<<15)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   323
#define VisibilityChangeMask            (1L<<16)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   324
#define StructureNotifyMask             (1L<<17)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   325
#define ResizeRedirectMask              (1L<<18)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   326
#define SubstructureNotifyMask          (1L<<19)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   327
#define SubstructureRedirectMask        (1L<<20)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   328
#define FocusChangeMask                 (1L<<21)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   329
#define PropertyChangeMask              (1L<<22)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   330
#define ColormapChangeMask              (1L<<23)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   331
#define OwnerGrabButtonMask             (1L<<24)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   332
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   333
/* 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
   334
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
   335
are reserved in the protocol for errors and replies. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   336
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   337
#define KeyPress                2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   338
#define KeyRelease              3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   339
#define ButtonPress             4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   340
#define ButtonRelease           5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   341
#define MotionNotify            6
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   342
#define EnterNotify             7
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   343
#define LeaveNotify             8
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   344
#define FocusIn                 9
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   345
#define FocusOut                10
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   346
#define KeymapNotify            11
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   347
#define Expose                  12
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   348
#define GraphicsExpose          13
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   349
#define NoExpose                14
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   350
#define VisibilityNotify        15
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   351
#define CreateNotify            16
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   352
#define DestroyNotify           17
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   353
#define UnmapNotify             18
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   354
#define MapNotify               19
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   355
#define MapRequest              20
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   356
#define ReparentNotify          21
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   357
#define ConfigureNotify         22
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   358
#define ConfigureRequest        23
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   359
#define GravityNotify           24
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   360
#define ResizeRequest           25
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   361
#define CirculateNotify         26
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   362
#define CirculateRequest        27
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   363
#define PropertyNotify          28
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   364
#define SelectionClear          29
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   365
#define SelectionRequest        30
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   366
#define SelectionNotify         31
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   367
#define ColormapNotify          32
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   368
#define ClientMessage           33
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   369
#define MappingNotify           34
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   370
#define LASTEvent               35      /* must be bigger than any event # */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   371
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   372
/* 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
   373
   state in various key-, mouse-, and button-related events. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   374
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   375
#define ShiftMask               (1<<0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   376
#define LockMask                (1<<1)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   377
#define ControlMask             (1<<2)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   378
#define Mod1Mask                (1<<3)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   379
#define Mod2Mask                (1<<4)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   380
#define Mod3Mask                (1<<5)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   381
#define Mod4Mask                (1<<6)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   382
#define Mod5Mask                (1<<7)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   383
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   384
/* modifier names.  Used to build a SetModifierMapping request or
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   385
   to read a GetModifierMapping request.  These correspond to the
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   386
   masks defined above. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   387
#define ShiftMapIndex           0
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   388
#define LockMapIndex            1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   389
#define ControlMapIndex         2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   390
#define Mod1MapIndex            3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   391
#define Mod2MapIndex            4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   392
#define Mod3MapIndex            5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   393
#define Mod4MapIndex            6
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   394
#define Mod5MapIndex            7
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   395
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   396
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   397
/* 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
   398
   with button names below. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   399
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   400
#define Button1Mask            Button1MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   401
#define Button2Mask            Button2MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   402
#define Button3Mask            Button3MotionMask
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   403
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   404
# define Button4Mask            Button4MotionMask
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   405
# define Button5Mask            Button5MotionMask
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   406
#endif
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   407
#define AnyButtonMask           (Button1Mask|Button2Mask|Button3Mask)
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   408
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   409
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   410
# define AnyModifier             (1<<15)  /* used in GrabButton, GrabKey */
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   411
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   412
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   413
/* 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
   414
   and ButtonRelease events.  Not to be confused with button masks above.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   415
   Note that 0 is already defined above as "AnyButton".  */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   416
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   417
#define Button1                 1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   418
#define Button2                 2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   419
#define Button3                 3
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   420
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   421
# define Button4                 4
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   422
# define Button5                 5
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   423
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   424
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   425
#define CAPTURE_NONE     0
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   426
#define CAPTURE_IMPLICIT 7
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   427
#define CAPTURE_EXPLICIT 8
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   428
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   429
#define BK_UNDEF         0
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   430
#define BK_TRANSPARENT   1
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   431
#define BK_OPAQUE        2
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   432
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   433
#define GRAVITY_NONE        0
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   434
#define GRAVITY_S           1
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   435
#define GRAVITY_SW          2
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   436
#define GRAVITY_SE          3
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   437
#define GRAVITY_N           4
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   438
#define GRAVITY_NW          5
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   439
#define GRAVITY_NE          6
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   440
#define GRAVITY_E           7
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   441
#define GRAVITY_W           8
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   442
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   443
/*#define ControlMask            8
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   444
#define ShiftMask              16*/
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   445
#define LeftAltMask            Mod1Mask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   446
#define RightAltMask           Mod2Mask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   447
#define TRANSLATED_KEY         Mod5Mask
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   448
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   449
#define WIN32PADDING 32
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
   450
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   451
/*
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   452
 * synthetic events
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   453
 */
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   454
#define __WM_MOUSEENTER        0x10001
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   455
#define __WM_MOUSELEAVE        0x10002
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   456
#define __WM_GEXPOSE           0x10003
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   457
#define __WM_NOGEXPOSE         0x10004
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   458
#define __WM_ICONIFIED         0x10005
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
   459
#define __WM_PAINT             0x10006
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   460
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   461
static int AltMask = RightAltMask;
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   462
static int MetaMask = LeftAltMask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   463
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   464
#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
   465
#define BlackPixel     RGB(0, 0, 0)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   466
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   467
/* #undef DEBUG /* */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   468
/* #define DEBUG_WM_MOUSEENTER  /* */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   469
/* #define DEBUG_WM_MOUSELEAVE  /* */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   470
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   471
#ifdef DEBUG
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   472
# define PRINTF(x)              { printf x;}
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   473
# define CPRINTF(x)             { if (__debug__ > 1) printf x;}
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   474
# define RESPRINTF(x)           /*{ if (__debug__) printf x;}*/
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   475
# define RES1PRINTF(x)          /*{ if (__debug__) printf x;}*/
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   476
# 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
   477
# define TH_DPRINTF(x)          /*{ if (__debug__) printf x;}*/
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   478
# define DPRINTF(x)             { if (__debug__) printf x;}
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   479
# define DDPRINTF(x)            { if (__debug__ > 1) printf x;}
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
   480
# define EVENT_PRINTF(x)        { if (__debug__) printf x;}
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
   481
# define EVENT_PRINTF2(x)       { if (__debug__ > 1) printf x;}
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   482
# define EVENT_PRINTF3(x)       /* */
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   483
# define UNHANDLED_EVENT_PRINTF(x)  { if (__debug__) printf x;}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   484
#else
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   485
# define PRINTF(x)              /* */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   486
# define CPRINTF(x)             /* */
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   487
# define RES_BMP_PRINTF(x)      /* */
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   488
# define RESPRINTF(x)           /* */
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   489
# define RES1PRINTF(x)          /* */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   490
# define TH_DPRINTF(x)          /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   491
# define DPRINTF(x)             /* */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   492
# define DDPRINTF(x)            /* */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   493
# define EVENT_PRINTF(x)        /* */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   494
# define EVENT_PRINTF2(x)       /* */
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   495
# define EVENT_PRINTF3(x)       /* */
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   496
# define UNHANDLED_EVENT_PRINTF(x)        /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   497
#endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   498
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
   499
/* # define EVENT_PRINTF(x)        { printf x;} */
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
   500
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   501
#define INFOPRINT(__x__)                 \
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   502
    if (@global(InfoPrinting) == true) { \
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
   503
	fprintf __x__;           \
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   504
    }
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   505
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
   506
#define DEBUGPRINT(__x__)                 \
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
   507
    if (@global(InfoPrinting) == true) { \
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
   508
	fprintf __x__;           \
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
   509
    }
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
   510
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   511
#define BR_SOLID       0
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   512
#define BR_PATTERN     1
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   513
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   514
#define LINE_SOLID     0
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   515
#define LINE_DASH      1
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   516
#define LINE_DDASH     2
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   517
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   518
#ifdef KEEP_STD_CURSORS
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   519
# define _C_ARROW       1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   520
# define _C_CROSS       2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   521
# define _C_IBEAM       3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   522
# define _C_ICON        4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   523
# define _C_NO          5
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   524
# define _C_SIZE        6
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   525
# define _C_SIZEALL     7
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   526
# define _C_SIZENESW    8
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   527
# define _C_SIZENS      9
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   528
# define _C_SIZENWSE    10
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   529
# define _C_UPARROW     11
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   530
# define _C_WAIT        12
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   531
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   532
 static HCURSOR H_C_ARROW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   533
 static HCURSOR H_C_CROSS = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   534
 static HCURSOR H_C_IBEAM = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   535
 static HCURSOR H_C_ICON = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   536
 static HCURSOR H_C_NO = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   537
 static HCURSOR H_C_SIZE = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   538
 static HCURSOR H_C_SIZEALL = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   539
 static HCURSOR H_C_SIZENESW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   540
 static HCURSOR H_C_SIZENS = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   541
 static HCURSOR H_C_SIZENWSE = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   542
 static HCURSOR H_C_UPARROW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   543
 static HCURSOR H_C_WAIT = (HCURSOR)0;
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
   544
 static HCURSOR H_C_APPSTARTING = (HCURSOR)0;
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   545
#endif /* KEEP_STD_CURSORS */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   546
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   547
#ifdef EXIT_WITH_3_CTRL_Cs
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
   548
static int ctrl_c_count = 0;            /* CTRL-C count */
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
   549
#endif
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
   550
#ifdef RELEASE_CAPTURE_WITH_3_ESCAPEs
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
   551
static int escape_count = 0;            /* ESCAPE count */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   552
#endif
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   553
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   554
static int evRootX, evRootY;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   555
static int multiClickState;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   556
static UINT lastMSGTime;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   557
static UINT lastMouseWheelTime = 0;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   558
static int lastClickX, lastClickY;
3584
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
   559
static int lastMotionX = -9999, lastMotionY = -9999;
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
   560
static HWND lastMotionWnd = 0;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   561
static int deltaDoubleClickX = -999;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   562
static int deltaDoubleClickY = -999;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   563
static UINT nextMultiClickTime;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   564
static int inSizeMove = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   565
static int inSize = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   566
static int inMove = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   567
static HWND needDelayedMouseLeaveWindow = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   568
static HWND needDelayedMouseEnterWindow = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   569
static int delayedMouseEnterX, delayedMouseEnterY;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   570
static int destroyWin;
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   571
static HDC   __tmpDC;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   572
#ifdef CACHE_LAST_TMP_FONT
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   573
static HFONT __tmpDC_hfont = 0, __tmpDC_prev_hfont = 0;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   574
#endif
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   575
static int __isWinNT = 0;
3951
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
   576
static int __isWinNT_NEW_BEHAVIOUR = 0;
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
   577
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   578
static int __isWinXP = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   579
static int __logPixelSY;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   580
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
   581
static int NUM_PEN_CACHED   = NUM_PEN_CACHED_W95;       /* that many solid pens are globally remembered */
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
   582
static int NUM_BRUSH_CACHED = NUM_BRUSH_CACHED_W95;     /* that many brushes are globally remembered */
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
   583
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   584
#ifdef CACHE_LAST_DC
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   585
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
   586
static int            lastGcOwnerThreadID = 0;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   587
static HWND           lastGcHWIN;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   588
static HBITMAP        lastGcHBITMAP;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   589
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   590
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   591
#ifndef __rootDC
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   592
 static HDC __rootDC;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   593
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   594
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   595
#ifdef CACHE_PEN
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   596
struct __penCache {
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   597
    HPEN            pen;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   598
    int             clr;
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
   599
} __penCache[MAX_NUM_PEN_CACHED];
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   600
#endif
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   601
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   602
#ifdef CACHE_BRUSH
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   603
struct __brushCache {
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   604
    HBRUSH          brush;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   605
    int             clr;
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
   606
} __brushCache[MAX_NUM_BRUSH_CACHED];
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   607
#endif
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   608
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   609
/*
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   610
 * globally cached - never released
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   611
 */
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   612
static HPEN __blackPen = 0;
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   613
static HPEN __whitePen = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   614
static HPEN __nullPen = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   615
static HBRUSH __blackBrush = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   616
static HBRUSH __whiteBrush = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   617
2620
519011e49878 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2619
diff changeset
   618
static HPEN __bgPen = 0;
519011e49878 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2619
diff changeset
   619
static int __bgPenColor = 0;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   620
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   621
#define WM_THREAD_CREATEWINDOW   WM_USER + 0x101
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   622
#define WM_THREAD_DESTROYWINDOW  WM_USER + 0x102
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   623
#define WM_THREAD_SETFOCUS       WM_USER + 0x103
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   624
#define WM_THREAD_SETCAPTURE     WM_USER + 0x104
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   625
#define WM_THREAD_SETCURSOR      WM_USER + 0x105
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   626
#define WM_THREAD_BEEP           WM_USER + 0x106
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   627
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   628
#define hasEventQueued() (eventQueueHead != NULL)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   629
#define EVENT_THREAD_STACKSIZE  (4096*6)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   630
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   631
typedef int (*intf)(int);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   632
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   633
/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   634
 * 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
   635
 */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   636
#define LI_TOPWIN       0x0001
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   637
#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
   638
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   639
typedef struct {
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   640
	HCURSOR  hCursor;
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
   641
	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
   642
	COLORREF viewBgColor;
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   643
	int      eventMask;
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   644
	short    flag;
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   645
	short    minWidth;
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   646
	short    maxWidth;
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   647
	short    minHeight;
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   648
	short    maxHeight;
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   649
	short    bw;
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   650
	unsigned char    iconified;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   651
	unsigned char    viewGravity;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   652
	unsigned char    unmapping;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   653
#if 0
2665
4b88034ccb36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2664
diff changeset
   654
	short    bgOffsX;      /* bg-pattern offset */
4b88034ccb36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2664
diff changeset
   655
	short    bgOffsY;      /* bg-pattern offset */
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   656
#endif
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   657
	short    mouseX;       /* last mouseX */
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   658
	short    mouseY;       /* last mouseY */
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   659
	COLORREF bdColor;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   660
} localWindowInfo;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   661
typedef localWindowInfo *plocalWindowInfo;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   662
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   663
typedef struct createWindowInfo {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   664
	localWindowInfo *localWindowInfo;  /* in param */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   665
	HANDLE          newWinHandle;      /* out param */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   666
	char            *windowName;       /* in params */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   667
	char            *className;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   668
	int             winStyleBits;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   669
	int             winStyleBitsEx;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   670
	HANDLE          parentHandle;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   671
	int             x;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   672
	int             y;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   673
	int             dx;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   674
	int             dy;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   675
	HANDLE          hCreateEvent;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   676
	short           infoWasRead;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   677
	unsigned short  sequenceNr;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   678
} createWindowInfo;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   679
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   680
#define INVALIDATED_CWI 0xFFFF             /* seqNr for invalidated CWI */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   681
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   682
static createWindowInfo *pendingCREATEWINDOWInfo = 0;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   683
static unsigned short pendingSequenceNr = INVALIDATED_CWI;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   684
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   685
#define N_WINDOW_PRIVATE (sizeof(plocalWindowInfo))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   686
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   687
#define GETLOCALWINDOWINFOPTR(__hWnd__) \
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   688
	((localWindowInfo *)GetWindowLong(__hWnd__, 0))
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   689
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   690
#define SETLOCALWINDOWINFOPTR(__hWnd__,__ptr__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   691
	SetWindowLong(__hWnd__, 0 , (DWORD)__ptr__)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   692
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   693
#define SetWindow_Cursor(__hWnd__, __hCurs__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   694
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor = __hCurs__) : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   695
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   696
#define GetWindow_Cursor(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   697
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   698
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   699
#define SetWindow_viewBgColor(__hWnd__, __viewBgColor__) \
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   700
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgColor = __viewBgColor__) : 0)
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   701
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   702
#define GetWindow_viewBgColor(__hWnd__) \
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   703
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgColor : 0)
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   704
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   705
#define SetWindow_bdColor(__hWnd__, __bdColor__) \
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   706
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->bdColor = __bdColor__) : 0)
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   707
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   708
#define GetWindow_bdColor(__hWnd__) \
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   709
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->bdColor : 0)
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   710
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   711
#define SetWindow_iconified(__hWnd__, __iconified__) \
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   712
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->iconified = __iconified__) : 0)
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   713
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   714
#define GetWindow_iconified(__hWnd__) \
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   715
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->iconified : 0)
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   716
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   717
#define SetWindow_unmapping(__hWnd__, __unmapping__) \
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   718
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->unmapping = __unmapping__) : 0)
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   719
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   720
#define GetWindow_unmapping(__hWnd__) \
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   721
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->unmapping : 0)
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   722
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   723
#define SetWindow_mouseX(__hWnd__, __mouseX__) \
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   724
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->mouseX = __mouseX__) : 0)
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   725
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   726
#define GetWindow_mouseX(__hWnd__) \
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   727
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->mouseX : 0)
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   728
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   729
#define SetWindow_mouseY(__hWnd__, __mouseY__) \
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   730
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->mouseY = __mouseY__) : 0)
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   731
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   732
#define GetWindow_mouseY(__hWnd__) \
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   733
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->mouseY : 0)
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   734
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   735
#define SetWindow_mouseXY(__hWnd__, __mouseX__, __mouseY__) \
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   736
	{ SetWindow_mouseX(__hWnd__, __mouseX__); SetWindow_mouseY(__hWnd__, __mouseY__); }
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   737
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   738
#define SetWindow_viewBgBrush(__hWnd__, __viewBgBrush__) \
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   739
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgBrush = __viewBgBrush__) : 0)
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   740
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   741
#define GetWindow_viewBgBrush(__hWnd__) \
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   742
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgBrush : 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   743
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   744
#define SetWindow_bw(__hWnd__, __bw__) \
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   745
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->bw = __bw__) : 0)
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   746
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   747
#define GetWindow_bw(__hWnd__) \
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   748
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->bw : 0)
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   749
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   750
#define GetWindow_paintInfoPtr(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   751
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->paintInfo) : 0)
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   752
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   753
#define GetWindow_sizeInfoPtr(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   754
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->sizeInfo) : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   755
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   756
#define SetWindow_flag(__hWnd__, __flag__) \
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   757
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->flag = __flag__) : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   758
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   759
#define GetWindow_flag(__hWnd__) \
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   760
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->flag : 0)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   761
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   762
#define GetWindow_eventMask(__hWnd__) \
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   763
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->eventMask) : 0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   764
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   765
struct queuedEvent {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   766
	struct queuedEvent     *ev_next;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   767
	int                     count;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   768
	int                     ev_flag;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   769
	HWND                    ev_hWnd;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   770
	UINT                    ev_message;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   771
	UINT                    ev_wParam;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   772
	int                     ev_arg1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   773
	int                     ev_arg2;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   774
	int                     ev_arg3;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   775
	int                     ev_arg4;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   776
	UINT                    ev_time;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   777
};
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   778
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   779
#define ev_x    ev_arg1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   780
#define ev_y    ev_arg2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   781
#define ev_w    ev_arg3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   782
#define ev_h    ev_arg4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   783
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   784
#define ev_keyCode   ev_wParam
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   785
#define ev_scanCode  ev_arg3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   786
#define ev_modifiers ev_arg4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   787
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   788
#define EV_CHUNK_CNT    10000
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   789
#define xxEV_CHUNK_CNT    1000
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   790
#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
   791
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   792
#define BITBLT_COPY             SRCCOPY
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   793
#define BITBLT_COPYINVERTED     NOTSRCCOPY
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   794
#define BITBLT_XOR              SRCINVERT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   795
#define BITBLT_AND              SRCAND
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   796
#define BITBLT_OR               SRCPAINT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   797
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   798
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   799
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   800
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   801
!WinWorkstation primitiveVariables!
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   802
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   803
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   804
static int firstInstance = 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   805
static char *app_name = "ST/X";
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   806
static char *app_nameRoot = "ST/X:Root";
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   807
static char *app_namePopup = "ST/X:Popup";
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   808
static char *app_nameDialog = "ST/X:Dialog";
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   809
static int __debug__ = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   810
static int __depth;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   811
static int __realDepth;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   812
static HWND __rootWin = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   813
static HWND __rootWinSpezial = NULL;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   814
#if 0
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   815
static HDESK __rootDesk;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   816
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   817
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   818
static int __activateOnClick = 1;
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   819
static int __focusFollowsMouse = 0;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   820
static int __eatingMouseEvents = 0;
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   821
static int __ignoreButtonPressOnActivate = 0;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   822
static int __rightButtonIsLowerWindow = 1;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   823
static int __shiftedLeftButtonIsLowerWindow = 1;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   824
static int __currentCapture = CAPTURE_NONE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   825
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   826
static HANDLE __currentPointerView = (HANDLE)0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   827
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   828
/* MessageDispatchThread */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   829
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   830
#ifndef WIN32THREADS
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   831
static DWORD _masterThreadId;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   832
static HANDLE _masterThread;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   833
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   834
static DWORD _dispatchThreadId = 0;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
   835
#ifdef LOCK_DEBUG
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   836
static int lockcountQ = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   837
static int lockcountF = 0;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
   838
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   839
static HANDLE hEventQMutex;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   840
static HANDLE hEventFreeListMutex;
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   841
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
   842
#ifdef USE_PAINT_MUTEX
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
   843
static HANDLE hPaintMutex;
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   844
# define AQUIRE_PAINT_MUTEX    { WaitForSingleObject(hPaintMutex, 100L); }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   845
# define RELEASE_PAINT_MUTEX   { ReleaseMutex(hPaintMutex);              }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   846
#else
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   847
# define AQUIRE_PAINT_MUTEX    { /* nothing */ }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   848
# define RELEASE_PAINT_MUTEX   { /* nothing */ }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   849
#endif
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   850
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   851
#ifdef USE_DRAW_MUTEX
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   852
static HANDLE hDrawMutex;
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   853
# define AQUIRE_DRAW_MUTEX     { WaitForSingleObject(hDrawMutex, 100L);  }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   854
# define RELEASE_DRAW_MUTEX    { ReleaseMutex(hDrawMutex);  }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   855
#else
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   856
# define AQUIRE_DRAW_MUTEX     { /* nothing */ }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   857
# define RELEASE_DRAW_MUTEX    { /* nothing */ }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   858
#endif
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   859
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   860
static HANDLE hCreateEvent;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   861
static HANDLE hNeverTriggered;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   862
static HANDLE hInputEvent;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   863
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   864
#ifdef COUNT_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   865
 static int __cnt_gcData;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   866
 static int __cnt_createWindows;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   867
 static int __cnt_cur;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   868
 static int __cnt_font;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   869
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   870
#ifdef COUNT_BMP_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   871
 static int __cnt_bitmap;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   872
#endif
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   873
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
   874
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
   875
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
   876
/*
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
   877
 * 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
   878
 * 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
   879
 */
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   880
#define NUMQUICKFREE_EV    32
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
   881
static struct queuedEvent *quickFreeEvent[NUMQUICKFREE_EV+1];
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
   882
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
   883
static struct queuedEvent *eventQueueTail = (struct queuedEvent *)0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   884
static int eventsendcount = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   885
static int eventempfcount = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   886
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
   887
/*
2754
21cbbc8fbe09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   888
 * up to NUM_FREE_GC gc's are kept in a local list
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   889
 * (away from free/malloc)
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   890
 */
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   891
#define NUM_FREE_GC     50
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   892
static struct gcData *gcDataFreeList = (struct gcData *)0;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   893
static int gcDataNumFree = 0;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   894
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   895
/*
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
   896
 * remember the last background-paint brush
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
   897
 * will be reused by next bg-paint, if it needs
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
   898
 * the same color. Otherwise, the next bg-erase
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
   899
 * will destroy this brush.
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
   900
 */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   901
#ifdef CACHE_LAST_WM_PAINT_BRUSH
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
   902
 static HBRUSH last_wm_paint_brush = (HBRUSH) 0;
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
   903
 static int    last_wm_paint_brush_clr = (HWND) 0;
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
   904
#endif
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
   905
#ifdef CACHE_LAST_WM_PAINT_DC
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
   906
 static HWND last_wm_paint_win = 0;
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
   907
 static HDC  last_wm_paint_dc = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   908
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   909
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
   910
#ifdef COMPRESS_WINDOWPOSCHANGED
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
   911
 static HWND lastPos_win = 0;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
   912
 static int lastPos_w;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
   913
 static int lastPos_h;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
   914
 static int lastPos_x;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
   915
 static int lastPos_y;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
   916
#endif
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
   917
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   918
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   919
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   920
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   921
!WinWorkstation primitiveFunctions!
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   922
%{
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   923
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   924
#ifdef xxWIN32THREADS
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   925
extern void __suspendAktThread();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   926
extern void __resumeAktThread();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   927
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   928
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   929
__debugEvent__() {}
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   930
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   931
#ifdef DEBUGMASK
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   932
static void
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   933
printMask(int mask) {
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   934
	if (mask & KeyPressMask)        printf("KeyPressMask\n");
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   935
	if (mask & KeyReleaseMask)      printf("KeyReleaseMask\n");
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   936
	if (mask & ButtonPressMask)     printf("ButtonPressMask\n");
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   937
	if (mask & ButtonReleaseMask)   printf("ButtonReleaseMask\n");
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   938
	if (mask & ButtonMotionMask)    printf("ButtonMotionMask\n");
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   939
	if (mask & PointerMotionMask)   printf("PointerMotionMask\n");
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   940
	if (mask & ExposureMask)        printf("ExposureMask\n");
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   941
	if (mask & FocusChangeMask)     printf("FocusChangeMask\n");
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   942
	if (mask & EnterWindowMask)     printf("EnterWindowMask\n");
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   943
	if (mask & LeaveWindowMask)     printf("LeaveWindowMask\n");
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   944
	if (mask & KeymapStateMask)     printf("KeymapStateMask\n");
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   945
	if (mask & VisibilityChangeMask)printf("VisibilityChangeMask\n");
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   946
	if (mask & StructureNotifyMask) printf("StructureNotifyMask\n");
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   947
	if (mask & ResizeRedirectMask)  printf("ResizeRedirectMask\n");
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   948
	if (mask & PropertyChangeMask)  printf("PropertyChangeMask\n");
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   949
	if (mask & ColormapChangeMask)  printf("ColormapChangeMask\n");
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   950
}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   951
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   952
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   953
static int
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   954
st2RGB(color, gcData)
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   955
    int color;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   956
    struct gcData *gcData;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   957
{
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   958
	int ir,ig,ib;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   959
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   960
	if (gcData) {
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   961
	    if (gcData->bitmapColorBitCount == 1) {
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   962
	      if (color)
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   963
		  return WhitePixel;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   964
	      else
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   965
		  return BlackPixel;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   966
	    }
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   967
	}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   968
#ifdef ALWAYSTRUECOLOR
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   969
	return (color & 0xffffff);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   970
#else
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   971
	if (__depth < 15) {
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   972
	    return 0;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   973
	} else {
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   974
	    if ((__depth == 16) || (__depth == 15)) {
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   975
		ib = (color & 0x1f) << 3;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   976
		ig = ((color >> 5) & 0x3f) << 2;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   977
		ir = ((color >> 11) & 0x1f) << 3;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   978
		ir |= 7;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   979
		ig |= 3;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   980
		ib |= 7;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   981
		return RGB(ir,ig,ib);
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   982
	    }
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   983
	    return (color & 0xffffff);
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   984
	}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   985
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   986
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   987
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   988
static int
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   989
RGB2st(r, g, b)
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   990
    int r, g, b;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   991
{
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   992
	int ir,ig,ib,id;
2418
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
   993
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   994
#ifdef ALWAYSTRUECOLOR
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   995
	ir = (r >> 8) & 0xff;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   996
	ig = (g >> 8) & 0xff;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   997
	ib = (b >> 8) & 0xff;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   998
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
   999
	id = RGB( ir, ig, ib);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  1000
#else
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1001
	if (__depth < 15) {
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1002
	    id = 0;
2418
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
  1003
	} else {
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1004
	    if ((__depth == 16) || (__depth == 15)) {
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1005
		ir = (r >> 11) & 0x1f;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1006
		ig = (g >> 10) & 0x3f;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1007
		ib = (b >> 11) & 0x1f;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1008
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1009
		id = ( ir << 11 ) | ( ig << 5 ) | ib;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1010
	    } else {
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1011
		ir = (r >> 8) & 0xff;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1012
		ig = (g >> 8) & 0xff;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1013
		ib = (b >> 8) & 0xff;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1014
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1015
		id = RGB( ir, ig, ib);
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1016
	    }
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1017
	}
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1018
#endif
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1019
	return id;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1020
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1021
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1022
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1023
/*
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1024
 * return a windows top-window
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1025
 */
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1026
static HWND
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1027
GetTopParent(hWnd)
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1028
    HWND hwnd;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1029
{
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1030
	HWND lastParent = hWnd;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1031
	HWND nextParent;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1032
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1033
	while (nextParent = GetParent(lastParent)) {
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1034
	    lastParent = nextParent;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1035
	}
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  1036
	return lastParent;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1037
}
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1038
#endif
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1039
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1040
#ifdef DEBUG_DELETEOBJECT
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1041
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1042
static int
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1043
_DeleteObject(o, lineNr)
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1044
    HANDLE o;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1045
{
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1046
    int r = DeleteObject(o);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1047
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1048
    if (r == 0)
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  1049
	fprintf(stderr, "WinWorkstation [warning]: ERROR in DeleteObject %x [%d]\n", o, lineNr);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1050
    return r;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1051
}
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1052
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1053
#else
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1054
# define _DeleteObject(o,lnr)  DeleteObject(o)
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1055
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1056
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1057
static void
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1058
_DeleteFont(f, lineNr)
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1059
    HFONT f;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1060
{
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1061
#ifdef CACHE_LAST_TMP_FONT
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1062
    if (f == __tmpDC_hfont) {
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1063
	SelectObject(__tmpDC, __tmpDC_prev_hfont);
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1064
	__tmpDC_hfont = NULL;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1065
    }
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1066
#endif
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1067
    _DeleteObject(f, lineNr);
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1068
}
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1069
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1070
static int
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1071
_DeleteBrush(br, lineNr)
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1072
    HBRUSH br;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1073
{
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1074
    int r;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1075
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1076
    if ((br != __whiteBrush)
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1077
     && (br != __blackBrush)) {
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1078
	r = DeleteObject(br);
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1079
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1080
	if (r == 0)
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  1081
	    fprintf(stderr, "WinWorkstation [warning]: ERROR in DeleteBrush %x [%d]\n", br, lineNr);
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1082
	return r;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1083
    }
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1084
    return 1;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1085
}
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1086
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1087
static int
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1088
_DeletePen(p, lineNr)
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1089
    HPEN p;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1090
{
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1091
    int r;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1092
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1093
    if ((p != __whitePen)
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1094
     && (p != __blackPen)) {
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1095
	r = DeleteObject(p);
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1096
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1097
	if (r == 0)
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  1098
	    fprintf(stderr, "WinWorkstation [warning]: ERROR in DeletePen %x [%d]\n", p, lineNr);
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1099
	return r;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1100
    }
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1101
    return 1;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1102
}
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1103
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1104
#ifdef CACHE_PEN
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1105
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1106
static int
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1107
_DeletePenIfNotInCache(p, lineNr)
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1108
    HPEN p;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1109
{
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1110
    int i, r;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1111
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1112
    if ((p == __whitePen)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1113
     || (p == __blackPen)) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1114
	return 1; /* not deleted, but OK */
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1115
    }
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1116
    for (i=0; i<NUM_PEN_CACHED;i++) { 
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1117
	if (__penCache[i].pen == p) { 
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1118
	    return 1; /* not deleted, but OK */
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1119
	}
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1120
    } 
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1121
    r = DeleteObject(p);
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1122
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1123
    if (r == 0)
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  1124
	fprintf(stderr, "WinWorkstation [warning]: ERROR in DeletePen2 %x [%d]\n", p, lineNr);
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1125
    return r;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1126
}
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1127
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1128
#else
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1129
# define _DeletePenIfNotInCache(p, lineNr)   _DeletePen(p, lineNr)
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1130
#endif /* CACHE_PEN */
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1131
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1132
#ifdef CACHE_BRUSH
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1133
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1134
static int
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1135
_DeleteBrushIfNotInCache(p, lineNr)
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1136
    HPEN p;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1137
{
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1138
    int i, r;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1139
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1140
    for (i=0; i<NUM_BRUSH_CACHED;i++) { 
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1141
	if (__brushCache[i].brush == p) { 
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1142
	    return 1; /* not deleted, but OK */
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1143
	}
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1144
    } 
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1145
    if ((p == __whiteBrush)
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1146
     || (p == __blackBrush)) {
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1147
	return 1; /* not deleted, but OK */
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1148
    }
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1149
    r = DeleteObject(p);
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1150
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1151
    if (r == 0)
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  1152
	fprintf(stderr, "WinWorkstation [warning]: ERROR in DeleteBrush2 %x [%d]\n", p, lineNr);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1153
    return r;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1154
}
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1155
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1156
#else
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1157
# define _DeleteBrushIfNotInCache(p, lineNr)   _DeleteBrush(p, lineNr)
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1158
#endif /* CACHE_BRUSH */
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1159
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1160
static struct gcData *
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1161
newGcData() {
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1162
    struct gcData *gcData;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1163
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1164
    if (gcDataFreeList) {
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1165
	gcData = gcDataFreeList;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1166
	gcDataFreeList = gcData->u.__nextFree;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1167
	gcDataNumFree--;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1168
    } else {
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1169
	gcData = (struct gcData *) malloc(sizeof(struct gcData));
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1170
	if (! gcData) {
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1171
	    fprintf(stderr, "WinWorkstat [warning]: failed to allocate gcData\n");
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1172
	    return 0;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1173
	}
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1174
    }
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1175
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1176
    memset(gcData, 0, sizeof(struct gcData));
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  1177
    gcData->fgColor = 0xffffff;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1178
    /* gcData->bgColor = 0; - not needed - memset does it */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1179
    gcData->clipping = FALSE;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1180
    gcData->clipByChildren = TRUE;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1181
    gcData->bitbltrop2 = BITBLT_COPY;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1182
    gcData->lineWidth = 1;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1183
    gcData->lStyle = PS_SOLID | PS_JOIN_MITER | PS_ENDCAP_FLAT;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1184
    /* 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
  1185
    /* 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
  1186
    /* gcData->hBrush = 0; - not needed - memset does it */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1187
    return gcData;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1188
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1189
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1190
static void
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1191
freeGcData(gcData)
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1192
    struct gcData *gcData;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1193
{
2754
21cbbc8fbe09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
  1194
    if (gcDataNumFree < NUM_FREE_GC) {
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1195
	gcData->u.__nextFree = gcDataFreeList;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1196
	gcDataFreeList = gcData;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1197
	gcDataNumFree++;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1198
    } else {
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1199
	free(gcData);
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1200
    }
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1201
}
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1202
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1203
#ifdef CACHE_LAST_DC
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1204
# 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
  1205
    if (lastGcData == __gcData__) {  \
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1206
	_releaseDC(lastGcData);      \
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1207
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1208
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1209
# 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
  1210
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1211
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1212
#ifdef CACHE_LAST_PEN
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1213
# 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
  1214
    if (__gcData__->hPen) {           \
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1215
	if (__gcData__->save_hPen) {  \
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1216
	    SelectObject(__gcData__->_hDC, __gcData__->save_hPen); \
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1217
	    __gcData__->save_hPen = 0;   \
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1218
	} \
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1219
	_DeletePenIfNotInCache(__gcData__->hPen, __LINE__); \
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1220
	__gcData__->hPen = 0; \
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1221
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1222
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1223
# 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
  1224
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1225
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1226
#ifdef CACHE_LAST_BRUSH
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1227
# 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
  1228
    if (__gcData__->hBrush) {           \
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1229
	if (__gcData__->save_hBrush) {  \
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1230
	    SelectObject(__gcData__->_hDC, __gcData__->save_hBrush); \
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1231
	    __gcData__->save_hBrush = 0;   \
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1232
	} \
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1233
	_DeleteBrushIfNotInCache(__gcData__->hBrush, __LINE__); \
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1234
	__gcData__->hBrush = 0; \
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1235
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1236
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1237
# 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
  1238
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1239
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1240
static void
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1241
_releaseDC(gcData)
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1242
    struct gcData *gcData;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1243
{
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1244
    HDC hDC = gcData->_hDC;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1245
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1246
    if (gcData->save_hPen) {
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1247
	SelectObject(hDC, gcData->save_hPen);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1248
	gcData->save_hPen = 0;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1249
    }
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1250
    if (gcData->save_hBrush) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1251
	SelectObject(hDC, gcData->save_hBrush);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1252
	gcData->save_hBrush = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1253
    }
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1254
    if (gcData->save_hFont) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1255
	SelectObject(hDC, gcData->save_hFont);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1256
	gcData->save_hFont = 0;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1257
    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1258
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1259
    if (gcData->hWnd) {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1260
	if (hDC) {
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1261
	    ReleaseDC(gcData->hWnd, hDC);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1262
#ifdef CACHE_LAST_WM_PAINT_DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1263
	    if (hDC == last_wm_paint_dc) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1264
		last_wm_paint_dc = last_wm_paint_win = 0;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  1265
# ifdef DEBUG_DC_REUSE
3126
5447d8c1d8d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3119
diff changeset
  1266
		fprintf(stderr, "WinWorkstation [info]: Oops - releasing bg_paint-dc\n");
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  1267
# endif
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1268
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1269
#endif
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1270
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1271
    } else if (gcData->hBitmap) {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1272
	SelectObject(hDC, gcData->save_hBitmap);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1273
	DeleteDC(hDC);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1274
    }
2383
9a5be0903b57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2378
diff changeset
  1275
    gcData->_hDC = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1276
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1277
#ifdef CACHE_LAST_DC
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1278
    if (lastGcData == gcData) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1279
	lastGcData = 0;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1280
    }
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1281
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1282
#ifdef CACHE_LAST_PEN
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1283
    if (gcData->hPen) {
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1284
	_DeletePenIfNotInCache(gcData->hPen, __LINE__);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1285
	gcData->hPen = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1286
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1287
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1288
#ifdef CACHE_LAST_BRUSH
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1289
    if (gcData->hBrush) {
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1290
	_DeleteBrushIfNotInCache(gcData->hBrush, __LINE__);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1291
	gcData->hBrush = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1292
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1293
#endif
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1294
}
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1295
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1296
static HDC
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1297
_getDC(gcData)
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1298
    struct gcData *gcData;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1299
{
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1300
    HDC hDC;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1301
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1302
#ifdef CACHE_LAST_DC
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  1303
    int currThreadId = GetCurrentThreadId();
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  1304
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1305
    if (lastGcData) {
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1306
	if ((lastGcData == gcData)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1307
	 && (lastGcHWIN == gcData->hWnd)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1308
	 && (lastGcHBITMAP == gcData->hBitmap)
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  1309
	 && (lastGcOwnerThreadID == currThreadId) 
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1310
	 && gcData->_hDC 
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  1311
	) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1312
	    //printf(".");
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1313
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1314
# ifdef CACHE_LAST_WM_PAINT_DC /* DDD */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1315
	    if (last_wm_paint_dc == gcData->_hDC) {
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
  1316
#  ifdef DEBUG_DC_REUSE
3126
5447d8c1d8d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3119
diff changeset
  1317
		fprintf(stderr, "WinWorkstation [info]: Oops wm_paint_dc reuse [%d]\n", __LINE__);
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
  1318
#  endif
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1319
		last_wm_paint_dc = last_wm_paint_win = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1320
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1321
# endif
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1322
	    return gcData->_hDC;
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1323
	}
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  1324
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1325
	_releaseDC(lastGcData);
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1326
	lastGcData = 0;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1327
    }
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1328
#endif
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1329
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1330
    hDC = 0;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1331
    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
  1332
	if (__isWinNT && (gcData->hWnd == __rootWin)) {
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1333
	    hDC = gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_WINDOW);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1334
	    //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
  1335
	} else {
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1336
	    if (gcData->clipByChildren) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1337
		//gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_CLIPCHILDREN);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1338
		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
  1339
	    } else
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1340
		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
  1341
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1342
    } else if (gcData->hBitmap) {
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1343
	hDC = gcData->_hDC = CreateCompatibleDC(__tmpDC);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1344
	gcData->save_hBitmap = SelectObject(gcData->_hDC,gcData->hBitmap);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1345
    }
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1346
    gcData->bkMode = BK_UNDEF;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1347
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1348
    if (hDC) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1349
#if 0
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1350
	SetTextColor(hDC, gcData->bgColor);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1351
	SetBkColor(hDC, gcData->fgColor);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1352
#else
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1353
	SetTextColor(hDC, gcData->fgColor);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1354
	SetBkColor(hDC, gcData->bgColor);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1355
#endif
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  1356
	if (gcData->rop2) 
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1357
	    SetROP2(hDC, gcData->rop2);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1358
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1359
	if (gcData->clipping) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1360
	    HRGN region = CreateRectRgn( gcData->clipX, gcData->clipY,
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1361
					 gcData->clipX + gcData->clipW,
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1362
					 gcData->clipY + gcData->clipH);
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1363
	    if (region == NULL ) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  1364
		fprintf(stderr, "WinWorkstat [warning]: clipping region creation failed\n");
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1365
	    } else {
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1366
		if (SelectClipRgn(hDC, region) == ERROR ) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  1367
		    DPRINTF(("WinWorkstat [warning]: select clipping region failed\n" ));
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1368
		}
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1369
		_DeleteObject(region, __LINE__);
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1370
	    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1371
	} else {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1372
	    SelectClipRgn(hDC, NULL);
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1373
	}
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1374
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1375
	if (gcData->hFont) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1376
	    HFONT prevFont;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1377
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1378
	    prevFont = SelectObject(hDC, gcData->hFont);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1379
	    if (! gcData->save_hFont) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1380
		gcData->save_hFont = prevFont;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1381
	    }
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1382
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1383
    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1384
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1385
#ifdef CACHE_LAST_DC
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1386
    lastGcData = gcData;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  1387
    lastGcOwnerThreadID = currThreadId;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1388
    lastGcHWIN = gcData->hWnd;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1389
    lastGcHBITMAP = gcData->hBitmap;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1390
    gcData->_hDC = hDC;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1391
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1392
# ifdef CACHE_LAST_WM_PAINT_DC /* DDD */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1393
    if (last_wm_paint_dc == hDC) {
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
  1394
#  ifdef DEBUG_DC_REUSE
3126
5447d8c1d8d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3119
diff changeset
  1395
	fprintf(stderr, "WinWorkstation [info]: Oops wm_paint_dc reuse [%d]\n", __LINE__);
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
  1396
#  endif
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1397
	last_wm_paint_dc = last_wm_paint_win = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1398
    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1399
# endif
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1400
#endif
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1401
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1402
    return hDC;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1403
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1404
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1405
static HBRUSH
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1406
GcDataGetBrush(hDC, gcData)
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1407
    HDC hDC;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1408
    struct gcData *gcData;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1409
{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1410
    HBRUSH hBrush = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1411
    HBRUSH prevBrush;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1412
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1413
#ifdef CACHE_LAST_BRUSH
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1414
    if (hBrush = gcData->hBrush) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1415
	if (! gcData->save_hBrush) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1416
	    gcData->save_hBrush = SelectObject(gcData->_hDC, hBrush);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1417
	}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1418
	return hBrush;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1419
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1420
#endif
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1421
    if (gcData->hMask) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1422
	hBrush = CreatePatternBrush(gcData->hMask);
2340
0712b35328f6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  1423
	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
  1424
	RESPRINTF(("CreatePatternBrush %x\n",gcData->hMask));
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1425
    } else {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1426
	if (gcData->fgColor == BlackPixel) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1427
	    hBrush = __blackBrush;
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1428
	} else if (gcData->fgColor == WhitePixel) {
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1429
	    hBrush = __whiteBrush;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1430
	} else {
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1431
#ifdef CACHE_BRUSH
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1432
	    {
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1433
		int i;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1434
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1435
		for (i=0; i<NUM_BRUSH_CACHED; i++) {
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1436
		    if (__brushCache[i].clr == gcData->fgColor) {
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1437
			hBrush = __brushCache[i].brush;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1438
			/*
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1439
			 * move it up in the cache
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1440
			 */
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1441
			if (i > 0) {
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1442
			    HBRUSH t = __brushCache[i-1].brush;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1443
			    int c = __brushCache[i-1].clr;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1444
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1445
			    __brushCache[i-1].brush = hBrush;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1446
			    __brushCache[i-1].clr = gcData->fgColor;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1447
			    __brushCache[i].brush = t;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1448
			    __brushCache[i].clr = c;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1449
			}
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1450
# ifdef CACHE_LAST_BRUSH
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1451
			prevBrush = SelectObject(gcData->_hDC, hBrush);
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1452
			if (! gcData->save_hBrush) {
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1453
			    gcData->save_hBrush = prevBrush;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1454
			}
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1455
			gcData->hBrush = hBrush;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1456
# endif
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1457
			return hBrush;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1458
		    }
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1459
		}
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1460
	    }
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1461
#endif /* BRUSH_CACHE */
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1462
	    hBrush = CreateSolidBrush(gcData->fgColor);
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1463
	    RESPRINTF(("CreateSolidBrush %x\n",gcData->fgColor));
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1464
	}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1465
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1466
    gcData->hBrush = hBrush;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1467
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1468
    prevBrush = SelectObject(gcData->_hDC, hBrush);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1469
    if (! gcData->save_hBrush) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1470
	gcData->save_hBrush = prevBrush;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1471
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1472
    return hBrush;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1473
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1474
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1475
#ifdef CACHE_LAST_BRUSH
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1476
# define GcDataReleaseBrush(hDC, gcData)  /* nothing*/
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1477
#else
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1478
static void
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1479
GcDataReleaseBrush(hDC, gcData)
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1480
    HDC hDC;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1481
    struct gcData *gcData;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1482
{
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1483
    HBRUSH hBrush;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1484
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1485
    hBrush = gcData->hBrush;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1486
    if (gcData->save_hBrush) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1487
	SelectObject(hDC, gcData->save_hBrush);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1488
	gcData->save_hBrush = NULL;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1489
    }
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1490
    _DeleteBrushIfNotInCache(hBrush, __LINE__); 
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1491
    gcData->hBrush = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1492
}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1493
#endif
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1494
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1495
static HPEN
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1496
GcDataGetPen(hDC, gcData)
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1497
    HDC hDC;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1498
    struct gcData *gcData;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1499
{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1500
    HPEN hPen = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1501
    HPEN prevPen;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1502
    LOGBRUSH Brush;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1503
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1504
#ifdef CACHE_LAST_PEN
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1505
    if (hPen = gcData->hPen) {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1506
	if (! gcData->save_hPen) {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1507
	    gcData->save_hPen = SelectObject(gcData->_hDC, hPen);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1508
	}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1509
	return hPen;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1510
    }
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1511
#endif
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1512
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1513
    if (((gcData->lStyle & PS_STYLE_MASK) == PS_SOLID)
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1514
     && (gcData->hMask == 0)
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1515
     && (gcData->lineWidth <= 1)) {
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1516
	if (gcData->fgColor == BlackPixel) {
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  1517
	    gcData->hPen = hPen = __blackPen;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  1518
	    prevPen = SelectObject(hDC, hPen);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1519
	    if (! gcData->save_hPen) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1520
		gcData->save_hPen = prevPen;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1521
	    }
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  1522
	    return hPen;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  1523
	}
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  1524
	if (gcData->fgColor == WhitePixel) {
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  1525
	    gcData->hPen = hPen = __whitePen;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  1526
	    prevPen = SelectObject(hDC, hPen);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1527
	    if (! gcData->save_hPen) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1528
		gcData->save_hPen = prevPen;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1529
	    }
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  1530
	    return hPen;
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1531
	}
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1532
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1533
#ifdef CACHE_PEN
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1534
	{
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1535
	    int i;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1536
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1537
	    for (i=0; i<NUM_PEN_CACHED; i++) {
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1538
		if (__penCache[i].clr == gcData->fgColor) {
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1539
		    hPen = __penCache[i].pen;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1540
		    /*
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1541
		     * move it up in the cache
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1542
		     */
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1543
		    if (i > 0) {
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1544
			HPEN t = __penCache[i-1].pen;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1545
			int c = __penCache[i-1].clr;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1546
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1547
			__penCache[i-1].pen = hPen;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1548
			__penCache[i-1].clr = gcData->fgColor;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1549
			__penCache[i].pen = t;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1550
			__penCache[i].clr = c;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1551
		    }
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1552
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  1553
		    gcData->hPen = hPen;
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1554
		    prevPen = SelectObject(hDC, hPen);
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1555
		    if (! gcData->save_hPen) {
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1556
			gcData->save_hPen = prevPen;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1557
		    }
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1558
		    return hPen;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1559
		}
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
  1560
	    }
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
  1561
	}
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1562
#endif /* PEN_CACHE */
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1563
    }
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1564
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1565
    if (__isWinNT) {
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1566
	int lw = gcData->lineWidth;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1567
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1568
	if (lw == 0) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1569
	    lw = 1;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1570
	}
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1571
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1572
	/*
2627
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1573
	 * 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
  1574
	 * 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
  1575
	 */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1576
	if (gcData->hMask) {
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1577
	    Brush.lbStyle = BS_PATTERN;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1578
	    Brush.lbHatch = (DWORD)gcData->hMask;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1579
	    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
  1580
	} else {
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1581
	    Brush.lbStyle = BS_SOLID;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1582
	    Brush.lbHatch = 0;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  1583
	    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
  1584
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1585
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1586
	hPen = ExtCreatePen(PS_GEOMETRIC | gcData->lStyle,
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1587
			    lw, /* gcData->lineWidth, */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1588
			    &Brush,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1589
			    0, 0);
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1590
	RESPRINTF(("ExtCreatePen1 %x %d(%d) %x %x\n",
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1591
			gcData->lStyle,
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  1592
			lw, gcData->lineWidth,
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1593
			gcData->fgColor, gcData->hMask));
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1594
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1595
	if (gcData->hMask) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1596
	    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
  1597
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1598
    } else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1599
	/*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1600
	 * 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
  1601
	 * 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
  1602
	 * 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
  1603
	 */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1604
	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
  1605
	    int ps = PS_GEOMETRIC;
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1606
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1607
	    if (gcData->hMask) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1608
		Brush.lbStyle = BS_PATTERN;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1609
		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
  1610
		Brush.lbColor = gcData->fgColor;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1611
	    } else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1612
		Brush.lbStyle = BS_SOLID;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1613
		Brush.lbHatch = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1614
		Brush.lbColor = gcData->fgColor;
2627
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1615
		if (gcData->lineWidth <= 1) {
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1616
		    ps = PS_COSMETIC;
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1617
		}
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1618
	    }
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1619
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1620
	    hPen = ExtCreatePen(ps | gcData->lStyle,
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1621
				gcData->lineWidth,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1622
				&Brush,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1623
				0, 0);
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1624
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1625
	    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
  1626
			    gcData->lStyle,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1627
			    gcData->lineWidth,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1628
			    gcData->fgColor, gcData->hMask));
2627
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1629
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1630
	    if (gcData->hMask) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1631
		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
  1632
	    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1633
	} else {
2627
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1634
	    int lw = gcData->lineWidth;
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1635
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1636
	    if (lw == 1) {
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1637
		lw = 0;
078c45050a69 dotted lines under WIN95 (lineWidth 0 & 1 only)
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1638
	    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1639
	    /*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1640
	     * 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
  1641
	     */
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1642
	    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
  1643
			     lw,
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1644
			     gcData->fgColor);
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1645
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1646
	    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
  1647
				(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
  1648
				gcData->lineWidth,
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1649
				gcData->fgColor));
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1650
2383
9a5be0903b57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2378
diff changeset
  1651
	    //
9a5be0903b57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2378
diff changeset
  1652
	    // CG: wrong; must set to opaque, if doubleDashed
9a5be0903b57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2378
diff changeset
  1653
	    //    
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1654
	    SetBkMode(hDC, TRANSPARENT);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1655
	    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
  1656
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1657
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1658
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1659
    gcData->hPen = hPen;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1660
    prevPen = SelectObject(hDC, hPen);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1661
    if (! gcData->save_hPen) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1662
	gcData->save_hPen = prevPen;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1663
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1664
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1665
#ifdef CACHE_PEN
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1666
    /*
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1667
     * remember in penCache
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1668
     */
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1669
    if (((gcData->lStyle & PS_STYLE_MASK) == PS_SOLID)
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1670
     && (gcData->hMask == 0)
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1671
     && (gcData->lineWidth <= 1)) {
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1672
	int i;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1673
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1674
	/*
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1675
	 * search for an empty slot
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1676
	 */
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1677
	for (i=0; i<NUM_PEN_CACHED; i++) {
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1678
	    if (__penCache[i].pen == 0) {
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1679
		__penCache[i].clr = gcData->fgColor;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1680
		__penCache[i].pen = hPen;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1681
		break;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1682
	    }
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1683
	}
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1684
	if (i == NUM_PEN_CACHED) {
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1685
	    /* 
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1686
	     * replace last in penCache
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1687
	     */
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1688
	    HPEN t = __penCache[NUM_PEN_CACHED - 1].pen;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1689
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1690
	    __penCache[NUM_PEN_CACHED - 1].pen = hPen;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1691
	    __penCache[NUM_PEN_CACHED - 1].clr = gcData->fgColor;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1692
	    _DeletePen(t, __LINE__);
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1693
	}
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1694
    }
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1695
#endif
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1696
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1697
    return hPen;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1698
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1699
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1700
#ifdef CACHE_LAST_PEN
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1701
# define GcDataReleasePen(hDC, gcData)  /* nothing*/
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1702
#else
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1703
static void
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1704
GcDataReleasePen(hDC, gcData)
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1705
    HDC hDC;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1706
    struct gcData *gcData;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1707
{
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1708
    HPEN hPen;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1709
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1710
    if (gcData->save_hPen) {
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1711
	SelectObject(hDC, gcData->save_hPen);
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1712
	gcData->save_hPen = NULL;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1713
    }
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1714
    hPen = gcData->hPen;
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1715
    _DeletePenIfNotInCache(hPen, __LINE__); 
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1716
    gcData->hPen = 0;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1717
}
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1718
#endif /* CACHE_LAST_PEN */
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1719
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1720
static int
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1721
lockEventQ() {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1722
    DWORD dwWaitResult;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1723
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1724
    /* Request ownership of mutex. */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1725
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1726
    dwWaitResult = WaitForSingleObject(hEventQMutex, 5000L);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1727
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1728
#ifdef LOCK_DEBUG
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1729
    lockcountQ++;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1730
    if (lockcountQ != 1) {
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  1731
	fprintf(stderr, "WinWorkstation [info]: lockcountQ (%d) != 1\n", lockcountQ);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1732
	lockcountQ = 1;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1733
    }
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1734
#endif
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1735
    switch (dwWaitResult) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1736
	// The thread got mutex ownership.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1737
	case WAIT_OBJECT_0:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1738
	    break;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1739
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1740
	// Cannot get mutex ownership due to time-out.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1741
	case WAIT_TIMEOUT:
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  1742
	    fprintf(stderr, "WinWorkstation [info]: lockEventQ timeout\n");
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1743
	    return FALSE;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1744
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1745
	// Got ownership of the abandoned mutex object.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1746
	default:
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  1747
	    fprintf(stderr, "WinWorkstation [info]: lockEventQ abandoned\n");
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1748
	    return FALSE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1749
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1750
    return TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1751
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1752
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1753
static void
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1754
unlockEventQ() {
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1755
#ifdef LOCK_DEBUG
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1756
    lockcountQ--;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1757
    if (lockcountQ != 0) {
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  1758
	fprintf(stderr, "WinWorkstation [info]: lockcountQ (%d) != 0\n", lockcountQ);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1759
	lockcountQ = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1760
    }
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1761
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1762
    /* Release ownership of the mutex object. */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1763
    if (! ReleaseMutex(hEventQMutex)) {
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1764
       /* Deal with error. */
3506
44a6cf8203cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3505
diff changeset
  1765
       fprintf(stderr, "unlock EventQ Error\n");
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1766
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1767
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1768
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1769
static int
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1770
lockEventFreeList() {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1771
    DWORD dwWaitResult;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1772
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1773
    /* Request ownership of mutex. */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1774
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1775
    dwWaitResult = WaitForSingleObject(hEventFreeListMutex, 1000L); 
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1776
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1777
#ifdef LOCK_DEBUG
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1778
    lockcountF++;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1779
    if (lockcountF != 1) {
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  1780
	fprintf(stderr, "WinWorkstation [info]: lockcountF (%d) != 1\n", lockcountF);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1781
	lockcountF = 1;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1782
    }
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1783
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1784
    switch (dwWaitResult) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1785
	// The thread got mutex ownership.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1786
	case WAIT_OBJECT_0:
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1787
	    break;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1788
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1789
	// Cannot get mutex ownership due to time-out.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1790
	case WAIT_TIMEOUT:
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  1791
	    fprintf(stderr, "WinWorkstation [info]: lockEventF timeout\n");
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1792
	    return FALSE;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1793
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1794
	// Got ownership of the abandoned mutex object.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1795
	default:
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  1796
	    fprintf(stderr, "WinWorkstation [info]: lockEventF abandoned\n");
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1797
	    return FALSE;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1798
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1799
    return TRUE;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1800
}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1801
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1802
static void
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1803
unlockEventFreeList() {
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1804
#ifdef LOCK_DEBUG
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1805
    lockcountF--;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1806
    if (lockcountF != 0) {
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  1807
	fprintf(stderr, "WinWorkstation [info]: lockcountF (%d) != 0\n", lockcountF);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1808
	lockcountF = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1809
    }
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1810
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1811
    /* Release ownership of the mutex object. */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1812
    if (! ReleaseMutex(hEventFreeListMutex)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1813
       /* Deal with error. */
3506
44a6cf8203cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3505
diff changeset
  1814
       fprintf(stderr, "unlock EventFreeList Error\n");
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1815
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1816
}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1817
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1818
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1819
static int
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1820
initEventqueue() {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1821
    struct queuedEvent *bulk;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1822
    int i;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1823
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1824
    bulk = (struct queuedEvent *) malloc(EV_CHUNK_SZ);
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1825
    if (bulk == 0) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  1826
	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
  1827
	return 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1828
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1829
    for (i=1; i<EV_CHUNK_CNT; i++) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1830
	bulk[i-1].ev_next = &(bulk[i]);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1831
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1832
    bulk[EV_CHUNK_CNT-1].ev_next = (struct queuedEvent *)0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1833
    eventFreeList = bulk;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1834
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1835
    for (i=0; i<NUMQUICKFREE_EV; i++) {
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1836
	quickFreeEvent[i] = (struct queuedEvent *)0;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1837
    }
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1838
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1839
    return 1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1840
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1841
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  1842
#define EV_NOTIME       0
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  1843
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1844
#define enqEvent(a1, a2, a3, a4, a5, a6, a7, a8, a9) \
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1845
    __enqEvent(a1, a2, a3, a4, a5, a6, a7, a8, a9)
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  1846
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1847
static void
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1848
__enqEvent(flag, hWnd, message, wParam, arg1, arg2, arg3, arg4, evTime)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1849
    HWND hWnd;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1850
    UINT message;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1851
    UINT wParam;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  1852
    UINT evTime;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1853
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1854
    struct queuedEvent *ev = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1855
    int repeatCount = 0;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1856
    int needSetEvent, i;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1857
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1858
    /*
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1859
     * get an event ...
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1860
     */
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1861
    for (;;) {
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1862
	for (i=0; i<NUMQUICKFREE_EV; i++) {
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1863
	    if (ev = quickFreeEvent[i]) {
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1864
		quickFreeEvent[i] = (struct queuedEvent *)0;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1865
		break;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1866
	    }
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1867
	}
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1868
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1869
	if (ev) {
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1870
	    break;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1871
	}
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1872
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1873
	if (! lockEventFreeList()) {
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  1874
	    fprintf(stderr, "WinWorkstation [info]: could not lock evFreeList\n");
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1875
	    return;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1876
	}
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1877
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1878
	ev = eventFreeList;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1879
	if (ev) {
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1880
	    eventFreeList = ev->ev_next;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1881
	    unlockEventFreeList();
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1882
	    break;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1883
	}
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1884
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1885
	unlockEventFreeList();
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  1886
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1887
	if (repeatCount++ >= 5) {
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  1888
	    /* throw away sorry */
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  1889
	    fprintf(stderr, "WinWorkstation [info]: event throw away\n");
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1890
	    return;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1891
	}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1892
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  1893
	fprintf(stderr, "WinWorkstation [info]: wait for event memory (%d)\n", repeatCount);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1894
	WaitForSingleObject(hNeverTriggered, 100L);
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1895
    }
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1896
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1897
    ev->ev_flag = flag;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1898
    ev->ev_hWnd = hWnd;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1899
    ev->ev_message = message;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1900
    ev->ev_wParam = wParam;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1901
    ev->ev_arg1 = arg1;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1902
    ev->ev_arg2 = arg2;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1903
    ev->ev_arg3 = arg3;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1904
    ev->ev_arg4 = arg4;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  1905
    ev->ev_time = evTime /* lastMSGTime */;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1906
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1907
    lockEventQ();
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1908
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1909
    needSetEvent = (eventQueueHead == NULL);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1910
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1911
    ev->count = eventsendcount++;
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1912
    ev->ev_next = (struct queuedEvent *) 0;
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1913
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1914
    if (eventQueueTail) {
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1915
	eventQueueTail->ev_next = ev;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1916
    } else {
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1917
	eventQueueHead = ev;
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1918
    }
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1919
    eventQueueTail = ev;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1920
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1921
    unlockEventQ();
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1922
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1923
    if (needSetEvent) {
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1924
	SetEvent(hInputEvent);
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1925
    }
2511
5795501d41cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2508
diff changeset
  1926
2337
79f957096b99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2336
diff changeset
  1927
#if 0
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  1928
    SetThreadPriority(_masterThread, THREAD_PRIORITY_HIGHEST);
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1929
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1930
}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1931
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1932
static int
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1933
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
  1934
{
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1935
    struct queuedEvent *ev = NULL;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1936
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1937
    if (mask != ~0) {
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1938
	PRINTF(("deqEvent mask:%x\n",mask));
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1939
    }
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1940
    if (hWnd) {
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1941
	PRINTF(("deqEvent hWnd:%x\n",hWnd));
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1942
    }
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1943
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1944
  again: ;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1945
    if (lockEventQ()) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1946
	TH_DPRINTF(("TDEQ\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1947
	ev = eventQueueHead;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1948
	if (ev != NULL) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1949
	    eventQueueHead = ev->ev_next;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1950
	    if (! eventQueueHead) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1951
		eventQueueTail = (struct queuedEvent *)0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1952
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1953
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1954
	unlockEventQ();
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1955
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1956
	if (ev != NULL) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1957
	    if (ev->count != -1) {
2630
f1c54987ea84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2629
diff changeset
  1958
		static int anyGoodEventReceived = 1;
f1c54987ea84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2629
diff changeset
  1959
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1960
		if (eventempfcount != ev->count) {
2630
f1c54987ea84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2629
diff changeset
  1961
		    if (anyGoodEventReceived) {    
f1c54987ea84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2629
diff changeset
  1962
			fprintf(stderr, "WinWorkstation [warning]: lost event (eventcount error %d <-> %d)\n",
f1c54987ea84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2629
diff changeset
  1963
					 eventempfcount, ev->count);
f1c54987ea84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2629
diff changeset
  1964
		    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1965
		    eventempfcount = ev->count;
2630
f1c54987ea84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2629
diff changeset
  1966
		    anyGoodEventReceived = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1967
		} else {
2630
f1c54987ea84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2629
diff changeset
  1968
		    anyGoodEventReceived = 1;
f1c54987ea84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2629
diff changeset
  1969
		}
f1c54987ea84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2629
diff changeset
  1970
		eventempfcount++;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1971
	    }
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1972
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1973
	    if (ev->ev_message == WM_DESTROY) {
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1974
		/*
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1975
		 * arg2 is the localInfoPtr 
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  1976
		 * (which is already cleared in the wind-structure)
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  1977
		 * it must be freed by the stx-process ('cause it was malloc'd by it)
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1978
		 */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1979
		if (ev->ev_arg2) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1980
		    free((char*)ev->ev_arg2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1981
		    ev->ev_arg2 = 0;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1982
		}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1983
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1984
#ifdef TOPWINDOWCLASS
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1985
		if (ev->ev_arg1) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1986
		    if (UnregisterClass((char*)ev->ev_arg1,(HANDLE) __getHInstance())) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1987
			/*printf("UnregisterClass %s ok.\n",(char*)ev->ev_arg1);*/
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1988
			free((char*)ev->ev_arg1);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1989
			ev->ev_arg1 = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1990
		    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1991
			/* noch einmal in die queue */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1992
			if (ev->ev_arg2++ < 100) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1993
			    lockEventQ();
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1994
			    ev->ev_next = (struct queuedEvent *)0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1995
			    ev->count = eventsendcount++;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1996
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1997
			    if (eventQueueTail) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1998
				eventQueueTail->ev_next = ev;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1999
			    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2000
				eventQueueHead = ev;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2001
			    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2002
			    eventQueueTail = ev;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2003
			    unlockEventQ();
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2004
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2005
			    if (ev->ev_arg2 > 98) {
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  2006
				fprintf(stderr, "WinWorkstation [info]: UnregisterClass %s failed. Wait 1 sec.\n",(char*)ev->ev_arg1);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2007
				sleep(1);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2008
			    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2009
				sleep(0);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2010
			    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2011
			    goto again;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2012
			} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2013
			    /* fail evtl. später ändern und in st verzögert aufrufen */
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  2014
			    fprintf(stderr, "WinWorkstation [info]: UnregisterClass %s failed.\n",(char*)ev->ev_arg1);
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2015
			    free((char*)ev->ev_arg1);
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2016
			    ev->ev_arg1 = 0;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2017
			}
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2018
		    }
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2019
		}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2020
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2021
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2022
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2023
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2024
	if (ev) {
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  2025
	    int i;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  2026
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2027
	    *ret_ev = *ev;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  2028
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  2029
	    for (i=0; i<NUMQUICKFREE_EV; i++) {
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  2030
		if (quickFreeEvent[i] == 0) {
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  2031
		    quickFreeEvent[i] = ev;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  2032
		    break;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  2033
		}
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  2034
	    }
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  2035
	    if (i == NUMQUICKFREE_EV) {
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2036
		if (! lockEventFreeList()) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2037
		    fprintf(stderr, "WinWorkstation [error]: could not lock evFreeList\n");
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2038
		}
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  2039
		ev->ev_next = eventFreeList;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  2040
		eventFreeList = ev;
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  2041
		unlockEventFreeList();
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  2042
	    }
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2043
	}
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2044
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2045
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2046
#if 0
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2047
    if (!ev)
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2048
	SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_NORMAL);
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2049
#endif
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2050
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2051
    return (ev != 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2052
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2053
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2054
static void
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2055
__clearRectangles(hWnd, numRects, pRect)
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2056
    HWND hWnd;
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2057
    RECT *pRect;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2058
{
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2059
	HDC dc;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2060
	HBRUSH br;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2061
	int bgClr;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2062
	int isPrivateBrush = 0;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2063
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2064
# ifdef CACHE_LAST_WM_PAINT_DC
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  2065
	AQUIRE_PAINT_MUTEX;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2066
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2067
	if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2068
	    dc = last_wm_paint_dc;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2069
	} else {
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2070
	    if (last_wm_paint_dc) {
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2071
#  ifdef CACHE_LAST_DC
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2072
		if (lastGcData && (lastGcData->_hDC == last_wm_paint_dc)) {
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2073
#   ifdef DEBUG_DC_REUSE
3126
5447d8c1d8d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3119
diff changeset
  2074
		    fprintf(stderr, "WinWorkstation [info]: Oops - release lastGcData [%d]\n", __LINE__);
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2075
#   endif
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2076
		    _releaseDC(lastGcData);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2077
		} else {
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2078
		    ReleaseDC(last_wm_paint_win, last_wm_paint_dc);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2079
		}
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2080
#  else
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2081
		ReleaseDC(last_wm_paint_win, last_wm_paint_dc);
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2082
#  endif
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2083
	    }
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2084
	    dc = GetDC(hWnd);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2085
	    last_wm_paint_dc = dc;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2086
	    last_wm_paint_win = hWnd;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2087
	}
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2088
# else
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2089
	dc = (HDC)GetDC(hWnd);
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2090
# endif
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2091
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2092
# ifdef CACHE_LAST_DC
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2093
	if (lastGcData && (lastGcData->_hDC == dc)) {
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2094
#  ifdef DEBUG_DC_REUSE
3126
5447d8c1d8d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3119
diff changeset
  2095
	    fprintf(stderr, "WinWorkstation [info]: Oops wm_paint_dc reuse [%d]\n", __LINE__);
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2096
#  endif
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2097
	    if ((lastGcData->rop2 != R2_COPYPEN)
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2098
	     || (lastGcData->bitbltrop2 != BITBLT_COPY)) {
3126
5447d8c1d8d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3119
diff changeset
  2099
		fprintf(stderr, "WinWorkstation [info]: Oops wm_paint_dc not in Copy mode\n");
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2100
	    }
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2101
	    lastGcData = 0;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2102
	}
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2103
# endif
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2104
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2105
	br = GetWindow_viewBgBrush(hWnd);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2106
	if (! br) {
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2107
	    bgClr = GetWindow_viewBgColor(hWnd);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2108
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2109
# ifdef CACHE_LAST_WM_PAINT_BRUSH
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2110
	    if (last_wm_paint_brush
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2111
	     && (last_wm_paint_brush_clr == bgClr)) {
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2112
		br = last_wm_paint_brush;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2113
	    } else {
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2114
		if (bgClr == WhitePixel) {
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2115
		    br = __whiteBrush;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2116
		} else if (bgClr == BlackPixel) {
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2117
		    br = __blackBrush;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2118
		} else {
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2119
		    if (last_wm_paint_brush) {
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2120
			_DeleteBrush(last_wm_paint_brush, __LINE__);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2121
		    }
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2122
		    last_wm_paint_brush = br = CreateSolidBrush(bgClr);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2123
		    last_wm_paint_brush_clr = bgClr;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2124
		    isPrivateBrush = 1;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2125
		}
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2126
	    }
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2127
# else
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2128
	    br = CreateSolidBrush(bgClr);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2129
	    isPrivateBrush = 1;
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2130
# endif
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2131
	}
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2132
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2133
	if (! br) {
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  2134
	    fprintf(stderr, "WinWorkstation [info]: no brush\n");
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2135
	}
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2136
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2137
	if (br) {
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2138
	    int i;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2139
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2140
	    SelectClipRgn(dc, NULL);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2141
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2142
	    for (i=0; i<numRects; i++) {
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2143
		/*
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2144
		 * always clear - even if not interested in exposes
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2145
		 */
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2146
		FillRect(dc, &(pRect[i]), br);
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2147
	    }
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2148
	}
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2149
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2150
# ifndef CACHE_LAST_WM_PAINT_BRUSH
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2151
	if (isPrivateBrush) {
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2152
	    _DeleteBrush(br, __LINE__);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2153
	}
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2154
# endif
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2155
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2156
# ifndef CACHE_LAST_WM_PAINT_DC
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2157
	ReleaseDC(hWnd, dc);
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2158
# endif
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2159
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  2160
# if defined(CACHE_LAST_WM_PAINT_DC)
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  2161
	RELEASE_PAINT_MUTEX
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2162
# endif
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2163
}
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2164
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2165
static void
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2166
__clearWindow(hWnd, x, y, w, h)
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2167
    HWND hWnd;
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2168
{
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2169
	RECT rect;
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2170
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2171
	rect.left = x;
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2172
	rect.top = y;
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2173
	rect.right = x + w;
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2174
	rect.bottom = y + h;
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2175
	__clearRectangles(hWnd, 1, &rect);
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2176
}
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2177
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2178
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2179
/*
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2180
 * generate expose events from hWnd's update region or the passedIn region.
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2181
 * return the number of events (>0), if any was generated.
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2182
 * 0, if no event was generated, -1 if none was generated with error.
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2183
 * if a region is passed in, it is not destroyed.
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2184
 */
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2185
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2186
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2187
static int
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2188
__generateExposes(hWnd, hRgnInOrNull, msgType, doClear)
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2189
    HWND hWnd;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2190
    int msgType;
2700
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2191
    HRGN hRgnInOrNull;
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2192
{
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2193
	RECT updRect;
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  2194
	HRGN updRgn = 0;
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2195
	int numRects, ret, n, i;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2196
	int wantExpose;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2197
	RECT *pRect;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2198
	union {
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2199
	    RGNDATA rgnData;
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2200
	    char    bytes[512];
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2201
	} data;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2202
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2203
	wantExpose = 0;
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2204
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2205
	if( msgType >= 0 )    
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2206
	    wantExpose = (GetWindow_eventMask(hWnd) & ExposureMask);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2207
2700
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2208
	if (hRgnInOrNull) {
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2209
	    updRgn = hRgnInOrNull;
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2210
	} else {
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2211
	    PAINTSTRUCT ps;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2212
2700
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2213
	    /*
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2214
	     * fetch the update region, even if ExposureMask is empty.
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2215
	     */
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2216
	    updRgn = CreateRectRgn(0, 0, 0, 0);
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2217
	    ret = GetUpdateRgn(hWnd, updRgn, FALSE);
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2218
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2219
#if 0
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2220
	    BeginPaint(hWnd, &ps);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2221
	    /* store the rectangle required for image bit reversal */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2222
	    /* updateRect = ps.rcPaint;   */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2223
	    EndPaint(hWnd, &ps);
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2224
#endif        
2700
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2225
	    switch (ret) {
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2226
		case ERROR:
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  2227
		    fprintf(stderr, "WinWorkstation [info]: errregion\n");
2700
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2228
		    return -1;
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2229
		case NULLREGION:
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2230
		    DPRINTF(("nullregion\n"));
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2231
		    _DeleteObject(updRgn, __LINE__);
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2232
		    return 0;
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2233
		case SIMPLEREGION:
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2234
		case COMPLEXREGION:
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2235
		    break;
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2236
	    }
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2237
	}
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2238
	n = GetRegionData(updRgn, sizeof(data), &data);
2705
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  2239
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  2240
	/* 
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  2241
	 * the MS-doc states: n==1
2700
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2242
	 * but this is not true
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2243
	 */
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2244
	if ((n >= sizeof(RGNDATA))
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2245
	 && (n <= sizeof(data))
2700
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2246
	 && (data.rgnData.rdh.iType == RDH_RECTANGLES))  {
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2247
	    /* ok, got the region */
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2248
	    numRects = data.rgnData.rdh.nCount;
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2249
	    pRect = data.rgnData.Buffer;
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2250
	    DPRINTF(("region numRects=%d\n", numRects));
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2251
	} else {
2700
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2252
	    /* a big region ... */
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2253
	    GetRgnBox(updRgn, &updRect);
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2254
	    numRects = 1;
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2255
	    pRect = &updRect;
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2256
	    DPRINTF(("very complex region (need:%d have:%d) bounds=%d,%d -> %d,%d\n", 
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2257
		     n, sizeof(data),
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2258
		     updRect.left, updRect.top, 
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2259
		     updRect.right, updRect.bottom));
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2260
	    if (((updRect.right - updRect.left) <= 0)
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2261
	     || ((updRect.bottom - updRect.top) <= 0)) {
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2262
		numRects = 0;
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2263
	    }
2700
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2264
	}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2265
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2266
	if (numRects) {
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2267
	    if (doClear) {
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2268
		__clearRectangles(hWnd, numRects, pRect);
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2269
	    }
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2270
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  2271
#ifndef PRE_21_NOV          
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2272
	for (i=0; i < numRects; i++) {
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2273
	    ValidateRect( hWnd, &pRect[i] );
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2274
	}
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2275
#endif
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2276
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2277
#ifdef DEBUG_COLORIZE_WM_PAINT_RECTS1
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2278
	    {
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2279
		HDC hDC;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2280
		HBRUSH hBrush;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2281
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2282
		hBrush = CreateSolidBrush(BlackPixel);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2283
		hDC = GetWindowDC(hWnd);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2284
		SelectClipRgn(hDC, NULL);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2285
		for (i=0; i<numRects; i++) {
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2286
		    FillRect(hDC, &(pRect[i]), hBrush);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2287
		}
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2288
		_DeleteBrush(hBrush, __LINE__);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2289
		ReleaseDC(hWnd, hDC);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2290
	    }
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2291
#endif
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2292
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2293
	    if (wantExpose) {
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2294
		for (i=0; i<numRects; i++) {
2705
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  2295
		    int final = 0;
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  2296
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  2297
		    if ((msgType == __WM_GEXPOSE)
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  2298
		     && (i == (numRects - 1))) {
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  2299
			final = 1;
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  2300
		    }
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  2301
		    enqEvent(ExposureMask, hWnd, msgType, final, 
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2302
			     pRect[i].left, pRect[i].top, 
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2303
			     pRect[i].right - pRect[i].left,
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2304
			     pRect[i].bottom - pRect[i].top,
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2305
			     EV_NOTIME);
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2306
		}
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2307
	    }
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2308
	}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2309
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2310
	if (updRgn && (updRgn != hRgnInOrNull)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2311
	    _DeleteObject(updRgn, __LINE__);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2312
	}
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2313
2706
f065e6958804 fixed noExpose event when fully covered
Claus Gittinger <cg@exept.de>
parents: 2705
diff changeset
  2314
	return numRects;
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2315
}
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2316
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2317
#ifdef THIS_DOES_NOT_AVOID_DOUBLE_REPAINTS
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2318
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2319
BOOL CALLBACK recursiveExposeGenerator(hChild, param)
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2320
    HWND hChild;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2321
    LPARAM param;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2322
{
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2323
	__generateExposes(hChild, NULL, param, 0);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2324
	return TRUE;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2325
}
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2326
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2327
static void
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2328
__generateRecursiveExposes(hWnd, msgType)
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2329
    HWND hWnd;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2330
{
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2331
	EnumChildWindows(hWnd, recursiveExposeGenerator, msgType);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2332
}
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2333
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2334
#endif /* sigh */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2335
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2336
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2337
static
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2338
getModifiers()
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2339
{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2340
    int modifiers = 0;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2341
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2342
    if (GetKeyState(VK_SHIFT) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2343
	modifiers |= ShiftMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2344
    if (GetKeyState(VK_CONTROL) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2345
	modifiers |= ControlMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2346
#if 0
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2347
    if (GetKeyState(VK_RMENU) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2348
	modifiers |= RightAltMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2349
    if (GetKeyState(VK_LMENU) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2350
	modifiers |= LeftAltMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2351
#else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2352
    if (GetKeyState(VK_MENU) & 0x8000)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2353
	modifiers |= LeftAltMask;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2354
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2355
    if (GetKeyState(VK_LBUTTON) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2356
	modifiers |= Button1Mask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2357
    if (GetKeyState(VK_MBUTTON) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2358
	modifiers |= Button2Mask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2359
    if (GetKeyState(VK_RBUTTON) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2360
	modifiers |= Button3Mask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2361
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  2362
    if ((modifiers & AnyButtonMask) == 0) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  2363
	__eatingMouseEvents = 0;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  2364
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2365
    return modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2366
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2367
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2368
#ifdef HANDLE_VIEWGRAVITY
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2369
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2370
struct gravityCallBackInfo {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2371
    HWND parent;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2372
    int  currW, currH;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2373
    int  newW, newH;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2374
    int  parentWinX, parentWinY;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2375
};
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2376
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2377
static BOOL CALLBACK
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2378
gravityEnumeratorCallBack(hChild, iP)
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2379
    HWND hChild;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2380
    struct gravityCallBackInfo *iP;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2381
{
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2382
    localWindowInfo *lI;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2383
    int gravity;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2384
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2385
    if (lI = GETLOCALWINDOWINFOPTR(hChild)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2386
	if ((gravity = lI->viewGravity) != GRAVITY_NONE) {
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2387
	    RECT oldChildRct, oldChildWinRct;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2388
	    RECT newChildRct;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2389
	    int deltaW, deltaH;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2390
	    int anyChange = 0;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2391
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2392
	    /*
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2393
	     * get its current bounds ...
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2394
	     */
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2395
	    GetClientRect(hChild, &oldChildRct);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2396
	    deltaW = iP->newW - iP->currW;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2397
	    deltaH = iP->newH - iP->currH;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2398
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2399
	    GetWindowRect(hChild, &oldChildWinRct);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2400
	    oldChildRct.left = oldChildWinRct.left - iP->parentWinX;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2401
	    oldChildRct.top =  oldChildWinRct.top - iP->parentWinY;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2402
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2403
	    newChildRct = oldChildRct;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2404
	    switch (gravity) {
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2405
#if 0
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2406
		case GRAVITY_N:
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  2407
		    fprintf(stderr, "WinWorkstation [info]: Child %x: North gravity\n", hChild);
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2408
		    /*
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2409
		     * shift to the bottom, for a constant
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2410
		     * distance from the bottom edge;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2411
		     */
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2412
		    newChildRct.bottom += deltaH;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2413
		    anyChange = 1;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2414
		    break;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2415
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2416
		case GRAVITY_W:
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  2417
		    fprintf(stderr, "WinWorkstation [info]: Child %x: West gravity\n", hChild);
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2418
		    /*
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2419
		     * shift to the right, for a constant
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2420
		     * distance from the right edge;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2421
		     */
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2422
		    newChildRct.right += deltaW;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2423
		    anyChange = 1;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2424
		    break;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2425
#endif
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2426
		case GRAVITY_S:
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  2427
		    fprintf(stderr, "WinWorkstation [info]: Child %x: South gravity\n", hChild);
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2428
		    /*
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2429
		     * shift to the bottom, for a constant
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2430
		     * distance from the bottom edge;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2431
		     */
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2432
		    newChildRct.top += deltaH;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2433
		    newChildRct.bottom  += deltaH;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2434
		    anyChange = 1;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2435
		    break;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2436
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2437
		case GRAVITY_E:
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  2438
		    fprintf(stderr, "WinWorkstation [info]: Child %x: East gravity\n", hChild);
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2439
		    /*
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2440
		     * shift to the right, for a constant
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2441
		     * distance from the right edge;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2442
		     */
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2443
		    newChildRct.right += deltaW;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2444
		    newChildRct.left  += deltaW;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2445
		    anyChange = 1;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2446
		    break;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2447
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2448
		case GRAVITY_SE:
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  2449
		    fprintf(stderr, "WinWorkstation [info]: Child %x: SouthEast gravity\n", hChild);
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2450
		    /*
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2451
		     * shift to the bottom-right, for a constant
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2452
		     * distance from the bottom-right edge;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2453
		     */
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2454
		    newChildRct.right += deltaW;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2455
		    newChildRct.left  += deltaW;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2456
		    newChildRct.top += deltaH;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2457
		    newChildRct.bottom  += deltaH;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2458
		    anyChange = 1;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2459
		    break;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2460
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2461
		default:
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2462
		    DPRINTF(("Child %x: other gravity\n", hChild));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2463
		    break;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2464
	    }
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2465
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2466
	    if (anyChange) {
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2467
		if ((newChildRct.left < 0)
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2468
		 || (newChildRct.top < 0)
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2469
		 || (newChildRct.right >= iP->newW)
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2470
		 || (newChildRct.bottom >= iP->newH)) {
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  2471
		    fprintf(stderr, "WinWorkstation [info]: dont move child to: %d/%d -> %d/%d\n",
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2472
				    newChildRct.left, newChildRct.top,
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2473
				    newChildRct.right, newChildRct.bottom);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2474
		} else {
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  2475
		    fprintf(stderr, "WinWorkstation [info]: move child from %d/%d->%d/%d to: %d/%d->%d/%d\n",
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2476
				    oldChildRct.left, oldChildRct.top,
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2477
				    oldChildRct.right, oldChildRct.bottom,
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2478
				    newChildRct.left, newChildRct.top,
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2479
				    newChildRct.right, newChildRct.bottom);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2480
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2481
		    SetWindowPos(hChild, (HWND)0,
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2482
				 newChildRct.left, newChildRct.top,
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2483
				 0, 0,
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2484
				 /* SWP_NOSENDCHANGING | */
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2485
				 SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2486
		}
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2487
	    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2488
	}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2489
    }
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2490
    return TRUE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2491
}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2492
#endif /* HANDLE_VIEWGRAVITY */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2493
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2494
static int
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2495
winEventProcessing(hWnd, message, wParam, lParam, pDefault)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2496
    HWND hWnd;                /* window handle                   */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2497
    UINT message;             /* type of message                 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2498
    UINT wParam;              /* additional information          */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2499
    LONG lParam;              /* additional information          */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2500
    int *pDefault;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2501
{
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2502
    int curButton;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2503
    int x, y, w, h;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2504
    int isNative = 0;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2505
    UINT evTime;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2506
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2507
    /* kludge - info is in msg-struct,
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2508
     * but lost here. (slightly inexact ... but who cares)
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2509
     */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2510
    evTime = lastMSGTime;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2511
    lastMSGTime = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2512
    if (evTime == 0) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2513
	lastMSGTime = GetTickCount();
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2514
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2515
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2516
/*
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2517
    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
  2518
			hWnd, message, wParam, lParam));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2519
*/
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2520
3584
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
  2521
    if (message != WM_MOUSEMOVE) {
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
  2522
	lastMotionWnd = 0;
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
  2523
    }
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
  2524
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2525
    /*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2526
     * messages which are enqueued to be handled by the view thread
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2527
     */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2528
    switch (message) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2529
	case WM_THREAD_CREATEWINDOW:
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2530
	    EVENT_PRINTF(("*WM_THREAD_CREATEWINDOW\n"));
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2531
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2532
	    {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2533
		createWindowInfo *cwi = (createWindowInfo *)(lParam);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2534
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2535
		if ((cwi->sequenceNr == wParam) 
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2536
		 && (cwi->sequenceNr != INVALIDATED_CWI)) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2537
		    cwi->sequenceNr = INVALIDATED_CWI;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2538
		    cwi->infoWasRead = 1;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2539
		    if (cwi->newWinHandle == NULL) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2540
			HANDLE ev;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2541
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2542
			cwi->newWinHandle = CreateWindowEx(
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2543
						cwi->winStyleBitsEx,
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2544
						cwi->className,
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2545
						cwi->windowName,
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2546
						cwi->winStyleBits,
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2547
						cwi->x, cwi->y,
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2548
						cwi->dx, cwi->dy,
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2549
						cwi->parentHandle,
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2550
						NULL,           /* menu */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2551
						(HANDLE) __getHInstance(),
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2552
						cwi->localWindowInfo 
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2553
					       );
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2554
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2555
			if (cwi->newWinHandle == NULL) {
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  2556
			    fprintf(stderr, "WinWorkstation [info]: CreateWindow failed: %d\n", GetLastError());
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2557
			}
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2558
			ev = cwi->hCreateEvent;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2559
			if (ev) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2560
			    SetEvent(ev);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2561
			}
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2562
		    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2563
		} else {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2564
		    DPRINTF(("obsolete createWindow message %x ignored\n", cwi->sequenceNr));
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2565
		}
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2566
	    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2567
	    *pDefault = 0;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2568
	    return 0;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2569
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  2570
	case WM_THREAD_DESTROYWINDOW:
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2571
	    {
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2572
		HBRUSH br;
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2573
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2574
		if (br = GetWindow_viewBgBrush(hWnd)) {
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  2575
		    SetWindow_viewBgBrush(hWnd, 0);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  2576
		    _DeleteBrushIfNotInCache(br, __LINE__);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  2577
		}
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  2578
	    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2579
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2580
#ifdef CACHE_LAST_DC
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2581
	    if (lastGcData && (lastGcHWIN == hWnd)) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2582
		_releaseDC(lastGcData);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2583
	    }
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2584
#endif
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  2585
#ifdef CACHE_LAST_WM_PAINT_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2586
	    if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  2587
		ReleaseDC(hWnd, last_wm_paint_dc);
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  2588
		last_wm_paint_win = last_wm_paint_dc = 0;
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  2589
	    }
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  2590
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2591
	    if (! DestroyWindow(hWnd)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2592
		DPRINTF(("DestroyWindow ERROR\n"));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2593
	    } else {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2594
#ifdef COUNT_RESOURCES
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2595
		__cnt_createWindows--;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2596
		RESPRINTF(("DestroyWindow -> %d\n", __cnt_createWindows));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2597
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2598
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2599
	    *pDefault = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2600
	    return 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2601
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2602
	case WM_CREATE:
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2603
	    {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2604
		CREATESTRUCT *lpcs = (LPCREATESTRUCT) lParam; // structure with creation data
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2605
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  2606
		EVENT_PRINTF(("WM_CREATE\n"));
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  2607
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2608
		SETLOCALWINDOWINFOPTR(hWnd, lpcs->lpCreateParams);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2609
#ifdef SUPERDEBUG
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2610
		if (GETLOCALWINDOWINFOPTR(hWnd) != lpcs->lpCreateParams) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2611
		    PRINTF(("SETLOCALWINDOWINFOPTR ERROR\n"));
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2612
		}
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2613
#endif
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2614
		*pDefault = 0;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2615
#ifdef COUNT_RESOURCES
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2616
		__cnt_createWindows++;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2617
		RESPRINTF(("CreateWindows %d\n",__cnt_createWindows));
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2618
#endif
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2619
	    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2620
	    break;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2621
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2622
	case WM_CLOSE:
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  2623
	    EVENT_PRINTF(("WM_CLOSE\n"));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2624
	    if (! destroyWin) {
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  2625
		enqEvent(0, hWnd, WM_CLOSE, wParam, 0, 0, 0, 0, EV_NOTIME);
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2626
	    } else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2627
		destroyWin = 0;
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2628
		{
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2629
		    HBRUSH br;
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2630
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2631
		    if (br = GetWindow_viewBgBrush(hWnd)) {
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  2632
			SetWindow_viewBgBrush(hWnd, 0);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  2633
			_DeleteBrushIfNotInCache(br, __LINE__);
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2634
		    }
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2635
		}
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2636
#ifdef CACHE_LAST_DC
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2637
		if (lastGcData && (lastGcHWIN == hWnd)) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2638
		    _releaseDC(lastGcData);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2639
		}
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2640
#endif
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  2641
#ifdef CACHE_LAST_WM_PAINT_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2642
		if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  2643
		    ReleaseDC(hWnd, last_wm_paint_dc);
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  2644
		    last_wm_paint_win = last_wm_paint_dc = 0;
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  2645
		}
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  2646
#endif
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2647
		if (! DestroyWindow(hWnd)) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2648
		    DPRINTF(("DestroyWindow ERROR\n"));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2649
		} else {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2650
#ifdef COUNT_RESOURCES
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2651
		    __cnt_createWindows--;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2652
		    RESPRINTF(("DestroyWindow -> %d\n", __cnt_createWindows));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2653
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2654
		}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2655
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2656
	    *pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2657
	    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2658
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2659
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2660
	case WM_DESTROY:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2661
	    {
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2662
		char *n = 0;
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2663
		localWindowInfo *lI;
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2664
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2665
		lI = GETLOCALWINDOWINFOPTR(hWnd);
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  2666
		EVENT_PRINTF(("WM_DESTROY %x li=%x\n", hWnd, lI));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2667
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  2668
#ifdef TOPWINDOWCLASS
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2669
		if (lI) {
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2670
		    if (lI->flag & LI_TOPWIN) {
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2671
			n = (char*) malloc(200);
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2672
			GetClassName(hWnd,n,200);
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2673
		    }
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2674
		    /* freeing now done in other thread */
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2675
		}
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2676
#endif
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2677
		SETLOCALWINDOWINFOPTR(hWnd, 0);
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2678
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2679
#ifdef FREE_LI_IN_STX_PROCESS
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  2680
		enqEvent(0, hWnd, WM_DESTROY, wParam, (int)n, (int)lI, 0, 0, EV_NOTIME);
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2681
#else
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2682
		if (lI) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2683
		    free(lI);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2684
		}
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  2685
		enqEvent(0, hWnd, WM_DESTROY, wParam, (int)n, 0, 0, 0, EV_NOTIME);
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2686
#endif
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2687
		*pDefault = 0;
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  2688
		return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2689
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2690
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2691
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2692
	case WM_GETMINMAXINFO:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2693
	    {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2694
		int minW, maxW;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2695
		localWindowInfo *lI;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2696
		LPMINMAXINFO lpmmi;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2697
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2698
		lpmmi = (LPMINMAXINFO) lParam;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2699
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  2700
		EVENT_PRINTF2(("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
  2701
			    hWnd,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2702
			    lpmmi->ptMinTrackSize.x,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2703
			    lpmmi->ptMinTrackSize.y));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2704
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2705
		lI = GETLOCALWINDOWINFOPTR(hWnd);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2706
		if (lI && (lI->minWidth) && (lI->maxWidth)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2707
		  lpmmi->ptMaxSize.x = lI->maxWidth;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2708
		  lpmmi->ptMaxSize.y = lI->maxHeight;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2709
		  lpmmi->ptMaxTrackSize.x = lI->maxWidth;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2710
		  lpmmi->ptMaxTrackSize.y = lI->maxHeight;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2711
		  lpmmi->ptMinTrackSize.x = lI->minWidth;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2712
		  lpmmi->ptMinTrackSize.y = lI->minHeight;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2713
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  2714
		  EVENT_PRINTF3(("WM_GETMINMAXINFO handle=%x return min: %d/%d max: %d/%d\n",
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2715
				  hWnd,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2716
				  lI->minWidth, lI->minHeight,
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2717
				  lI->maxWidth, lI->maxHeight));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2718
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2719
		*pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2720
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2721
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2722
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2723
	case WM_SETCURSOR:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2724
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2725
		HCURSOR curs;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2726
		int hitCode;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2727
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2728
		hitCode = LOWORD(lParam);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2729
		if (hitCode != HTCLIENT) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2730
		    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2731
		     * not in client area ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2732
		     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2733
		    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2734
		}
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  2735
		DDPRINTF(("WM_SETCURSOR\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2736
		curs = GetWindow_Cursor(hWnd);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2737
		if (curs) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2738
		    SetCursor(curs);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2739
		    *pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2740
		    return 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2741
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2742
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2743
	    return 0;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2744
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2745
	case WM_WINDOWPOSCHANGED:
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2746
	    if (hWnd == __rootWinSpezial) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2747
		/* can this happen ? */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2748
		*pDefault = 1;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2749
		return 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2750
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2751
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2752
	    if (! inMove && (__currentCapture == CAPTURE_NONE)) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2753
		POINT p;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2754
		HWND hWndChild,hWndTemp;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2755
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2756
		p.x = evRootX;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2757
		p.y = evRootY;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2758
		ScreenToClient(hWnd, &p);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2759
		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
  2760
		do {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2761
		    hWndTemp = hWndChild;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2762
		    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
  2763
		} while ((hWndChild) && (hWndChild != hWndTemp));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2764
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2765
		if (hWndChild /*&& (hWndChild != hWnd)*/) {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2766
		    if (hWndChild != __currentPointerView) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2767
			int modifiers;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2768
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2769
			modifiers = getModifiers();
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2770
			if (__currentPointerView) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2771
			    if (inSizeMove) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2772
				if (needDelayedMouseLeaveWindow == NULL) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2773
				    needDelayedMouseLeaveWindow = __currentPointerView;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2774
				}
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2775
			    } else {
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2776
				if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  2777
				    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2778
				    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2779
				}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2780
			    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2781
			    __currentPointerView = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2782
			}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2783
			if (inSizeMove) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2784
			    needDelayedMouseEnterWindow = hWndChild;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2785
			    delayedMouseEnterX = evRootX;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2786
			    delayedMouseEnterY = evRootY;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2787
			} else {
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2788
			    if (GetWindow_eventMask(hWndChild) & EnterWindowMask) {
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  2789
				enqEvent(EnterWindowMask, hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers, EV_NOTIME);
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2790
				SetWindow_mouseXY(hWndChild, evRootX, evRootY);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2791
			    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2792
			    //SetFocus(hWndChild);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2793
			}
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2794
			__currentPointerView = hWndChild;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2795
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2796
		}
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2797
	    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2798
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2799
	    /*
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2800
	     * ignore child window messages ...
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2801
	     */
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2802
	    if (GetParent(hWnd) != NULL) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2803
		break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2804
	    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2805
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  2806
	    {
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  2807
		WINDOWPOS *wp = (WINDOWPOS *)lParam;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2808
		RECT rct, dRect;
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  2809
		int x, y, w, h;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2810
		int dW, dH;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2811
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2812
#if 0
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2813
		dRect.left = 0;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2814
		dRect.top = 0;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2815
		dRect.right = 100;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2816
		dRect.bottom = 100;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2817
		winStyleBits = GetWindowLong(hWnd, GWL_STYLE);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2818
		winExStyleBits = GetWindowLong(hWnd, GWL_EXSTYLE);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2819
		AdjustWindowRectEx(&dRect, winStyleBits, 0, winExStyleBits);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2820
		dW = dRect.right - dRect.left;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2821
		dH = dRect.bottom - dRect.top;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2822
#endif
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  2823
		GetClientRect(hWnd, &rct);
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  2824
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  2825
		x = rct.left;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  2826
		y = rct.top;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  2827
		w = rct.right - rct.left;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  2828
		h = rct.bottom - rct.top;
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2829
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2830
		EVENT_PRINTF(("WM_WINDOWPOSCHANGED ["));
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2831
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2832
		if (wp->flags & SWP_NOSIZE) {
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2833
		    EVENT_PRINTF(("NOSIZE "));
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2834
		}
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2835
		if (wp->flags & SWP_NOMOVE) {
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2836
		    EVENT_PRINTF(("NOMOVE "));
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2837
		}
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2838
		if (wp->flags & SWP_NOZORDER) {
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2839
		    EVENT_PRINTF(("NOZORDER "));
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2840
		}
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2841
		if (wp->flags & SWP_NOREDRAW) {
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2842
		    EVENT_PRINTF(("NOREDRAW "));
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2843
		}
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2844
		if (wp->flags & SWP_NOACTIVATE) {
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2845
		    EVENT_PRINTF(("NOACTIVATE "));
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2846
		}
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2847
		if (wp->flags & SWP_FRAMECHANGED) {
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2848
		    EVENT_PRINTF(("FRAMECHANGED "));
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2849
		}
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2850
		if (wp->flags & SWP_NOCOPYBITS) {
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2851
		    EVENT_PRINTF(("NOCOPYBITS "));
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2852
		}
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2853
		if (wp->flags & SWP_NOOWNERZORDER) {
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2854
		    EVENT_PRINTF(("NOOWNERZORDER "));
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2855
		}
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2856
		if (wp->flags & SWP_NOSENDCHANGING) {
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2857
		    EVENT_PRINTF(("NOSENDCHANGING "));
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2858
		}
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2859
		if (wp->flags & SWP_DEFERERASE) {
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2860
		    EVENT_PRINTF(("DEFERERASE "));
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2861
		}
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2862
		if (wp->flags & SWP_ASYNCWINDOWPOS) {
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2863
		    EVENT_PRINTF(("ASYNCWINDOWPOS "));
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2864
		}
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2865
		if (wp->flags & SWP_HIDEWINDOW) {
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2866
		    EVENT_PRINTF(("HIDEWINDOW "));
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2867
		}
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2868
		if (wp->flags & SWP_SHOWWINDOW) {
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2869
		    EVENT_PRINTF(("SHOWWINDOW "));
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2870
		}
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2871
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2872
		EVENT_PRINTF(("] %d/%d %d/%d flags:%d (0x%x) ->",
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2873
				wp->x, wp->y, wp->cx, wp->cy, wp->flags, wp->flags));
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  2874
		EVENT_PRINTF(("  client rect now: %d/%d %d/%d\n",x, y, w, h));
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2875
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2876
		if ((w == 0) && (h == 0)) {
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2877
		    EVENT_PRINTF(("w,h = 0.\n"));
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2878
		    if (! GetWindow_iconified(hWnd)) {
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2879
			EVENT_PRINTF(("iconified.\n"));
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2880
			SetWindow_iconified(hWnd, 1);
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2881
			DPRINTF(("WM_WINDOWPOSCHANGED to iconified (flags:0x%x)\n", wp->flags));
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  2882
			enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2883
		    }
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2884
		} else {
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2885
		    if (GetWindow_iconified(hWnd)) {
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2886
			EVENT_PRINTF(("deiconified.\n"));
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2887
			SetWindow_iconified(hWnd, 0);
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2888
			DPRINTF(("WM_WINDOWPOSCHANGED to deiconified (flags:0x%x)\n", wp->flags));
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  2889
			enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2890
		    }
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2891
		    if (!(wp->flags & SWP_NOSIZE) 
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2892
		     || !(wp->flags & SWP_NOMOVE)) {
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2893
			EVENT_PRINTF(("enq event %x: %d, %d, %d, %d\n", hWnd, x, y, w, h));
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2894
#ifdef COMPRESS_WINDOWPOSCHANGED
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  2895
			/*
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  2896
			 * remember the current
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  2897
			 * window and size;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  2898
			 * This allows the backend to ignore
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  2899
			 * intermediate events.
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  2900
			 */
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  2901
			lastPos_win = 0;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  2902
			lastPos_w = w;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  2903
			lastPos_h = h;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  2904
			lastPos_x = x;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  2905
			lastPos_y = y;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  2906
			lastPos_win = hWnd;
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2907
#endif
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  2908
			enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2909
		    } else {
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2910
			EVENT_PRINTF(("no event due to SWP_NOSIZE/SWP_NOMOVE.\n"));
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2911
		    }
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2912
		}
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  2913
	    }
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  2914
	    *pDefault = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2915
	    return 0;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2916
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2917
	case WM_ERASEBKGND:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2918
	    EVENT_PRINTF(("WM_ERASEBKGND\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2919
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2920
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2921
	    }
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2922
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2923
#ifndef PRE_21_NOV
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2924
	    *pDefault = 0;
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2925
	    return 0;
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2926
#else
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2927
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2928
	    if (GetWindow_flag(hWnd) & LI_INPUTWIN) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2929
		*pDefault = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2930
		return 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2931
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2932
	    if (hWnd == __rootWinSpezial) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2933
		*pDefault = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2934
		return 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2935
	    }
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2936
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2937
	    /* THIS_WORKS */
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2938
	    *pDefault = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2939
	    return 0;
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2940
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  2941
#endif  /* ! PRE_21_NOV */
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2942
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2943
	case WM_PAINT:
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2944
	    EVENT_PRINTF(("WM_PAINT ********************* "));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2945
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2946
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2947
	    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2948
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2949
#ifndef PRE_21_NOV
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2950
	{   int n;
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2951
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  2952
	    n = __generateExposes( hWnd, NULL, WM_PAINT, 0 );
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2953
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2954
	    if( n <= 0 ) {
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2955
		* pDefault = 1;
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2956
		return 0;
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2957
	    }
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2958
	    * pDefault = 0;
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2959
	    return n;
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2960
	}
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2961
#else
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2962
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2963
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2964
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2965
	    if (GetWindow_flag(hWnd) & LI_INPUTWIN) {
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2966
		*pDefault = 0;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2967
		return 0;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2968
	    }
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2969
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2970
	    if (hWnd == __rootWinSpezial) {
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2971
# ifdef THIS_MAKES_GUI_PAINTER_START_SLOW
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2972
		*pDefault = 0;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2973
# endif
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2974
		return 0;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2975
	    }
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2976
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2977
	    {
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2978
		int retVal;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2979
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  2980
# ifdef LATE_GENERATE_EXPOSE
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  2981
		enqEvent(0, hWnd, __WM_PAINT, 0, 0, 0, 0, 0, EV_NOTIME);
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  2982
# else
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  2983
		AQUIRE_DRAW_MUTEX
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2984
		retVal = __generateExposes(hWnd, NULL, WM_PAINT, WM_PAINT_CLEAR_EARLY);
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  2985
		RELEASE_DRAW_MUTEX
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  2986
# endif
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2987
		switch (retVal) {
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2988
		    case -1:  /* error */
2697
0fbd675cf5b2 update region processing
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
  2989
			*pDefault = 0;
0fbd675cf5b2 update region processing
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
  2990
			break;
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2991
		    case 0:   /* nothing generated */
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2992
		    default:  /* generated events */
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2993
			break;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2994
		}
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2995
# ifdef THIS_IS_BAD
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
  2996
		*pDefault = 0;
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
  2997
		return 1;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2998
# endif
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2999
	    } 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3000
	    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3001
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  3002
#endif  /* ! PRE_21_NOV */
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  3003
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3004
	case WM_SIZE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3005
	    EVENT_PRINTF(("WM_SIZE\n"));
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3006
	    /*
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3007
	     * ignore child window messages ...
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3008
	     */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3009
	    if (GetParent(hWnd) != NULL) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3010
		*pDefault = 0;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3011
		return 0;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3012
	    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3013
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3014
	    switch (wParam) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3015
		case SIZE_MAXIMIZED:     /* default handling */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3016
		case SIZE_MINIMIZED:     /* default handling */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3017
		case SIZE_RESTORED:      /* default handling */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3018
		    {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3019
			RECT rct;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3020
			int x, y, w, h;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3021
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3022
			GetClientRect(hWnd, &rct);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3023
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3024
			x = rct.left;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3025
			y = rct.top;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3026
			w = rct.right - rct.left;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3027
			h = rct.bottom - rct.top;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3028
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  3029
			EVENT_PRINTF(("WM_MIN/MAX/RESTORED\n"));
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  3030
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3031
			if ((w == 0) && (h == 0)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3032
			    /*
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3033
			     * iconified ...
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3034
			     */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3035
			    if (! GetWindow_iconified(hWnd)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3036
				SetWindow_iconified(hWnd, 1);
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3037
				enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3038
			    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3039
			} else {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3040
			    if (GetWindow_iconified(hWnd)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3041
				SetWindow_iconified(hWnd, 0);
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3042
				enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3043
			    }
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  3044
			    EVENT_PRINTF(("enq event2 %x: %d, %d, %d, %d\n", hWnd, x, y, w, h));
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3045
#ifdef COMPRESS_WINDOWPOSCHANGED
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3046
			    /*
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3047
			     * remember the current
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3048
			     * window and size;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3049
			     * This allows the backend to ignore
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3050
			     * intermediate events.
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3051
			     */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3052
			    lastPos_win = 0;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3053
			    lastPos_w = w;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3054
			    lastPos_h = h;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3055
			    lastPos_x = x;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3056
			    lastPos_y = y;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3057
			    lastPos_win = hWnd;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3058
#endif
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3059
			    enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3060
			}
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3061
		   }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3062
		   break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3063
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3064
		default:                 /* ignore */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3065
		    *pDefault = 0;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3066
		    return 0;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3067
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3068
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3069
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3070
	case WM_DROPFILES:
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3071
	    EVENT_PRINTF(("WM_DROPFILES\n"));
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3072
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3073
	    break;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3074
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3075
	case WM_SHOWWINDOW:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3076
	    EVENT_PRINTF(("WM_SHOWWINDOW\n"));
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3077
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3078
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3079
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3080
	    }
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3081
	    *pDefault = 0;
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  3082
	    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3083
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3084
	case WM_MOUSEACTIVATE :
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3085
	    EVENT_PRINTF(("WM_MOUSEACTIVATE h=%x parent=%x\n", hWnd, GetParent(hWnd)));
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3086
	    /*
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3087
	     * ignore child window messages ...
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3088
	     */
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3089
	    if (GetParent(hWnd)) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3090
		return 0;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3091
	    }
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3092
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3093
	    *pDefault = 0;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3094
	    if ((hWnd == __rootWinSpezial) || (hWnd == GetActiveWindow())) {
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  3095
		DDPRINTF(("NOACTIVATE (root or already)\n"));
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3096
		return MA_NOACTIVATE;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3097
	    }
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3098
	    if (LOWORD(lParam) != HTCLIENT) {
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  3099
		DDPRINTF(("ACTIVATE (not client)\n"));
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3100
		return MA_ACTIVATE;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3101
	    }
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3102
	    if (__activateOnClick) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3103
		if (__ignoreButtonPressOnActivate) {
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  3104
		    DDPRINTF(("ACTIVATE_EAT\n"));
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3105
		    /*
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3106
		     * windows is sooo stupid:
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3107
		     * it will send me a MOTION soon after, with the
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3108
		     * to the click location, with the buttonState down.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3109
		     * The app will interpret that as a pressed motion and
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3110
		     * do a selection (if in a textview).
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3111
		     * To prevent this, we set a flag here, that the following
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3112
		     * motion is to be suppressed.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3113
		     * Until the mouse is released.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3114
		     */
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  3115
		    __eatingMouseEvents = 1;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3116
		    return MA_ACTIVATEANDEAT;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3117
		}
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  3118
		DDPRINTF(("ACTIVATE\n"));
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3119
		return MA_ACTIVATE;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3120
	    }
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  3121
	    DDPRINTF(("NO_ACTIVATE\n"));
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3122
	    return MA_NOACTIVATE;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3123
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  3124
	case WM_NCHITTEST:
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3125
	    EVENT_PRINTF2(("WM_NCHITTEST\n"));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3126
	    if (hWnd == __rootWinSpezial) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3127
		*pDefault = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3128
		return HTCLIENT;
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  3129
	    }
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  3130
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3131
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  3132
	case WM_NCACTIVATE:
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  3133
	    EVENT_PRINTF(("WM_NCACTIVATE\n"));
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  3134
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3135
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3136
	case WM_ACTIVATE:
3963
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3137
	    CPRINTF(("WM_ACTIVATE %s h=%x\n", LOWORD(wParam) ? "active" : "inactive", hWnd));
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3138
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3139
	    switch (LOWORD(wParam)) {
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3140
		case WA_INACTIVE:
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3141
		    EVENT_PRINTF2(("WM_ACTIVATE inactive h=%x\n", hWnd));
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3142
		    break;
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3143
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3144
		case WA_ACTIVE:
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3145
		    EVENT_PRINTF2(("WM_ACTIVATE active h=%x\n", hWnd));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3146
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3147
#ifdef THIS_DOES_NOT_AVOID_DOUBLE_REPAINTS
3963
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3148
		    __generateRecursiveExposes(hWnd, WM_PAINT);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3149
#endif /* sigh */
3963
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3150
		    break;
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3151
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3152
		case WA_CLICKACTIVE:
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3153
		    EVENT_PRINTF2(("++ WM_ACTIVATE clkactive h=%x\n", hWnd));
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3154
		    break;
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3155
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3156
		default:
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3157
		    EVENT_PRINTF2(("WM_ACTIVATE ? h=%x\n", hWnd));
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3158
		    break;
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3159
	    }
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3160
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3161
#ifndef PRE_25_NOV_03
3963
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3162
	    if (__currentCapture == CAPTURE_NONE) {
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3163
		HWND  newHWnd = 0;
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3164
		POINT newPoint;
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3165
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3166
		if (LOWORD(wParam) != WA_INACTIVE) {
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3167
		    newPoint.x = evRootX;
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3168
		    newPoint.y = evRootY;
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3169
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3170
		    newHWnd = WindowFromPoint (newPoint);
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3171
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3172
		    if (newHWnd) {
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3173
			if ( (newHWnd == hWnd) || IsChild(hWnd, newHWnd) ) {
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3174
			    ScreenToClient (newHWnd, & newPoint);
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3175
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3176
			    if ((newPoint.x < 0) || (newPoint.y < 0)) {
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3177
				newHWnd = 0;
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3178
			    }
3963
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3179
			} else {
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3180
			    newHWnd = 0;
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3181
			}
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3182
		    }
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3183
		}
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3184
		CPRINTF(( "Old Handle: %x New Handle: %x  x:%d y:%d\n", __currentPointerView, newHWnd, newPoint.x, newPoint.y));
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3185
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3186
		if (newHWnd != __currentPointerView) {
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3187
		    int modifiers = getModifiers();
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3188
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3189
		    if (__currentPointerView) {
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3190
			if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3191
			    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3192
			    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3193
			}
3963
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3194
		    }
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3195
		    __currentPointerView = newHWnd;
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3196
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3197
		    if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3198
			enqEvent(EnterWindowMask, __currentPointerView, __WM_MOUSEENTER, 0, newPoint.x, newPoint.y, 0, modifiers, EV_NOTIME);
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3199
			SetWindow_mouseXY(__currentPointerView, newPoint.x, newPoint.y);
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3200
		    }
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3201
		}
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3202
	    }
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3203
#endif
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3204
	    enqEvent(0, hWnd, WM_ACTIVATE, wParam, 0, 0, 0, 0, EV_NOTIME);
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3205
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3206
	    if (isNative) {
df6bc1548520 translate root coordinates to view coordinates in WM_ACTIVATE enterMouse#CVS: ----------------------------------------------------------------------
ca
parents: 3962
diff changeset
  3207
		*pDefault = 1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3208
		return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3209
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  3210
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3211
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3212
	case WM_SYSCHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3213
	    EVENT_PRINTF2(("WM_SYSCHAR h=%x %x\n", hWnd, wParam));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3214
	    goto commonChar;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3215
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3216
	case WM_CHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3217
	    EVENT_PRINTF2(("WM_CHAR h=%x %x\n", hWnd, wParam));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3218
	commonChar:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3219
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3220
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3221
	    }
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3222
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3223
	    {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3224
		HWND destWindow;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3225
		int evMask;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3226
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  3227
		if (__focusFollowsMouse) {
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3228
		    destWindow = __currentPointerView;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3229
		    if (destWindow == 0) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3230
			destWindow = hWnd;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3231
		    }
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3232
		} else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3233
		    destWindow = hWnd;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3234
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3235
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3236
		evMask = GetWindow_eventMask(destWindow);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3237
		if (evMask & (KeyPressMask | KeyReleaseMask)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3238
		    POINT p;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3239
		    int modifiers;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3240
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3241
		    modifiers = getModifiers();
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3242
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3243
		    p.x = evRootX;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3244
		    p.y = evRootY;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3245
		    ScreenToClient(destWindow, &p);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3246
		    x = p.x;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3247
		    y = p.y;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3248
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3249
		    if (evMask & KeyPressMask)
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3250
			enqEvent(KeyPressMask, destWindow, WM_KEYDOWN, wParam, x, y, lParam, modifiers | TRANSLATED_KEY, evTime);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3251
		    if (evMask & KeyReleaseMask)
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3252
			enqEvent(KeyReleaseMask, destWindow, WM_KEYUP, wParam, x, y, lParam, modifiers | TRANSLATED_KEY, evTime);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3253
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3254
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3255
	    *pDefault = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3256
	    return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3257
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3258
	case WM_KEYUP:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3259
	    EVENT_PRINTF2(("WM_KEYUP h=%x %x\n", hWnd, wParam));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3260
	    goto commonKeyUp;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3261
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3262
	case WM_SYSKEYUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3263
	    EVENT_PRINTF2(("WM_SYSKEYUP %x\n, wParam"));
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3264
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3265
	commonKeyUp:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3266
	    if (isNative) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3267
		return 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3268
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3269
	    {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3270
		HWND destWindow;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3271
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  3272
		if (__focusFollowsMouse) {
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3273
		    destWindow = __currentPointerView;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3274
		    if (destWindow == 0) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3275
			destWindow = hWnd;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3276
		    }
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3277
		} else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3278
		    destWindow = hWnd;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3279
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3280
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3281
		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
  3282
		    POINT p;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3283
		    int modifiers;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3284
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3285
		    p.x = evRootX;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3286
		    p.y = evRootY;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3287
		    ScreenToClient(destWindow, &p);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3288
		    x = p.x;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3289
		    y = p.y;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3290
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3291
		    modifiers = getModifiers();
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3292
		    enqEvent(KeyReleaseMask, destWindow, message, wParam, x, y, lParam, modifiers, evTime);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3293
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3294
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3295
	    *pDefault = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3296
	    return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3297
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3298
	case WM_SYSKEYDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3299
	    EVENT_PRINTF2(("WM_SYSKEYDOWN %x\n, wParam"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3300
	    goto commonKey;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3301
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3302
	case WM_KEYDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3303
	    EVENT_PRINTF2(("WM_KEYDOWN h=%x %x\n", hWnd, wParam));
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3304
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3305
	commonKey:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3306
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3307
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3308
	    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3309
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3310
#ifdef EXIT_WITH_3_CTRL_Cs
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3311
	    if ((msg.wParam == 'c')
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3312
	     && (GetKeyState(VK_CONTROL) & 0x8000)) {
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3313
		/* CTRL-C */
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3314
		if (ctrl_c_count++ > 3)  /* for debugging */
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3315
		    exit(1);
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3316
	    } else {
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3317
		if (msg.wParam != VK_CONTROL)
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3318
		    ctrl_c_count = 0;
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3319
	    }
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3320
#endif
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  3321
#ifdef RELEASE_CAPTURE_WITH_3_ESCAPEs
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3322
	    if (msg.wParam == VK_ESCAPE)) {
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3323
		/* ESCAPE */
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3324
		if (escape_count++ > 3) { 
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3325
		    __currentCapture = CAPTURE_NONE;
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3326
		    ReleaseCapture();
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3327
		    CPRINTF(("ReleaseCapture <ESC>\n"));
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3328
		}
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3329
	    } else {
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3330
		escape_count = 0;
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3331
	    }
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3332
#endif
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3333
	    /* FALL INTO */
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3334
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3335
	    {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3336
		HWND destWindow;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3337
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  3338
		if (__focusFollowsMouse) {
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3339
		    destWindow = __currentPointerView;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3340
		    if (destWindow == 0) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3341
			destWindow = hWnd;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3342
		    }
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3343
		} else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3344
		    destWindow = hWnd;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3345
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3346
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3347
		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
  3348
		    POINT p;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3349
		    int modifiers;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3350
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3351
		    p.x = evRootX;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3352
		    p.y = evRootY;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3353
		    ScreenToClient(destWindow, &p);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3354
		    x = p.x;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3355
		    y = p.y;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3356
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3357
		    modifiers = getModifiers();
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3358
		    enqEvent(KeyPressMask, destWindow, message, wParam, x, y, lParam, modifiers, evTime);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3359
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3360
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3361
	    *pDefault = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3362
	    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3363
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3364
#ifdef WM_MOUSEWHEEL
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3365
	case WM_MOUSEWHEEL:
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3366
	    {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3367
		HWND destWindow;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3368
		int modifiers;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3369
		int delta;
2733
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
  3370
		POINT p;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3371
                
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  3372
		if (__focusFollowsMouse) {
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3373
		    destWindow = __currentPointerView;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3374
		    if (destWindow == 0) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3375
			destWindow = hWnd;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3376
		    }
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3377
		} else {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3378
		    destWindow = hWnd;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3379
		}
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3380
2733
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
  3381
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3382
		EVENT_PRINTF(("WM_MOUSEWHEEL h=%x wP=%x lP=%x\n", hWnd, wParam, lParam));
2733
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
  3383
		if (GetWindow_eventMask(destWindow) & KeyPressMask) {
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
  3384
		    modifiers = getModifiers();
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
  3385
		    p.x = evRootX;
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
  3386
		    p.y = evRootY;
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
  3387
		    ScreenToClient(destWindow, &p);
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
  3388
		    x = p.x;
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
  3389
		    y = p.y;
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
  3390
		    delta = evTime - lastMouseWheelTime;
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
  3391
		    if (evTime < lastMouseWheelTime) {
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
  3392
			delta = (0xFFFFFFFF - lastMouseWheelTime) + evTime;
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
  3393
		    }
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3394
		    enqEvent(0, destWindow, message, wParam, x, y, lParam, modifiers, delta);
2733
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
  3395
		}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3396
		lastMouseWheelTime = evTime;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3397
	    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3398
	    *pDefault = 0;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3399
	    return 0;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3400
#endif
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3401
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3402
	case WM_MOUSEMOVE:
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3403
	    EVENT_PRINTF3(("WM_MOUSEMOVE h=%x\n", hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3404
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3405
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3406
	    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3407
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3408
	    {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3409
		short x, y;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3410
		int modifiers;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3411
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3412
		x = (int)(short)LOWORD(lParam);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3413
		y = (int)(short)HIWORD(lParam);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3414
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3415
		modifiers = getModifiers();
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3416
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3417
		if (__currentCapture == CAPTURE_NONE) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3418
		    if (hWnd != __currentPointerView) {
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3419
			HWND prevPointerView;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3420
2740
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  3421
			prevPointerView = __currentPointerView;
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  3422
			if (prevPointerView) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3423
			    if (inSizeMove) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3424
				if (needDelayedMouseLeaveWindow == NULL) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3425
				    needDelayedMouseLeaveWindow = __currentPointerView;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3426
				}
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3427
			    } else {
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3428
				if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3429
				    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, evTime);
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3430
				    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3431
				}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3432
			    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3433
			    __currentPointerView = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3434
			}
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3435
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3436
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3437
			if (__activateOnClick) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3438
			    /*
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3439
			     * only send mouseEnter if the window belongs to the current
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3440
			     * active window
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3441
			     */
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3442
			    if (GetTopParent(prevPointerView) == GetTopParent(hWnd)) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3443
			    }
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3444
			}
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3445
#endif
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3446
			if (inSizeMove) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3447
			    needDelayedMouseEnterWindow = hWnd;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3448
			    delayedMouseEnterX = x;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3449
			    delayedMouseEnterY = y;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3450
			} else {
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3451
			    if (GetWindow_eventMask(hWnd) & EnterWindowMask) {
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3452
				enqEvent(EnterWindowMask, hWnd, __WM_MOUSEENTER, 0, x, y, 0, modifiers, evTime);
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3453
				SetWindow_mouseXY(hWnd, x, y);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3454
			    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3455
			}
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3456
			__currentPointerView = hWnd;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3457
		    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3458
		    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
  3459
		} else {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3460
		    CPRINTF(("MouseMove Capture %x\n", __currentPointerView));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3461
		}
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3462
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3463
		if ((GetWindow_eventMask(__currentPointerView) & PointerMotionMask)
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3464
		 || (modifiers & AnyButtonMask)) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3465
		    if (! __eatingMouseEvents) {
3584
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
  3466
			if ((x == lastMotionX)
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
  3467
			 && (y == lastMotionY)
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
  3468
			 && (__currentPointerView == lastMotionWnd)) {
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
  3469
			    /* ignore */
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
  3470
			} else {
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
  3471
			    lastMotionX = x;
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
  3472
			    lastMotionY = y;
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
  3473
			    lastMotionWnd = __currentPointerView;
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3474
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3475
			    if ((GetWindow_mouseX(__currentPointerView) == x)
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3476
			     && (GetWindow_mouseY(__currentPointerView) == y)) {
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3477
			    } else {
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3478
				enqEvent(PointerMotionMask, __currentPointerView, WM_MOUSEMOVE, wParam, x, y, 0, modifiers, evTime);
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3479
				SetWindow_mouseXY(__currentPointerView, x, y);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3480
			    }
3584
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
  3481
			}
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3482
		    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3483
		}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3484
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3485
	    *pDefault = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3486
	    return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3487
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3488
	case WM_LBUTTONUP:
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3489
	    curButton = Button1;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3490
	    goto commonButtonUp;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3491
	case WM_MBUTTONUP:
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3492
	    curButton = Button2;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3493
	    goto commonButtonUp;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3494
	case WM_RBUTTONUP:
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3495
	    curButton = Button3;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3496
commonButtonUp:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3497
	    if (isNative) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3498
		return 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3499
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3500
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3501
	    if (__currentCapture == curButton /* CAPTURE_IMPLICIT*/) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3502
		__currentCapture = CAPTURE_NONE;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3503
		ReleaseCapture();
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  3504
		CPRINTF(("ReleaseCapture <BUTTONUP>\n"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3505
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3506
	    EVENT_PRINTF3(("WM_BUTTONUP h=%x pos=%d/%d\n",
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3507
			   hWnd, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam)));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3508
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3509
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3510
	    if (GetWindow_eventMask(hWnd) & ButtonReleaseMask) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3511
		int modifiers;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3512
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3513
		if (__eatingMouseEvents) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3514
		    __eatingMouseEvents = 0;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3515
		} else {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3516
		    modifiers = getModifiers();
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3517
		    enqEvent(ButtonReleaseMask, hWnd, 
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3518
			     message, wParam, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam),
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3519
			     wParam, modifiers, evTime);
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3520
		}
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3521
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3522
	    *pDefault = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3523
	    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3524
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3525
	case WM_LBUTTONDOWN:
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3526
	    curButton = Button1;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3527
	    goto commonButtonDown;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3528
	case WM_MBUTTONDOWN:
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3529
	    curButton = Button2;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3530
	    goto commonButtonDown;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3531
	case WM_RBUTTONDOWN:
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3532
	    curButton = Button3;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3533
commonButtonDown:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3534
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3535
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3536
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3537
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3538
	    if (__currentCapture == CAPTURE_NONE) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3539
		__currentCapture = curButton /*CAPTURE_IMPLICIT*/;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3540
		//SetFocus(hWnd);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3541
		SetCapture(hWnd);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  3542
		CPRINTF(("SetCapture <BUTTONDOWN>%x\n",hWnd));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3543
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3544
	    goto commonButton;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3545
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3546
	case WM_LBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3547
	case WM_MBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3548
	case WM_RBUTTONDBLCLK:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3549
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3550
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3551
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3552
	commonButton:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3553
	    EVENT_PRINTF3(("WM_BUTTONDOWN h=%x pos=%d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3554
			   hWnd, LOWORD(lParam), HIWORD(lParam)));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3555
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3556
	    if (GetWindow_eventMask(hWnd) & ButtonPressMask) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3557
		int modifiers;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3558
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3559
		if (__eatingMouseEvents) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3560
		    __eatingMouseEvents = 0;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3561
		} else {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3562
		    modifiers = getModifiers();
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3563
		    enqEvent(ButtonPressMask, hWnd, 
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3564
			     message, wParam, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam),
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3565
			     wParam, modifiers, evTime);
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3566
		}
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3567
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3568
	    *pDefault = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3569
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3570
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3571
	case WM_CAPTURECHANGED:
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3572
	    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
  3573
#if 0
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3574
	    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
  3575
	    {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3576
	    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3577
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3578
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3579
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3580
	case WM_KILLFOCUS:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3581
	    CPRINTF(("WM_KILLFOCUS\n"));
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3582
	    //enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3583
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3584
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3585
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3586
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3587
	    *pDefault = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3588
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3589
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3590
	case WM_SETFOCUS:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3591
	    CPRINTF(("WM_SETFOCUS %x\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3592
#if 0
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3593
	    //enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3594
	    {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3595
		POINT p;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3596
		HWND hWndChild,hWndTemp;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3597
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3598
		p.x = evRootX;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3599
		p.y = evRootY;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3600
		ScreenToClient(hWnd, &p);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3601
		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
  3602
		do {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3603
		    hWndTemp = hWndChild;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3604
		    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
  3605
		} while ((hWndChild) && (hWndChild != hWndTemp));
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  3606
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3607
		/*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
  3608
		if (hWndChild /*&& (hWndChild != hWnd)*/) {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3609
		    if (hWndChild != __currentPointerView) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3610
			int modifiers;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3611
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3612
			modifiers = getModifiers();
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3613
			if (__currentPointerView) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3614
			    if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask)
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3615
				enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3616
				SetWindow_mouseXY(__currentPointerView, -9999, -9999);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3617
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3618
			    __currentPointerView = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3619
			}
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3620
			if (GetWindow_eventMask(hWndChild) & EnterWindowMask) {
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3621
			    enqEvent(EnterWindowMask, hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers, EV_NOTIME);
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3622
			    SetWindow_mouseXY(hWndChild, evRootX, evRootY);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3623
			}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3624
			//SetFocus(hWndChild);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3625
			__currentPointerView = hWndChild;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3626
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3627
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3628
	    }
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3629
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3630
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3631
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3632
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3633
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3634
	    *pDefault = 0;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3635
#endif
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  3636
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3637
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3638
	case WM_STYLECHANGING:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3639
	    UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGING\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3640
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3641
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3642
	case WM_STYLECHANGED:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3643
	    UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGED\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3644
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3645
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3646
	case WM_GETTEXT:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3647
	    /*EVENT_PRINTF(("WM_GETTEXT %x\n", message));*/
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3648
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3649
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3650
	case WM_GETTEXTLENGTH:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3651
	    EVENT_PRINTF(("WM_GETTEXTLENGTH %x\n", message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3652
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3653
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3654
	case WM_NCCREATE:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3655
	    EVENT_PRINTF(("WM_NCCREATE %x\n", message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3656
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3657
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3658
	case WM_NCMOUSEMOVE:
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3659
	    if (__currentCapture == CAPTURE_NONE) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3660
		if (__currentPointerView && (hWnd != __currentPointerView)) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3661
		    if (inSizeMove) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3662
			if (needDelayedMouseLeaveWindow == NULL) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3663
			    needDelayedMouseLeaveWindow = __currentPointerView;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3664
			}
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3665
		    } else {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3666
			if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3667
			    int modifiers;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3668
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3669
			    modifiers = getModifiers();
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3670
			    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, evTime);
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3671
			    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3672
			}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3673
		    }
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3674
		    __currentPointerView = 0;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  3675
		}
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  3676
	    }
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  3677
	    *pDefault = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3678
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3679
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3680
	case WM_PARENTNOTIFY:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3681
	    EVENT_PRINTF2(("WM_PARENTNOTIFY h=%x hChild=%x %d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3682
				hWnd, lParam, LOWORD(wParam)));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3683
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3684
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3685
	case WM_NCLBUTTONDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3686
	    EVENT_PRINTF(("WM_NCLBUTTONDOWN\n"));
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3687
	    if (__shiftedLeftButtonIsLowerWindow) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3688
		/*
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3689
		 * with shift, this is a lower-operation
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3690
		 */
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3691
		if (GetKeyState(VK_SHIFT) & 0x8000) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3692
		    SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0, 
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3693
				 SWP_NOSENDCHANGING |
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3694
				 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3695
		    *pDefault = 0;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3696
		}
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3697
	    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3698
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3699
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3700
	case WM_NCLBUTTONUP:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3701
	    EVENT_PRINTF(("WM_NCLBUTTONUP\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3702
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3703
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3704
	case WM_NCRBUTTONDOWN:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3705
	    EVENT_PRINTF(("WM_NCRBUTTONDOWN\n"));
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3706
	    if (__rightButtonIsLowerWindow) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3707
		/*
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3708
		 * this is a lower-operation
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3709
		 */
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3710
		SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0, 
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3711
			     SWP_NOSENDCHANGING |
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3712
			     SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3713
		*pDefault = 0;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3714
	    }
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3715
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3716
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3717
	case WM_NCRBUTTONUP:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3718
	    EVENT_PRINTF(("WM_NCRBUTTONUP\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3719
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3720
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3721
	case WM_NCMBUTTONDOWN:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3722
	    EVENT_PRINTF(("WM_NCMBUTTONDOWN\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3723
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3724
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3725
	case WM_NCMBUTTONUP:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3726
	    EVENT_PRINTF(("WM_NCMBUTTONUP\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3727
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3728
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  3729
	case WM_NCLBUTTONDBLCLK:
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  3730
	    EVENT_PRINTF(("WM_NCLBUTTONDBLCLK\n"));
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  3731
	    break;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  3732
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  3733
	case WM_NCRBUTTONDBLCLK:
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  3734
	    EVENT_PRINTF(("WM_NCRBUTTONDBLCLK\n"));
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  3735
	    break;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  3736
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  3737
	case WM_NCMBUTTONDBLCLK:
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  3738
	    EVENT_PRINTF(("WM_NCMBUTTONDBLCLK\n"));
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  3739
	    break;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  3740
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3741
	case WM_SETTEXT:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3742
	    EVENT_PRINTF(("WM_SETTEXT\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3743
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3744
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3745
#ifdef WM_SYNCPAINT
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3746
	case WM_SYNCPAINT:
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3747
	    EVENT_PRINTF(("WM_SYNCPAINT\n"));
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3748
	    break;
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3749
#else
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3750
	case 0x88:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3751
	    EVENT_PRINTF(("0x88 (undoc)\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3752
	    break;
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3753
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3754
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3755
	case WM_NCCALCSIZE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3756
	    EVENT_PRINTF(("WM_NCCALCSIZE\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3757
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3758
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3759
	case WM_NCPAINT:
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3760
	    EVENT_PRINTF3(("WM_NCPAINT\n"));
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3761
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3762
#ifdef THIS_DOES_NOT_WORK
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3763
	    /* mhmh - something is drawn, but clipped wrong
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3764
	     * and with wrong colors ....
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3765
	     */
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3766
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3767
	    /*
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3768
	     * child windows only ...
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3769
	     */
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3770
	    if (GetParent(hWnd)) {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3771
		int clr;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3772
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3773
		clr = GetWindow_bdColor(hWnd);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3774
		if (clr != BlackPixel) {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3775
		    /*
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3776
		     * draw it here
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3777
		     */
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3778
		    HBRUSH br;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3779
		    RECT rect, lineRect;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3780
		    HDC hDC;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3781
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3782
		    if (clr == WhitePixel) {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3783
			br = __whiteBrush;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3784
		    } else {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3785
			br = CreateSolidBrush(clr);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3786
		    }
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3787
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3788
		    GetWindowRect(hWnd, &rect);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3789
		    hDC = GetWindowDC(hWnd);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3790
		    SelectClipRgn(hDC, NULL);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3791
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3792
		    lineRect.left = rect.left;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3793
		    lineRect.right = rect.right;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3794
		    lineRect.top = rect.top;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3795
		    lineRect.bottom = rect.top + 1;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3796
		    FillRect(hDC, &lineRect, br);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3797
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3798
		    lineRect.bottom = rect.bottom - 1;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3799
		    lineRect.bottom = rect.bottom;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3800
		    FillRect(hDC, &lineRect, br);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3801
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3802
		    lineRect.top = rect.top;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3803
		    lineRect.bottom = rect.bottom;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3804
		    lineRect.left = rect.left;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3805
		    lineRect.right = rect.left + 1;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3806
		    FillRect(hDC, &lineRect, br);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3807
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3808
		    lineRect.left = rect.right - 1;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3809
		    lineRect.right = rect.right;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3810
		    FillRect(hDC, &lineRect, br);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3811
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3812
		    _DeleteBrush(br, __LINE__);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3813
		    ReleaseDC(hWnd, hDC);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3814
		    *pDefault = 0;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3815
		    return 0;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3816
		}
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3817
	    }
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3818
#endif /* THIS_DOES_NOT_WORK */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3819
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3820
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3821
	case WM_SYSCOMMAND:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3822
	    switch (wParam & ~0x000F) {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3823
		case SC_CLOSE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3824
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_CLOSE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3825
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3826
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3827
		case SC_MOVE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3828
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_MOVE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3829
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3830
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3831
		case SC_RESTORE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3832
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_RESTORE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3833
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3834
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3835
		case SC_SIZE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3836
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_SIZE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3837
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3838
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3839
		default:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3840
		    EVENT_PRINTF2(("WM_SYSCOMMAND %x\n", wParam));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3841
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3842
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3843
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3844
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3845
	case WM_INITMENU:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3846
	    EVENT_PRINTF(("WM_INITMENU\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3847
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3848
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3849
	case WM_INITMENUPOPUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3850
	    EVENT_PRINTF(("WM_INITMENUPOPUP\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3851
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3852
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3853
	case WM_ENTERIDLE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3854
	    EVENT_PRINTF(("WM_ENTERIDLE\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3855
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3856
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3857
	case WM_ENTERMENULOOP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3858
	    EVENT_PRINTF(("WM_ENTERMENULOOP\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3859
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3860
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3861
	case WM_EXITMENULOOP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3862
	    EVENT_PRINTF(("WM_EXITMENULOOP\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3863
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3864
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3865
	case WM_MENUSELECT:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3866
	    EVENT_PRINTF(("WM_MENUSELECT\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3867
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3868
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3869
	case WM_QUIT:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3870
	    UNHANDLED_EVENT_PRINTF(("WM_QUIT\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3871
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3872
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3873
	case WM_NCDESTROY:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3874
	    EVENT_PRINTF(("WM_NCDESTROY\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3875
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3876
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3877
	case WM_QUERYNEWPALETTE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3878
	    EVENT_PRINTF(("WM_QUERYNEWPALETTE\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3879
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3880
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3881
	case WM_PALETTECHANGED:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3882
	    EVENT_PRINTF(("WM_PALETTECHANGED\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3883
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3884
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3885
	case WM_ACTIVATEAPP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3886
	    EVENT_PRINTF2(("WM_ACTIVATEAPP %s\n", wParam ? "active" : "inactive"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3887
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3888
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3889
	case WM_SYSDEADCHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3890
	    EVENT_PRINTF2(("WM_SYSDEADCHAR %x\n, wParam"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3891
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3892
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3893
	case WM_DEADCHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3894
	    EVENT_PRINTF2(("WM_DEADCHAR %x\n, wParam"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3895
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3896
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3897
	case WM_PAINTICON:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3898
	    EVENT_PRINTF(("WM_PAINTICON\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3899
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3900
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3901
	case WM_ICONERASEBKGND:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3902
	    EVENT_PRINTF(("WM_ICONERASEBKGND\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3903
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3904
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3905
	case WM_WINDOWPOSCHANGING:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3906
	    EVENT_PRINTF(("WM_WINDOWPOSCHANGING\n"));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3907
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3908
#ifdef HANDLE_VIEWGRAVITY
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3909
	    /*
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3910
	     * any child with a viewGravity ?
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3911
	     * (only care for topViews here; 
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3912
	     *  child views do it on the smalltalk level ...)
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3913
	     */
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3914
	    if (GetParent(hWnd) == 0) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3915
		if (GetParent(hWnd) == 0) {
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3916
		    struct gravityCallBackInfo i;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3917
		    RECT rct, dRect;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3918
		    int dW, dH;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3919
		    WINDOWPOS *wp = (WINDOWPOS *)lParam;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3920
		    int winStyleBits, winExStyleBits;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3921
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3922
		    if (! (wp->flags & SWP_NOSIZE)) {
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3923
			dRect.left = 0;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3924
			dRect.top = 0;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3925
			dRect.right = 100;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3926
			dRect.bottom = 100;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3927
			winStyleBits = GetWindowLong(hWnd, GWL_STYLE);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3928
			winExStyleBits = GetWindowLong(hWnd, GWL_EXSTYLE);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3929
			AdjustWindowRectEx(&dRect, winStyleBits, 0, winExStyleBits);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3930
			dW = dRect.right - dRect.left;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3931
			dH = dRect.bottom - dRect.top;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3932
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3933
			GetClientRect(hWnd, &rct);   
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3934
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3935
			i.parent = hWnd;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3936
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3937
			i.currW = rct.right - rct.left;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3938
			i.currH = rct.bottom - rct.top;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3939
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3940
			/* wp gives us the new outer (frame) bounds */
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3941
			i.newW = wp->cx - (dW - 100);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3942
			i.newH = wp->cy - (dH - 100);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3943
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3944
			if ((i.currW != i.newW)
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3945
			 || (i.currH != i.newH)) {
2740
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  3946
			    DPRINTF((stderr, "about to sizeChange old: %d/%d new: %d/%d\n",
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  3947
				    i.currW, i.currH, i.newW, i.newH));
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3948
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3949
			    GetWindowRect(hWnd, &rct);
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3950
			    i.parentWinX = rct.left - dRect.left;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3951
			    i.parentWinY = rct.top - dRect.top;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3952
			    EnumChildWindows(hWnd, gravityEnumeratorCallBack, (int)(&i));
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3953
			}
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3954
		    }
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3955
		}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3956
	    }
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3957
#endif /* HANDLE_VIEWGRAVITY */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  3958
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3959
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3960
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3961
	case WM_QUERYOPEN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3962
	    EVENT_PRINTF(("WM_QUERYOPEN\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3963
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3964
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3965
	case WM_QUERYENDSESSION:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3966
	    EVENT_PRINTF(("WM_QUERYENDSESSION\n"));
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3967
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  3968
	    // 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
  3969
	    // 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
  3970
	    // arrives from smalltalk
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  3971
	    // (either positive or negative).
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  3972
	    // 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
  3973
	    // 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
  3974
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  3975
	    *pDefault = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3976
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3977
2602
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  3978
	case WM_DISPLAYCHANGE:
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  3979
	    EVENT_PRINTF(("WM_DISPLAYCHANGE\n"));
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3980
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
2602
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  3981
	    break;
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  3982
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3983
	case WM_FONTCHANGE:
2602
2d8af0930e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2601
diff changeset
  3984
	    EVENT_PRINTF(("WM_FONTCHANGE\n"));
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3985
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3986
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3987
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3988
	case WM_WININICHANGE:
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3989
	    EVENT_PRINTF(("WM_WININICHANGE\n"));
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3990
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3991
	    break;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  3992
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3993
	case WM_SYSCOLORCHANGE:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3994
	    EVENT_PRINTF(("WM_SYSCOLORCHANGE\n"));
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3995
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3996
	    break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3997
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3998
	case WM_MOVING:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3999
	    EVENT_PRINTF(("WM_MOVING\n"));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4000
#ifdef DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4001
	    inMove = 1;    
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4002
#endif
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4003
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4004
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4005
	case WM_SIZING:
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4006
	    EVENT_PRINTF(("WM_SIZING\n"));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4007
#ifdef DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4008
	    inSize = 1;    
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4009
#endif
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4010
	    break;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4011
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4012
	case WM_ENTERSIZEMOVE:
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4013
	    EVENT_PRINTF(("WM_ENTERSIZEMOVE\n"));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4014
#ifdef DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4015
	    inSizeMove = 1;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4016
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4017
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4018
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4019
	case WM_EXITSIZEMOVE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4020
	    EVENT_PRINTF(("WM_EXITSIZEMOVE\n"));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4021
	    inSizeMove = inMove = inSize = 0;
2740
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4022
	    {
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4023
		int modifiers;
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4024
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4025
		if (needDelayedMouseLeaveWindow || needDelayedMouseEnterWindow) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4026
		    modifiers = getModifiers();
2740
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4027
		}
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4028
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4029
		if (needDelayedMouseLeaveWindow) {
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4030
		    if (GetWindow_eventMask(needDelayedMouseLeaveWindow) & LeaveWindowMask) {
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  4031
			enqEvent(LeaveWindowMask, needDelayedMouseLeaveWindow, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  4032
			SetWindow_mouseXY(needDelayedMouseLeaveWindow, -9999, -9999);
2740
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4033
		    }
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4034
		    needDelayedMouseLeaveWindow = NULL;
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4035
		}
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4036
		if (needDelayedMouseEnterWindow) {
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4037
		    if (GetWindow_eventMask(needDelayedMouseEnterWindow) & EnterWindowMask) {
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  4038
			enqEvent(EnterWindowMask, needDelayedMouseEnterWindow, __WM_MOUSEENTER, 0, delayedMouseEnterX, delayedMouseEnterY, 0, modifiers, EV_NOTIME);
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  4039
			SetWindow_mouseXY(needDelayedMouseEnterWindow, delayedMouseEnterX, delayedMouseEnterY);
2740
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4040
		    }
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4041
		    needDelayedMouseEnterWindow = NULL;
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4042
		}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4043
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4044
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4045
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4046
	case WM_MOVE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4047
	    EVENT_PRINTF(("WM_MOVE\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4048
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4049
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4050
	case WM_POWER:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4051
	    UNHANDLED_EVENT_PRINTF(("WM_POWER\n"));
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  4052
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4053
	    break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4054
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4055
#if 0
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4056
	case WM_NULL:                       
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4057
	    EVENT_PRINTF(("WM_NULL\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4058
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4059
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4060
	case WM_ENABLE:                       
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4061
	    EVENT_PRINTF(("WM_ENABLE\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4062
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4063
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4064
	case WM_SETREDRAW:                       
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4065
	    EVENT_PRINTF(("WM_SETREDRAW\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4066
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4067
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4068
	case WM_DEVMODECHANGE:                
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4069
	    EVENT_PRINTF(("WM_DEVMODECHANGE\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4070
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4071
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4072
	case WM_TIMECHANGE:                   
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4073
	    EVENT_PRINTF(("WM_TIMECHANGE\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4074
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4075
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4076
	case WM_CANCELMODE:                   
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4077
	    EVENT_PRINTF(("WM_CANCELMODE\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4078
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4079
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4080
	case WM_CHILDACTIVATE:                
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4081
	    EVENT_PRINTF(("WM_CHILDACTIVATE\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4082
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4083
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4084
	case WM_QUEUESYNC:                    
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4085
	    EVENT_PRINTF(("WM_QUEUESYNC\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4086
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4087
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4088
	case WM_NEXTDLGCTL:                   
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4089
	    EVENT_PRINTF(("WM_NEXTDLGCTL\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4090
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4091
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4092
	case WM_SPOOLERSTATUS:               
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4093
	    EVENT_PRINTF(("WM_SPOOLERSTATUS\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4094
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4095
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4096
	case WM_DRAWITEM:                     
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4097
	    EVENT_PRINTF(("WM_DRAWITEM\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4098
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4099
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4100
	case WM_MEASUREITEM:                  
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4101
	    EVENT_PRINTF(("WM_MEASUREITEM\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4102
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4103
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4104
	case WM_DELETEITEM:                   
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4105
	    EVENT_PRINTF(("WM_DELETEITEM\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4106
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4107
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4108
	case WM_VKEYTOITEM:                   
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4109
	    EVENT_PRINTF(("WM_VKEYTOITEM\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4110
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4111
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4112
	case WM_CHARTOITEM:                   
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4113
	    EVENT_PRINTF(("WM_CHARTOITEM\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4114
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4115
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4116
	case WM_SETFONT:                      
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4117
	    EVENT_PRINTF(("WM_SETFONT\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4118
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4119
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4120
	case WM_GETFONT:                      
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4121
	    EVENT_PRINTF(("WM_GETFONT\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4122
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4123
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4124
	case WM_SETHOTKEY:                    
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4125
	    EVENT_PRINTF(("WM_SETHOTKEY\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4126
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4127
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4128
	case WM_GETHOTKEY:                    
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4129
	    EVENT_PRINTF(("WM_GETHOTKEY\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4130
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4131
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4132
	case WM_QUERYDRAGICON:                
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4133
	    EVENT_PRINTF(("WM_QUERYDRAGICON\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4134
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4135
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4136
	case WM_COMPAREITEM:                  
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4137
	    EVENT_PRINTF(("WM_COMPAREITEM\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4138
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4139
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4140
	case WM_GETOBJECT:                    
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4141
	    EVENT_PRINTF(("WM_GETOBJECT\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4142
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4143
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4144
	case WM_COMPACTING:                   
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4145
	    EVENT_PRINTF(("WM_COMPACTING\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4146
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4147
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4148
	case WM_COMMNOTIFY:                   
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4149
	    EVENT_PRINTF(("WM_COMMNOTIFY\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4150
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4151
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4152
	case WM_COPYDATA:                     
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4153
	    EVENT_PRINTF(("WM_COPYDATA\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4154
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4155
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4156
	case WM_CANCELJOURNAL:                
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4157
	    EVENT_PRINTF(("WM_CANCELJOURNAL\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4158
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4159
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4160
	case WM_NOTIFY:                
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4161
	    EVENT_PRINTF(("WM_NOTIFY\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4162
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4163
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4164
	case WM_INPUTLANGCHANGEREQUEST:                
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4165
	    EVENT_PRINTF(("WM_INPUTLANGCHANGEREQUEST\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4166
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4167
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4168
	case WM_INPUTLANGCHANGE:                
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4169
	    EVENT_PRINTF(("WM_INPUTLANGCHANGE\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4170
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4171
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4172
	case WM_TCARD:                
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4173
	    EVENT_PRINTF(("WM_TCARD\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4174
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4175
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4176
	case WM_HELP:                
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4177
	    EVENT_PRINTF(("WM_HELP\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4178
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4179
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4180
	case WM_USERCHANGED:                
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4181
	    EVENT_PRINTF(("WM_USERCHANGED\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4182
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4183
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4184
	case WM_NOTIFYFORMAT:                
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4185
	    EVENT_PRINTF(("WM_NOTIFYFORMAT\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4186
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4187
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4188
	case WM_CONTEXTMENU:                
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4189
	    EVENT_PRINTF(("WM_CONTEXTMENU\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4190
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4191
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4192
	case WM_GETICON:                
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4193
	    EVENT_PRINTF(("WM_GETICON\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4194
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4195
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4196
	case WM_SETICON:                
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4197
	    EVENT_PRINTF(("WM_SETICON\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4198
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4199
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4200
	case WM_NCXBUTTONDOWN:                
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4201
	    EVENT_PRINTF(("WM_NCXBUTTONDOWN\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4202
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4203
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4204
	case WM_NCXBUTTONUP:                
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4205
	    EVENT_PRINTF(("WM_NCXBUTTONUP\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4206
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4207
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4208
	case WM_NCXBUTTONDBLCLK:                
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4209
	    EVENT_PRINTF(("WM_NCXBUTTONDBLCLK\n"));
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4210
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4211
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4212
#endif
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4213
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4214
	default:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4215
	    UNHANDLED_EVENT_PRINTF(("WinWorkstat [info]: unhandled msg = %x\n", message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4216
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4217
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4218
    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4219
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4220
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4221
LONG APIENTRY
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4222
MainWndProc(HWND hWnd,UINT message,UINT wParam,LONG lParam);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4223
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4224
static void _USERENTRY
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4225
dispatchThread(void *arg)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4226
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4227
    static int th_calls;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4228
    RECT rect;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4229
    MSG msg;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4230
    localWindowInfo *lI;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4231
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4232
    _dispatchThreadId = GetCurrentThreadId();
3828
95fb5ef238f9 *** empty log message ***
penk
parents: 3810
diff changeset
  4233
    /* fprintf(stderr, "WinWorkstation [info]: dispatchThreadID=%d\n", _dispatchThreadId); */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4234
    TH_DPRINTF(("TS %d\n", th_calls++));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4235
    PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE);   /* must be */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4236
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4237
#ifndef WIN32THREADS
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4238
    AttachThreadInput(_dispatchThreadId, _masterThreadId, TRUE);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4239
# if 0
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4240
    SetThreadPriority(_masterThread,THREAD_PRIORITY_HIGHEST);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4241
    SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_ABOVE_NORMAL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4242
# endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4243
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4244
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4245
    GetWindowRect(GetDesktopWindow(), &rect);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4246
    /* allocate localMemory for Window */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4247
    lI = (localWindowInfo *)malloc(sizeof(localWindowInfo));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4248
    if (lI) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4249
	memset(lI, 0, sizeof(*lI));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4250
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4251
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4252
    __rootWinSpezial = CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_TRANSPARENT,
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4253
				      app_nameRoot, app_nameRoot,
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4254
				      WS_POPUP | WS_DISABLED,
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4255
				      0, 0,
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  4256
				      rect.right - rect.left, rect.bottom - rect.top,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4257
				      0, 0, (HANDLE) __getHInstance(), lI);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4258
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4259
#if 0
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4260
    printf("__rootWinSpezial %x\n",__rootWinSpezial);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4261
#endif
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  4262
    //ShowWindow(__rootWinSpezial,SW_SHOWNOACTIVATE);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4263
    SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0, 
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4264
		 SWP_NOSENDCHANGING |
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4265
		 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4266
    SetEvent(hCreateEvent);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4267
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4268
    for (;;) {
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  4269
	HANDLE dummy;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4270
	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
  4271
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4272
	/*
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4273
	 * if there is no current capture (pointer-grab),
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4274
	 * make certain that we do not get stuck in the GetMessage
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4275
	 * but instead poll the mouse in 200ms intervals.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4276
	 * This is required to synthesize the MOUSELEAVE message,
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4277
	 */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4278
	if (__currentPointerView && (__currentCapture == CAPTURE_NONE)) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4279
	    while (PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE) == 0) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4280
		/*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4281
		 * 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
  4282
		 */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4283
		if (MsgWaitForMultipleObjects(0,&dummy,FALSE,200,QS_ALLINPUT) == WAIT_TIMEOUT) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4284
		    if (! inSizeMove) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4285
			/*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4286
			 * timeout - see where mouse pointer is
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4287
			 * for synthetic leave events.
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4288
			 */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4289
			POINT point;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4290
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4291
			if (GetCursorPos(&point)) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4292
			    HWND hWnd = WindowFromPoint(point);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4293
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4294
			    if (hWnd) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4295
				if (GetWindowThreadProcessId(hWnd,0) != GetCurrentThreadId()) {
2740
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4296
				    if (inSizeMove) {
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4297
					if (needDelayedMouseLeaveWindow == NULL) {
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4298
					    needDelayedMouseLeaveWindow = __currentPointerView;
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4299
					}
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4300
				    } else {
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  4301
					if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  4302
					    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers(), EV_NOTIME);
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  4303
					    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  4304
					}
2740
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4305
				    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4306
				    __currentPointerView = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4307
				    break;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4308
				}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4309
			    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4310
			}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4311
		    }
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  4312
		}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4313
	    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4314
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4315
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4316
	GetMessage(&msg, NULL, 0, 0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4317
	TH_DPRINTF(("TD %d\n", th_calls++));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4318
	destroyWin = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4319
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4320
	switch (msg.message) {
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4321
#if 0
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  4322
	    case WM_THREAD_DESTROYWINDOW:
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4323
		destroyWin = TRUE;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4324
		msg.message = WM_CLOSE;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  4325
		EVENT_PRINTF(("thread WM_THREAD_DESTROYWINDOW %x\n",msg.hwnd));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4326
		break;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4327
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4328
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4329
#ifdef SET_FOCUS_IN_WINTHREAD
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  4330
	    case WM_THREAD_SETFOCUS:
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4331
# ifdef xxWIN32THREADS
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4332
		if (msg.lParam) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4333
		    if (AttachThreadInput(_dispatchThreadId,msg.lParam,TRUE) == FALSE)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4334
			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
  4335
		}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4336
# endif
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  4337
		EVENT_PRINTF(("threadSetfocus %x\n",msg.wParam));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4338
		if (SetFocus((HWND)msg.wParam) == 0) {
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  4339
		    DDPRINTF(("SetFocus to %x failed.\n",msg.wParam));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4340
		}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4341
		continue;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4342
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4343
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4344
#ifdef SET_CURSOR_IN_WINTHREAD
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  4345
	    case WM_THREAD_SETCURSOR:
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4346
		if (msg.lParam) {
3951
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
  4347
		    if( __isWinNT_NEW_BEHAVIOUR ) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4348
			SetCursor((HCURSOR)msg.lParam);
3951
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
  4349
		    } else {
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4350
			POINT p;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4351
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4352
			GetCursorPos(&p);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4353
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4354
			if (WindowFromPoint(p) == msg.hwnd) {
3951
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
  4355
			    EVENT_PRINTF(("threadSetCursor %x\n",msg.lParam));
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
  4356
			    SetCursor((HCURSOR)msg.lParam);
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4357
			}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4358
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4359
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4360
		continue;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4361
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4362
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  4363
#ifdef BEEP_IN_WINTHREAD
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  4364
	    case WM_THREAD_BEEP:
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  4365
		MessageBeep( MB_ICONEXCLAMATION);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  4366
		continue;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  4367
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  4368
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  4369
	    case WM_THREAD_SETCAPTURE:
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4370
		if (msg.wParam) {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4371
		    if (__currentPointerView) {
2740
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4372
			if (inSizeMove) {
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4373
			    if (needDelayedMouseLeaveWindow == NULL) {
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4374
				needDelayedMouseLeaveWindow = __currentPointerView;
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4375
			    }
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4376
			} else {
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  4377
			    if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  4378
				enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers(), EV_NOTIME);
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  4379
				SetWindow_mouseXY(__currentPointerView, -9999, -9999);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  4380
			    }
2740
ccf206833806 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2736
diff changeset
  4381
			}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4382
		    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4383
		    __currentPointerView = msg.wParam;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4384
		    __currentCapture = CAPTURE_EXPLICIT;
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  4385
		    EVENT_PRINTF(("threadSetCapture %x\n",msg.wParam));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4386
		    SetCapture(__currentPointerView);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4387
		} else {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4388
		    if (__currentPointerView  == __rootWinSpezial) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4389
			//ShowWindow(__rootWinSpezial, SW_HIDE);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4390
			SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0,
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4391
				     SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4392
				     | SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4393
				   /*| 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
  4394
		    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4395
		    __currentPointerView = 0;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4396
		    __currentCapture = CAPTURE_NONE;
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  4397
		    EVENT_PRINTF(("threadReleaseCapture\n"));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4398
		    ReleaseCapture();
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4399
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4400
		if (msg.lParam) {
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  4401
		    DDPRINTF(("threadSetCursor %x\n",msg.lParam));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4402
		    SetCursor((HCURSOR)msg.lParam);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4403
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4404
		continue;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4405
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  4406
	    case WM_THREAD_CREATEWINDOW:
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  4407
		EVENT_PRINTF(("*WM_THREAD_CREATEWINDOW %d\n", th_calls));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4408
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4409
		{
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4410
		    createWindowInfo *cwi = (createWindowInfo *)(msg.lParam);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4411
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4412
		    if ((cwi->sequenceNr == msg.wParam) 
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4413
		     && (cwi->sequenceNr != INVALIDATED_CWI)) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4414
			cwi->sequenceNr = INVALIDATED_CWI;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4415
			cwi->infoWasRead = 1;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4416
			if (cwi->newWinHandle == NULL) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4417
			    HANDLE ev;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4418
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4419
			    cwi->newWinHandle = CreateWindowEx(
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4420
						    cwi->winStyleBitsEx,
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4421
						    cwi->className,
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4422
						    cwi->windowName,
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4423
						    cwi->winStyleBits,
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4424
						    cwi->x, cwi->y,
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4425
						    cwi->dx, cwi->dy,
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4426
						    cwi->parentHandle,
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4427
						    NULL,           /* menu */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4428
						    (HANDLE) __getHInstance(),
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4429
						    cwi->localWindowInfo 
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4430
						   );
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4431
                    
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4432
			    if (cwi->newWinHandle == NULL) {
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  4433
				fprintf(stderr, "WinWorkstation [info]: CreateWindow failed: %d\n", GetLastError());
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4434
			    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4435
			    ev = cwi->hCreateEvent;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4436
			    if (ev) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4437
				SetEvent(ev);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4438
			    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4439
			}
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4440
		    } else {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4441
			DPRINTF(("obsolete createWindow message %x ignored\n", cwi->sequenceNr));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4442
		    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4443
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4444
		continue;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4445
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4446
	    case WM_KEYDOWN:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4447
	    case WM_KEYUP:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4448
	    case WM_SYSKEYDOWN:
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4449
	    case WM_SYSKEYUP:
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  4450
		EVENT_PRINTF(("*WM_keymsg %x\n", msg.wParam));
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  4451
		if (((msg.wParam >= '0') && (msg.wParam <= 'Z'))
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  4452
		 || ((msg.wParam >= VK_MULTIPLY) && (msg.wParam <= VK_DIVIDE))
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  4453
		 || (msg.wParam == VK_SPACE)
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  4454
		 || (msg.wParam == VK_CAPITAL)
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  4455
		 /*|| (msg.wParam == VK_SHIFT)*/
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  4456
		 || (msg.wParam >= 0xB0)) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4457
		    /*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4458
		     * 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
  4459
		     */
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4460
		    if (TranslateMessage(&msg))
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4461
			continue;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4462
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4463
		break;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4464
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4465
	    /* short cirquit some messages */
3574
db1360ba8dea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3573
diff changeset
  4466
#if 0
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4467
#ifndef SUPPORT_NATIVE_WINDOWS
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  4468
	    /*
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  4469
	     * some can simply be ignored ...
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  4470
	     */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4471
	    case WM_ERASEBKGND:
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  4472
		EVENT_PRINTF(("*WM_ERASEBKGND\n"));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4473
		continue;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4474
	    case WM_KILLFOCUS:
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  4475
		EVENT_PRINTF(("*WM_KILLFOCUS\n"));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4476
		continue;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4477
#endif
3574
db1360ba8dea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3573
diff changeset
  4478
#endif
db1360ba8dea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3573
diff changeset
  4479
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4480
#if 0
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4481
	    case WM_SIZE:
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  4482
		EVENT_PRINTF(("*WM_SIZE\n"));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4483
		continue;
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  4484
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4485
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4486
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4487
	/*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4488
	 * common ...
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4489
	 */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4490
	evRootX = msg.pt.x;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4491
	evRootY = msg.pt.y;
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  4492
#if 1
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  4493
	{
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  4494
	    POINT p;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  4495
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  4496
	    if (GetCursorPos(&p)) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  4497
		evRootX = p.x;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  4498
		evRootY = p.y;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  4499
	    }
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  4500
	}
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  4501
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4502
	lastMSGTime = msg.time;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4503
	DispatchMessage(&msg);   /* Dispatches message to window */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4504
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4505
    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4506
}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4507
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4508
LONG APIENTRY
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4509
MainWndProc(HWND hWnd,UINT message,UINT wParam,LONG lParam)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4510
{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4511
    int wantDefault = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4512
    int retVal;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4513
    createWindowInfo *cwi;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4514
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4515
    TH_DPRINTF(("TMW %d\n",message));
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4516
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4517
    /*
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4518
     * kludge while in sizeMove loop, which
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4519
     * is performed directly by DefWindowProc
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  4520
     * even more of a kludge: to prevent the message in the PostThreadMessage-queue
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  4521
     * from being processed twice, we use a sequenceNr, which is passed as wParam.
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4522
     */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4523
    if (cwi = pendingCREATEWINDOWInfo) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4524
	int dummyWantDefault;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4525
	int seqNr = pendingSequenceNr;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4526
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4527
	pendingCREATEWINDOWInfo = 0;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4528
	pendingSequenceNr = INVALIDATED_CWI;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4529
	DPRINTF(("### THREAD_CREATEWINDOW\n"));
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4530
	winEventProcessing(0, WM_THREAD_CREATEWINDOW, seqNr, cwi, &dummyWantDefault);        
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4531
    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4532
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4533
    retVal = winEventProcessing(hWnd, message, wParam, lParam, &wantDefault);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4534
    if (wantDefault) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4535
	DDPRINTF((">>DefWindowProc\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4536
	retVal = DefWindowProc(hWnd, message, wParam, lParam);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4537
	DDPRINTF(("<<DefWindowProc\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4538
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4539
    return retVal;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4540
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4541
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4542
static int CALLBACK
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4543
EnumWindowsProc( hwnd, lParam )
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4544
	HWND            hwnd;
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4545
	LPARAM          lParam;
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4546
{
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4547
	OBJ *refToCollection;
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4548
	OBJ collection;
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4549
	OBJ wHandle;
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4550
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4551
	if (hwnd) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4552
	    refToCollection = (OBJ*) lParam;
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4553
	    __PROTECT__(*refToCollection);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4554
	    wHandle = __MKEXTERNALADDRESS(hwnd);    
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4555
	    __UNPROTECT__(*refToCollection);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4556
	    collection = *refToCollection;
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4557
	    __SSEND1( collection, @symbol(add:), 0, wHandle );
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4558
	}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4559
	return TRUE;
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4560
}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4561
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4562
#define xxUSE_EnumFontFamiliesEx
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4563
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4564
static int CALLBACK
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4565
EnumFPTypeFaceProc( lplf, lptm, dwType, lpData )
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4566
#ifdef USE_EnumFontFamiliesEx
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4567
	ENUMLOGFONTEX   *lplf;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4568
#else
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4569
	LOGFONT         *lplf;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4570
#endif
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4571
	TEXTMETRIC      *lptm;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4572
	DWORD           dwType;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4573
	LPARAM          lpData;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4574
{
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4575
	OBJ t;
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4576
	OBJ *refToList;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4577
	OBJ  typeFaceList;
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4578
	char *faceNameString;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4579
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4580
	if (lplf) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4581
	    refToList = (OBJ*) lpData;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4582
	    __PROTECT__(*refToList);
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4583
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4584
#ifdef USE_EnumFontFamiliesEx
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4585
	    faceNameString = lplf->elfLogFont.lfFaceName;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4586
#else
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4587
	    faceNameString = lplf->lfFaceName;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4588
#endif
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4589
	    t = __MKSTRING( faceNameString );
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4590
	    __UNPROTECT__(*refToList);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4591
	    typeFaceList = *refToList;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4592
	    __SSEND1( typeFaceList, @symbol(add:), 0, t );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4593
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4594
	return 1;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4595
}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4596
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4597
/*
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4598
 * take a LOGFONT structure and extract relevant data into a smalltalk array.
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4599
 *
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4600
 * Returned value is:
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4601
 *      #(
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4602
 *          1   lfHeight
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4603
 *          2   lfWidth
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4604
 *          3   lfEscapement
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4605
 *          4   lfOrientation
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4606
 *          5   lfWeight (Integer)
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4607
 *          6   lfWeight (String)
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4608
 *          7   lfItalic
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4609
 *          8   lfUnderline
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4610
 *          9   lfStrikeOut
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4611
 *         10   lfCharSet (Integer)
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4612
 *         11   lfOutPrecision
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4613
 *         12   lfClipPrecision
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4614
 *         13   lfQuality
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4615
 *         14   lfPitchAndFamily
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4616
 *         15   face and style name (String i.e. "bold-roman")
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4617
 *         16   face name from windows
4014
Claus Gittinger <cg@exept.de>
parents: 4013
diff changeset
  4618
 *         17   character encoding lfCharSet (as String i.e. "ms_ansi", "ms_oem", "ms_cyrillic")
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4619
 *         18
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4620
 *         19
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4621
 *         20
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4622
 *       )
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4623
 * CAVEAT: returns an array to avoid knowlege-need about ST-Objects (FontDescripttion) here.
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4624
 */
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4625
OBJ
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4626
__extractLogicalFontParameters(lplf) 
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4627
	LOGFONT         *lplf;     /* ptr of logical-font data */
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4628
{
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4629
	OBJ newArray, t;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4630
	char *s;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4631
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4632
	DPRINTF((" lfHeight          %d\n", lplf->lfHeight ));
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4633
	DPRINTF((" lfWidth           %d\n", lplf->lfWidth  ));
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4634
	DPRINTF((" lfEscapement      %d\n", lplf->lfEscapement  ));
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4635
	DPRINTF((" lfOrientation     %d\n", lplf->lfOrientation  ));
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4636
	DPRINTF((" lfWeight          %d\n", lplf->lfWeight  ));
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4637
	DPRINTF((" lfItalic          %d\n", lplf->lfItalic  ));
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4638
	DPRINTF((" lfUnderline       %d\n", lplf->lfUnderline  ));
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4639
	DPRINTF((" lfStrikeOut       %d\n", lplf->lfStrikeOut  ));
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4640
	DPRINTF((" lfCharSet         %d\n", lplf->lfCharSet  ));
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4641
	DPRINTF((" lfOutPrecision    %d\n", lplf->lfOutPrecision  ));
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4642
	DPRINTF((" lfClipPrecision   %d\n", lplf->lfClipPrecision  ));
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4643
	DPRINTF((" lfQuality         %d\n", lplf->lfQuality  ));
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4644
	DPRINTF((" lfPitchAndFamily  %d\n", lplf->lfPitchAndFamily  ));
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4645
	DPRINTF((" lfFaceName        %s\n\n", lplf->lfFaceName  ));
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4646
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4647
	newArray = __ARRAY_NEW_INT(20);
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4648
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4649
	__ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(lplf->lfHeight);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4650
	__ArrayInstPtr(newArray)->a_element[1] = __MKSMALLINT(lplf->lfWidth);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4651
	__ArrayInstPtr(newArray)->a_element[2] = __MKSMALLINT(lplf->lfEscapement);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4652
	__ArrayInstPtr(newArray)->a_element[3] = __MKSMALLINT(lplf->lfOrientation);
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4653
	__ArrayInstPtr(newArray)->a_element[4] = __MKSMALLINT(lplf->lfWeight);
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4654
	switch (lplf->lfWeight) {
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4655
	    case FW_HEAVY:
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4656
	    case FW_EXTRABOLD:
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4657
	    case FW_SEMIBOLD:
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4658
	    case FW_BOLD:
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4659
		s = "bold";
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4660
		break;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4661
	    case FW_NORMAL:
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4662
		s = "normal";
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4663
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4664
	    case FW_MEDIUM:
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4665
		s = "medium";
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4666
		break;
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4667
	    case FW_THIN:
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4668
	    case FW_EXTRALIGHT:
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4669
	    case FW_LIGHT:
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4670
		s = "demi";
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4671
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4672
	    default:
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4673
		s = "other";
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4674
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4675
	}
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4676
	__PROTECT__(newArray);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4677
	t = __MKSTRING(s);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4678
	__UNPROTECT__(newArray);
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4679
	__ArrayInstPtr(newArray)->a_element[5] = t; __STORE(newArray, t);
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4680
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4681
	__ArrayInstPtr(newArray)->a_element[6] = __MKSMALLINT(lplf->lfItalic);
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4682
	__ArrayInstPtr(newArray)->a_element[7] = __MKSMALLINT(lplf->lfUnderline);
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4683
	__ArrayInstPtr(newArray)->a_element[8] = __MKSMALLINT(lplf->lfStrikeOut);
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4684
	__ArrayInstPtr(newArray)->a_element[9] = __MKSMALLINT(lplf->lfCharSet);
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4685
	__ArrayInstPtr(newArray)->a_element[10] = __MKSMALLINT(lplf->lfOutPrecision);
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4686
	__ArrayInstPtr(newArray)->a_element[11] = __MKSMALLINT(lplf->lfClipPrecision);
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4687
	__ArrayInstPtr(newArray)->a_element[12] = __MKSMALLINT(lplf->lfQuality);
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4688
	__ArrayInstPtr(newArray)->a_element[13] = __MKSMALLINT(lplf->lfPitchAndFamily);
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4689
	/* ... */
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4690
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4691
	if( lplf->lfItalic == TRUE ) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4692
	    if( lplf->lfUnderline == TRUE ) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4693
		if( lplf->lfStrikeOut == TRUE ) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4694
		    s = "italic-underline-strikeOut";
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4695
		} else {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4696
		    s = "italic-underline";
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4697
		}
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4698
	    } else {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4699
		if( lplf->lfStrikeOut == TRUE ) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4700
		    s = "italic-strikeOut";
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4701
		} else {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4702
		    s = "italic";
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4703
		}
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4704
	    }
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4705
	} else {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4706
	    if( lplf->lfUnderline == TRUE ) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4707
		if( lplf->lfStrikeOut == TRUE ) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4708
		    s = "roman-underline-strikeOut";
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4709
		} else {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4710
		    s = "roman-underline";
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4711
		}
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4712
	    } else {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4713
		if( lplf->lfStrikeOut == TRUE ) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4714
		    s = "roman-strikeOut";
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4715
		} else {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4716
		    s = "roman";
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4717
		}
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4718
	    }
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4719
	}
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4720
	__PROTECT__(newArray);
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4721
	t = __MKSYMBOL(s, 0);
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4722
	__UNPROTECT__(newArray);
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4723
	__ArrayInstPtr(newArray)->a_element[14] = t; __STORE(newArray, t);
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4724
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4725
	__PROTECT__(newArray);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4726
	t = __MKSTRING(lplf->lfFaceName);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4727
	__UNPROTECT__(newArray);
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4728
	__ArrayInstPtr(newArray)->a_element[15] = t; __STORE(newArray, t);
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4729
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4730
	switch (lplf->lfCharSet) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4731
	    case ANSI_CHARSET:
4013
cd666b168135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4009
diff changeset
  4732
		s = "ms-ansi";
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4733
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4734
	    case DEFAULT_CHARSET:
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  4735
		s = "ms-default";
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4736
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4737
	    case SYMBOL_CHARSET:
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  4738
		s = "ms-symbol";
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4739
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4740
	    case SHIFTJIS_CHARSET:
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  4741
		s = "ms-shiftjis";
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4742
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4743
	    case GB2312_CHARSET:
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  4744
		s = "ms-gb2312";
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4745
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4746
	    case HANGEUL_CHARSET:
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  4747
		s = "ms-hangeul";
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4748
		break;
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4749
# if defined(HANGUL_CHARSET) && (HANGUL_CHARSET != HANGEUL_CHARSET)
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4750
	    case HANGUL_CHARSET:
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  4751
		s = "ms-hangul";
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4752
		break;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4753
# endif
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4754
	    case CHINESEBIG5_CHARSET:
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  4755
		s = "ms-chinesebig5";
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4756
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4757
	    case OEM_CHARSET:
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  4758
		s = "ms-oem";
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4759
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4760
# ifdef JOHAB_CHARSET
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4761
	    case JOHAB_CHARSET:
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  4762
		s = "ms-johab";
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4763
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4764
# endif
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4765
# ifdef HEBREW_CHARSET
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4766
	    case HEBREW_CHARSET:
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  4767
		s = "ms-hebrew";
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4768
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4769
# endif
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4770
# ifdef ARABIC_CHARSET
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4771
	    case ARABIC_CHARSET:
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  4772
		s = "ms-arabic";
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4773
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4774
# endif
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4775
# ifdef GREEK_CHARSET
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4776
	    case GREEK_CHARSET:
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  4777
		s = "ms-greek";
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4778
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4779
# endif
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4780
# ifdef TURKISH_CHARSET
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4781
	    case TURKISH_CHARSET:
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  4782
		s = "ms-turkish";
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4783
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4784
# endif
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4785
# ifdef RUSSIAN_CHARSET
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4786
	    case RUSSIAN_CHARSET:
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  4787
		s = "ms-russian";
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4788
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4789
# endif
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4790
# ifdef EASTEUROPE_CHARSET
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4791
	    case EASTEUROPE_CHARSET:
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  4792
		s = "ms-easteurope";
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4793
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4794
# endif
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4795
# ifdef BALTIC_CHARSET
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4796
	    case BALTIC_CHARSET:
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  4797
		s = "ms-baltic";
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4798
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4799
# endif
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4800
# ifdef VIETNAMESE_CHARSET
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4801
	    case VIETNAMESE_CHARSET:
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  4802
		s = "ms-vietnamese";
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4803
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4804
# endif
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4805
# ifdef THAI_CHARSET
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4806
	    case THAI_CHARSET:
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  4807
		s = "ms-thai";
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4808
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4809
# endif
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4810
# ifdef MAC_CHARSET
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4811
	    case MAC_CHARSET:
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  4812
		s = "ms-mac";
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4813
		break;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4814
# endif
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4815
# ifdef UNICODE_CHARSET
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4816
	    case UNICODE_CHARSET:
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  4817
		s = "ms-unicode";
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4818
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4819
# endif
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4820
	    default:
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4821
		s = "unknown";
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4822
		break;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4823
	}
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4824
	__PROTECT__(newArray);
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4825
	t = __MKSYMBOL(s, 0);
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4826
	__UNPROTECT__(newArray);
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4827
	__ArrayInstPtr(newArray)->a_element[16] = t; __STORE(newArray, t);
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4828
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4829
	return newArray;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4830
}
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4831
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4832
static int CALLBACK
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4833
EnumFontsProc( lplf, lptm, dwType, lpData )
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4834
#ifdef USE_EnumFontFamiliesEx
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4835
	ENUMLOGFONTEX   *lplf;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4836
#else
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4837
	LOGFONT         *lplf;     /* ptr to of logical-font data */
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4838
#endif
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4839
	TEXTMETRIC      *lptm;     /* ptr to physical font data */
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4840
	DWORD           dwType;    /* font type */
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4841
	LPARAM          lpData;    /* application supplied data */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4842
{
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4843
	OBJ *refToList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4844
	OBJ list;
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4845
	OBJ infoArray;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4846
	OBJ *fullName;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4847
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4848
	DPRINTF(("EnumFontsProc\n"));
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4849
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4850
	if ( lplf ) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4851
	    refToList = (OBJ*) lpData;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4852
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4853
	    __PROTECT__(*refToList);
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4854
#ifdef USE_EnumFontFamiliesEx
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4855
	    infoArray = __extractLogicalFontParameters(lplf->elfLogFont);
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4856
	    __PROTECT__(infoArray);
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4857
	    fullName = __MKSTRING(lplf->elfFullName);
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4858
	    __UNPROTECT__(infoArray);
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4859
	    __ArrayInstPtr(infoArray)->a_element[17] = fullName; __STORE(infoArray, fullName);
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4860
#else
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4861
	    infoArray = __extractLogicalFontParameters(lplf);
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4862
#endif
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4863
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4864
	    __UNPROTECT__(*refToList);
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4865
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4866
	    if ( dwType & TRUETYPE_FONTTYPE ) {
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4867
		/* change height to 0 to mark variable fonts */
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4868
		__ArrayInstPtr(infoArray)->a_element[0] = __MKSMALLINT(0);
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4869
	    }
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4870
	    list = *refToList;
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4871
	    __SSEND1(list, @symbol(add:), 0, infoArray);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4872
	}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4873
	return 1;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4874
}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4875
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4876
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4877
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4878
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4879
!WinWorkstation class methodsFor:'documentation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4880
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4881
copyright
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4882
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4883
COPYRIGHT (c) 1996 by Claus Gittinger
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4884
	      All Rights Reserved
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4885
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4886
 This software is furnished under a license and may be used
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4887
 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
  4888
 inclusion of the above copyright notice.   This software may not
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4889
 be provided or otherwise made available to, or used by, any
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4890
 other person.  No title to or ownership of the software is
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4891
 hereby transferred.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4892
"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4893
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4894
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4895
documentation
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4896
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4897
    See more documentation in my superclass, DeviceWorkstation.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4898
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4899
    [author:]
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  4900
	Claus Gittinger (initial port & final fixups)
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4901
	Manfred Dierolf (many, many changes & fixes, multithreading etc.)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4902
"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4903
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4904
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4905
!WinWorkstation class methodsFor:'initialization'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4906
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4907
initialize
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4908
    super initialize.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4909
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4910
    self initializeStandardColorNames.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4911
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4912
    NativeWindows := false.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4913
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4914
    BeepDuration := 200.        "/ millis
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4915
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4916
    ButtonTranslation := #(1 2 2).
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4917
3574
db1360ba8dea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3573
diff changeset
  4918
    "/ SysColorChanges are reported *very* often when exceed is running,
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  4919
    "/ but are also needed to update my view colors when the settings change.
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  4920
    "/ I dont know what exceed is doing there ...
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  4921
    "/ IgnoreSysColorChanges := true.
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  4922
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4923
    "/ translation table from ST/X windowType symbol (system-independent)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4924
    "/ to Windows windowClass (windows-specific).
3574
db1360ba8dea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3573
diff changeset
  4925
    "/ native windows are not yet implemented
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4926
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4927
    NativeWindowClassTable := IdentityDictionary new.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4928
    NativeWindowClassTable at:#ScrollBar     put:'SCROLLBAR'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4929
    NativeWindowClassTable at:#CheckBox      put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4930
    NativeWindowClassTable at:#RadioButton   put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4931
    NativeWindowClassTable at:#Button        put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4932
    NativeWindowClassTable at:#DefaultButton put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4933
    NativeWindowClassTable at:#ComboBox      put:'COMBOBOX'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4934
    NativeWindowClassTable at:#EditField     put:'EDIT'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4935
    NativeWindowClassTable at:#ListBox       put:'LISTBOX'.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4936
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4937
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4938
initializeStandardColorNames
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4939
    "{ Pragma: +optSpace }"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4940
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4941
    "setup standard color names (X-color names)"
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4942
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4943
    StandardColorValues := Dictionary new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4944
    #(
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  4945
	(240 248 255)   'aliceblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  4946
	(250 235 215)   'antiquewhite'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4947
	(255 239 219)   'AntiqueWhite1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4948
	(238 223 204)   'AntiqueWhite2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4949
	(205 192 176)   'AntiqueWhite3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4950
	(139 131 120)   'AntiqueWhite4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4951
	(127 255 212)   'aquamarine'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4952
	(127 255 212)   'aquamarine1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4953
	(118 238 198)   'aquamarine2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4954
	(102 205 170)   'aquamarine3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4955
	( 69 139 116)   'aquamarine4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4956
	(240 255 255)   'azure'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4957
	(240 255 255)   'azure1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4958
	(224 238 238)   'azure2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4959
	(193 205 205)   'azure3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4960
	(131 139 139)   'azure4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4961
	(245 245 220)   'beige'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4962
	(255 228 196)   'bisque'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4963
	(255 228 196)   'bisque1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4964
	(238 213 183)   'bisque2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4965
	(205 183 158)   'bisque3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4966
	(139 125 107)   'bisque4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4967
	(  0   0   0)   'black'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  4968
	(255 235 205)   'blanchedalmond'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4969
	(  0   0 255)   'blue'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  4970
	(138  43 226)   'blueviolet'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4971
	(  0   0 255)   'blue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4972
	(  0   0 238)   'blue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4973
	(  0   0 205)   'blue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4974
	(  0   0 139)   'blue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4975
	(165  42  42)   'brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4976
	(255  64  64)   'brown1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4977
	(238  59  59)   'brown2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4978
	(205  51  51)   'brown3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4979
	(139  35  35)   'brown4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4980
	(222 184 135)   'burlywood'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4981
	(255 211 155)   'burlywood1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4982
	(238 197 145)   'burlywood2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4983
	(205 170 125)   'burlywood3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4984
	(139 115  85)   'burlywood4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  4985
	( 95 158 160)   'cadetblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4986
	(152 245 255)   'CadetBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4987
	(142 229 238)   'CadetBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4988
	(122 197 205)   'CadetBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4989
	( 83 134 139)   'CadetBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4990
	(127 255   0)   'chartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4991
	(127 255   0)   'chartreuse1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4992
	(118 238   0)   'chartreuse2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4993
	(102 205   0)   'chartreuse3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4994
	( 69 139   0)   'chartreuse4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4995
	(210 105  30)   'chocolate'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4996
	(255 127  36)   'chocolate1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4997
	(238 118  33)   'chocolate2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4998
	(205 102  29)   'chocolate3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4999
	(139  69  19)   'chocolate4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5000
	(255 127  80)   'coral'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5001
	(255 114  86)   'coral1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5002
	(238 106  80)   'coral2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5003
	(205  91  69)   'coral3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5004
	(139  62  47)   'coral4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5005
	(100 149 237)   'cornflowerblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5006
	(255 248 220)   'cornsilk'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5007
	(255 248 220)   'cornsilk1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5008
	(238 232 205)   'cornsilk2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5009
	(205 200 177)   'cornsilk3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5010
	(139 136 120)   'cornsilk4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5011
	(  0 255 255)   'cyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5012
	(  0 255 255)   'cyan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5013
	(  0 238 238)   'cyan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5014
	(  0 205 205)   'cyan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5015
	(  0 139 139)   'cyan4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5016
	(  0   0 139)   'darkblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5017
	(  0 139 139)   'darkcyan'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5018
	(184 134  11)   'darkgoldenrod'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5019
	(169 169 169)   'darkgray'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5020
	(  0 100   0)   'darkgreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5021
	(169 169 169)   'darkgrey'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5022
	(189 183 107)   'darkkhaki'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5023
	(139   0 139)   'darkmagenta'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5024
	( 85 107  47)   'darkolivegreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5025
	(255 140   0)   'darkorange'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5026
	(153  50 204)   'darkorchid'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5027
	(139   0   0)   'darkred'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5028
	(233 150 122)   'darksalmon'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5029
	(143 188 143)   'darkseagreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5030
	( 72  61 139)   'darkslateblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5031
	( 47  79  79)   'darkslategray'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5032
	( 47  79  79)   'darkslategrey'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5033
	(  0 206 209)   'darkturquoise'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5034
	(148   0 211)   'darkviolet'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5035
	(255 185  15)   'DarkGoldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5036
	(238 173  14)   'DarkGoldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5037
	(205 149  12)   'DarkGoldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5038
	(139 101   8)   'DarkGoldenrod4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5039
	(202 255 112)   'DarkOliveGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5040
	(188 238 104)   'DarkOliveGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5041
	(162 205  90)   'DarkOliveGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5042
	(110 139  61)   'DarkOliveGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5043
	(255 127   0)   'DarkOrange1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5044
	(238 118   0)   'DarkOrange2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5045
	(205 102   0)   'DarkOrange3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5046
	(139  69   0)   'DarkOrange4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5047
	(191  62 255)   'DarkOrchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5048
	(178  58 238)   'DarkOrchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5049
	(154  50 205)   'DarkOrchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5050
	(104  34 139)   'DarkOrchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5051
	(193 255 193)   'DarkSeaGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5052
	(180 238 180)   'DarkSeaGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5053
	(155 205 155)   'DarkSeaGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5054
	(105 139 105)   'DarkSeaGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5055
	(151 255 255)   'DarkSlateGray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5056
	(141 238 238)   'DarkSlateGray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5057
	(121 205 205)   'DarkSlateGray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5058
	( 82 139 139)   'DarkSlateGray4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5059
	(255  20 147)   'deeppink'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5060
	(  0 191 255)   'deepskyblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5061
	(255  20 147)   'DeepPink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5062
	(255  20 147)   'DeepPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5063
	(238  18 137)   'DeepPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5064
	(205  16 118)   'DeepPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5065
	(139  10  80)   'DeepPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5066
	(  0 191 255)   'DeepSkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5067
	(  0 178 238)   'DeepSkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5068
	(  0 154 205)   'DeepSkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5069
	(  0 104 139)   'DeepSkyBlue4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5070
	(105 105 105)   'dimgray'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5071
	(105 105 105)   'dimgrey'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5072
	( 30 144 255)   'dodgerblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5073
	( 30 144 255)   'DodgerBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5074
	( 28 134 238)   'DodgerBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5075
	( 24 116 205)   'DodgerBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5076
	( 16  78 139)   'DodgerBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5077
	(178  34  34)   'firebrick'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5078
	(255  48  48)   'firebrick1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5079
	(238  44  44)   'firebrick2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5080
	(205  38  38)   'firebrick3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5081
	(139  26  26)   'firebrick4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5082
	(255 250 240)   'floralwhite'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5083
	( 34 139  34)   'forestgreen'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5084
	(220 220 220)   'gainsboro'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5085
	(248 248 255)   'ghostwhite'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5086
	(255 215   0)   'gold'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5087
	(255 215   0)   'gold1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5088
	(238 201   0)   'gold2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5089
	(205 173   0)   'gold3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5090
	(139 117   0)   'gold4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5091
	(218 165  32)   'goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5092
	(255 193  37)   'goldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5093
	(238 180  34)   'goldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5094
	(205 155  29)   'goldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5095
	(139 105  20)   'goldenrod4'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5096
	(192 192 192)   'grey'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5097
	(  0   0   0)   'grey0'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5098
	(  3   3   3)   'grey1'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5099
	( 26  26  26)   'grey10'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5100
	(255 255 255)   'grey100'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5101
	( 28  28  28)   'grey11'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5102
	( 31  31  31)   'grey12'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5103
	( 33  33  33)   'grey13'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5104
	( 36  36  36)   'grey14'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5105
	( 38  38  38)   'grey15'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5106
	( 41  41  41)   'grey16'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5107
	( 43  43  43)   'grey17'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5108
	( 46  46  46)   'grey18'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5109
	( 48  48  48)   'grey19'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5110
	(  5   5   5)   'grey2'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5111
	( 51  51  51)   'grey20'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5112
	( 54  54  54)   'grey21'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5113
	( 56  56  56)   'grey22'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5114
	( 59  59  59)   'grey23'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5115
	( 61  61  61)   'grey24'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5116
	( 64  64  64)   'grey25'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5117
	( 66  66  66)   'grey26'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5118
	( 69  69  69)   'grey27'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5119
	( 71  71  71)   'grey28'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5120
	( 74  74  74)   'grey29'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5121
	(  8   8   8)   'grey3'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5122
	( 77  77  77)   'grey30'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5123
	( 79  79  79)   'grey31'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5124
	( 82  82  82)   'grey32'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5125
	( 84  84  84)   'grey33'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5126
	( 87  87  87)   'grey34'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5127
	( 89  89  89)   'grey35'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5128
	( 92  92  92)   'grey36'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5129
	( 94  94  94)   'grey37'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5130
	( 97  97  97)   'grey38'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5131
	( 99  99  99)   'grey39'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5132
	( 10  10  10)   'grey4'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5133
	(102 102 102)   'grey40'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5134
	(105 105 105)   'grey41'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5135
	(107 107 107)   'grey42'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5136
	(110 110 110)   'grey43'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5137
	(112 112 112)   'grey44'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5138
	(115 115 115)   'grey45'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5139
	(117 117 117)   'grey46'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5140
	(120 120 120)   'grey47'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5141
	(122 122 122)   'grey48'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5142
	(125 125 125)   'grey49'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5143
	( 13  13  13)   'grey5'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5144
	(127 127 127)   'grey50'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5145
	(130 130 130)   'grey51'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5146
	(133 133 133)   'grey52'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5147
	(135 135 135)   'grey53'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5148
	(138 138 138)   'grey54'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5149
	(140 140 140)   'grey55'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5150
	(143 143 143)   'grey56'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5151
	(145 145 145)   'grey57'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5152
	(148 148 148)   'grey58'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5153
	(150 150 150)   'grey59'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5154
	( 15  15  15)   'grey6'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5155
	(153 153 153)   'grey60'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5156
	(156 156 156)   'grey61'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5157
	(158 158 158)   'grey62'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5158
	(161 161 161)   'grey63'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5159
	(163 163 163)   'grey64'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5160
	(166 166 166)   'grey65'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5161
	(168 168 168)   'grey66'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5162
	(171 171 171)   'grey67'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5163
	(173 173 173)   'grey68'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5164
	(176 176 176)   'grey69'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5165
	( 18  18  18)   'grey7'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5166
	(179 179 179)   'grey70'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5167
	(181 181 181)   'grey71'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5168
	(184 184 184)   'grey72'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5169
	(186 186 186)   'grey73'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5170
	(189 189 189)   'grey74'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5171
	(191 191 191)   'grey75'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5172
	(194 194 194)   'grey76'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5173
	(196 196 196)   'grey77'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5174
	(199 199 199)   'grey78'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5175
	(201 201 201)   'grey79'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5176
	( 20  20  20)   'grey8'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5177
	(204 204 204)   'grey80'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5178
	(207 207 207)   'grey81'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5179
	(209 209 209)   'grey82'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5180
	(212 212 212)   'grey83'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5181
	(214 214 214)   'grey84'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5182
	(217 217 217)   'grey85'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5183
	(219 219 219)   'grey86'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5184
	(222 222 222)   'grey87'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5185
	(224 224 224)   'grey88'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5186
	(227 227 227)   'grey89'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5187
	( 23  23  23)   'grey9'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5188
	(229 229 229)   'grey90'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5189
	(232 232 232)   'grey91'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5190
	(235 235 235)   'grey92'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5191
	(237 237 237)   'grey93'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5192
	(240 240 240)   'grey94'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5193
	(242 242 242)   'grey95'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5194
	(245 245 245)   'grey96'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5195
	(247 247 247)   'grey97'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5196
	(250 250 250)   'grey98'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5197
	(252 252 252)   'grey99'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5198
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5199
	(192 192 192)   'gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5200
	(  0   0   0)   'gray0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5201
	(  3   3   3)   'gray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5202
	( 26  26  26)   'gray10'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5203
	(255 255 255)   'gray100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5204
	( 28  28  28)   'gray11'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5205
	( 31  31  31)   'gray12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5206
	( 33  33  33)   'gray13'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5207
	( 36  36  36)   'gray14'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5208
	( 38  38  38)   'gray15'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5209
	( 41  41  41)   'gray16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5210
	( 43  43  43)   'gray17'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5211
	( 46  46  46)   'gray18'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5212
	( 48  48  48)   'gray19'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5213
	(  5   5   5)   'gray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5214
	( 51  51  51)   'gray20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5215
	( 54  54  54)   'gray21'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5216
	( 56  56  56)   'gray22'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5217
	( 59  59  59)   'gray23'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5218
	( 61  61  61)   'gray24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5219
	( 64  64  64)   'gray25'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5220
	( 66  66  66)   'gray26'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5221
	( 69  69  69)   'gray27'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5222
	( 71  71  71)   'gray28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5223
	( 74  74  74)   'gray29'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5224
	(  8   8   8)   'gray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5225
	( 77  77  77)   'gray30'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5226
	( 79  79  79)   'gray31'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5227
	( 82  82  82)   'gray32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5228
	( 84  84  84)   'gray33'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5229
	( 87  87  87)   'gray34'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5230
	( 89  89  89)   'gray35'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5231
	( 92  92  92)   'gray36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5232
	( 94  94  94)   'gray37'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5233
	( 97  97  97)   'gray38'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5234
	( 99  99  99)   'gray39'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5235
	( 10  10  10)   'gray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5236
	(102 102 102)   'gray40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5237
	(105 105 105)   'gray41'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5238
	(107 107 107)   'gray42'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5239
	(110 110 110)   'gray43'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5240
	(112 112 112)   'gray44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5241
	(115 115 115)   'gray45'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5242
	(117 117 117)   'gray46'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5243
	(120 120 120)   'gray47'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5244
	(122 122 122)   'gray48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5245
	(125 125 125)   'gray49'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5246
	( 13  13  13)   'gray5'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5247
	(127 127 127)   'gray50'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5248
	(130 130 130)   'gray51'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5249
	(133 133 133)   'gray52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5250
	(135 135 135)   'gray53'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5251
	(138 138 138)   'gray54'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5252
	(140 140 140)   'gray55'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5253
	(143 143 143)   'gray56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5254
	(145 145 145)   'gray57'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5255
	(148 148 148)   'gray58'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5256
	(150 150 150)   'gray59'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5257
	( 15  15  15)   'gray6'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5258
	(153 153 153)   'gray60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5259
	(156 156 156)   'gray61'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5260
	(158 158 158)   'gray62'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5261
	(161 161 161)   'gray63'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5262
	(163 163 163)   'gray64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5263
	(166 166 166)   'gray65'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5264
	(168 168 168)   'gray66'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5265
	(171 171 171)   'gray67'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5266
	(173 173 173)   'gray68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5267
	(176 176 176)   'gray69'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5268
	( 18  18  18)   'gray7'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5269
	(179 179 179)   'gray70'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5270
	(181 181 181)   'gray71'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5271
	(184 184 184)   'gray72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5272
	(186 186 186)   'gray73'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5273
	(189 189 189)   'gray74'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5274
	(191 191 191)   'gray75'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5275
	(194 194 194)   'gray76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5276
	(196 196 196)   'gray77'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5277
	(199 199 199)   'gray78'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5278
	(201 201 201)   'gray79'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5279
	( 20  20  20)   'gray8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5280
	(204 204 204)   'gray80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5281
	(207 207 207)   'gray81'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5282
	(209 209 209)   'gray82'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5283
	(212 212 212)   'gray83'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5284
	(214 214 214)   'gray84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5285
	(217 217 217)   'gray85'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5286
	(219 219 219)   'gray86'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5287
	(222 222 222)   'gray87'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5288
	(224 224 224)   'gray88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5289
	(227 227 227)   'gray89'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5290
	( 23  23  23)   'gray9'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5291
	(229 229 229)   'gray90'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5292
	(232 232 232)   'gray91'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5293
	(235 235 235)   'gray92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5294
	(237 237 237)   'gray93'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5295
	(240 240 240)   'gray94'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5296
	(242 242 242)   'gray95'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5297
	(245 245 245)   'gray96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5298
	(247 247 247)   'gray97'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5299
	(250 250 250)   'gray98'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5300
	(252 252 252)   'gray99'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5301
	(  0 255   0)   'green'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5302
	(173 255  47)   'greenyellow'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5303
	(  0 255   0)   'green1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5304
	(  0 238   0)   'green2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5305
	(  0 205   0)   'green3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5306
	(  0 139   0)   'green4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5307
	(240 255 240)   'honeydew'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5308
	(240 255 240)   'honeydew1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5309
	(224 238 224)   'honeydew2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5310
	(193 205 193)   'honeydew3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5311
	(131 139 131)   'honeydew4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5312
	(255 105 180)   'hotpink'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5313
	(255 110 180)   'HotPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5314
	(238 106 167)   'HotPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5315
	(205  96 144)   'HotPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5316
	(139  58  98)   'HotPink4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5317
	(205  92  92)   'indianred'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5318
	(255 106 106)   'IndianRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5319
	(238  99  99)   'IndianRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5320
	(205  85  85)   'IndianRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5321
	(139  58  58)   'IndianRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5322
	(255 255 240)   'ivory'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5323
	(255 255 240)   'ivory1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5324
	(238 238 224)   'ivory2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5325
	(205 205 193)   'ivory3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5326
	(139 139 131)   'ivory4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5327
	(240 230 140)   'khaki'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5328
	(255 246 143)   'khaki1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5329
	(238 230 133)   'khaki2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5330
	(205 198 115)   'khaki3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5331
	(139 134  78)   'khaki4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5332
	(230 230 250)   'lavender'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5333
	(255 240 245)   'lavenderblush'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5334
	(255 240 245)   'LavenderBlush1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5335
	(238 224 229)   'LavenderBlush2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5336
	(205 193 197)   'LavenderBlush3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5337
	(139 131 134)   'LavenderBlush4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5338
	(124 252   0)   'lawngreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5339
	(255 250 205)   'lemonchiffon'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5340
	(255 250 205)   'LemonChiffon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5341
	(238 233 191)   'LemonChiffon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5342
	(205 201 165)   'LemonChiffon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5343
	(139 137 112)   'LemonChiffon4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5344
	(173 216 230)   'lightblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5345
	(240 128 128)   'lightcoral'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5346
	(224 255 255)   'lightcyan'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5347
	(238 221 130)   'lightgoldenrod'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5348
	(250 250 210)   'lightgoldenrodyellow'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5349
	(211 211 211)   'lightgray'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5350
	(144 238 144)   'lightgreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5351
	(211 211 211)   'lightgrey'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5352
	(255 182 193)   'lightpink'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5353
	(255 160 122)   'lightsalmon'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5354
	( 32 178 170)   'lightseagreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5355
	(135 206 250)   'lightskyblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5356
	(132 112 255)   'lightslateblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5357
	(119 136 153)   'lightslategray'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5358
	(119 136 153)   'lightslategrey'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5359
	(176 196 222)   'lightsteelblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5360
	(255 255 224)   'lightyellow'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5361
	(191 239 255)   'LightBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5362
	(178 223 238)   'LightBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5363
	(154 192 205)   'LightBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5364
	(104 131 139)   'LightBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5365
	(224 255 255)   'LightCyan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5366
	(209 238 238)   'LightCyan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5367
	(180 205 205)   'LightCyan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5368
	(122 139 139)   'LightCyan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5369
	(255 236 139)   'LightGoldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5370
	(238 220 130)   'LightGoldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5371
	(205 190 112)   'LightGoldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5372
	(139 129  76)   'LightGoldenrod4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5373
	(255 174 185)   'LightPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5374
	(238 162 173)   'LightPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5375
	(205 140 149)   'LightPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5376
	(139  95 101)   'LightPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5377
	(255 160 122)   'LightSalmon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5378
	(238 149 114)   'LightSalmon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5379
	(205 129  98)   'LightSalmon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5380
	(139  87  66)   'LightSalmon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5381
	(176 226 255)   'LightSkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5382
	(164 211 238)   'LightSkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5383
	(141 182 205)   'LightSkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5384
	( 96 123 139)   'LightSkyBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5385
	(202 225 255)   'LightSteelBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5386
	(188 210 238)   'LightSteelBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5387
	(162 181 205)   'LightSteelBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5388
	(110 123 139)   'LightSteelBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5389
	(255 255 224)   'LightYellow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5390
	(238 238 209)   'LightYellow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5391
	(205 205 180)   'LightYellow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5392
	(139 139 122)   'LightYellow4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5393
	( 50 205  50)   'limegreen'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5394
	(250 240 230)   'linen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5395
	(255   0 255)   'magenta'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5396
	(255   0 255)   'magenta1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5397
	(238   0 238)   'magenta2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5398
	(205   0 205)   'magenta3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5399
	(139   0 139)   'magenta4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5400
	(176  48  96)   'maroon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5401
	(255  52 179)   'maroon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5402
	(238  48 167)   'maroon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5403
	(205  41 144)   'maroon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5404
	(139  28  98)   'maroon4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5405
	(102 205 170)   'mediumaquamarine'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5406
	(  0   0 205)   'mediumblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5407
	(186  85 211)   'mediumorchid'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5408
	(147 112 219)   'mediumpurple'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5409
	( 60 179 113)   'mediumseagreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5410
	(123 104 238)   'mediumslateblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5411
	(  0 250 154)   'mediumspringgreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5412
	( 72 209 204)   'mediumturquoise'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5413
	(199  21 133)   'mediumvioletred'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5414
	(224 102 255)   'MediumOrchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5415
	(209  95 238)   'MediumOrchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5416
	(180  82 205)   'MediumOrchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5417
	(122  55 139)   'MediumOrchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5418
	(171 130 255)   'MediumPurple1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5419
	(159 121 238)   'MediumPurple2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5420
	(137 104 205)   'MediumPurple3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5421
	( 93  71 139)   'MediumPurple4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5422
	( 25  25 112)   'midnightblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5423
	(245 255 250)   'mintcream'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5424
	(255 228 225)   'mistyrose'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5425
	(255 228 225)   'MistyRose1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5426
	(238 213 210)   'MistyRose2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5427
	(205 183 181)   'MistyRose3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5428
	(139 125 123)   'MistyRose4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5429
	(255 228 181)   'moccasin'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5430
	(255 222 173)   'navajowhite'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5431
	(255 222 173)   'NavajoWhite1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5432
	(238 207 161)   'NavajoWhite2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5433
	(205 179 139)   'NavajoWhite3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5434
	(139 121  94)   'NavajoWhite4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5435
	(  0   0 128)   'navy'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5436
	(  0   0 128)   'navyblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5437
	(253 245 230)   'oldlace'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5438
	(107 142  35)   'olivedrab'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5439
	(192 255  62)   'OliveDrab1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5440
	(179 238  58)   'OliveDrab2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5441
	(154 205  50)   'OliveDrab3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5442
	(105 139  34)   'OliveDrab4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5443
	(255 165   0)   'orange'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5444
	(255 165   0)   'orange1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5445
	(238 154   0)   'orange2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5446
	(205 133   0)   'orange3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5447
	(139  90   0)   'orange4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5448
	(255  69   0)   'orangered'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5449
	(255  69   0)   'OrangeRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5450
	(238  64   0)   'OrangeRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5451
	(205  55   0)   'OrangeRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5452
	(139  37   0)   'OrangeRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5453
	(218 112 214)   'orchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5454
	(255 131 250)   'orchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5455
	(238 122 233)   'orchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5456
	(205 105 201)   'orchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5457
	(139  71 137)   'orchid4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5458
	(238 232 170)   'palegoldenrod'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5459
	(152 251 152)   'palegreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5460
	(175 238 238)   'paleturquoise'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5461
	(219 112 147)   'palevioletred'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5462
	(154 255 154)   'PaleGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5463
	(144 238 144)   'PaleGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5464
	(124 205 124)   'PaleGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5465
	( 84 139  84)   'PaleGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5466
	(187 255 255)   'PaleTurquoise1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5467
	(174 238 238)   'PaleTurquoise2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5468
	(150 205 205)   'PaleTurquoise3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5469
	(102 139 139)   'PaleTurquoise4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5470
	(255 130 171)   'PaleVioletRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5471
	(238 121 159)   'PaleVioletRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5472
	(205 104 137)   'PaleVioletRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5473
	(139  71  93)   'PaleVioletRed4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5474
	(255 239 213)   'papayawhip'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5475
	(255 218 185)   'peachpuff'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5476
	(255 218 185)   'PeachPuff1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5477
	(238 203 173)   'PeachPuff2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5478
	(205 175 149)   'PeachPuff3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5479
	(139 119 101)   'PeachPuff4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5480
	(205 133  63)   'peru'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5481
	(255 192 203)   'pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5482
	(255 181 197)   'pink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5483
	(238 169 184)   'pink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5484
	(205 145 158)   'pink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5485
	(139  99 108)   'pink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5486
	(221 160 221)   'plum'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5487
	(255 187 255)   'plum1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5488
	(238 174 238)   'plum2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5489
	(205 150 205)   'plum3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5490
	(139 102 139)   'plum4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5491
	(176 224 230)   'powderblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5492
	(160  32 240)   'purple'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5493
	(155  48 255)   'purple1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5494
	(145  44 238)   'purple2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5495
	(125  38 205)   'purple3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5496
	( 85  26 139)   'purple4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5497
	(255   0   0)   'red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5498
	(255   0   0)   'red1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5499
	(238   0   0)   'red2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5500
	(205   0   0)   'red3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5501
	(139   0   0)   'red4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5502
	(188 143 143)   'rosybrown'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5503
	(255 193 193)   'RosyBrown1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5504
	(238 180 180)   'RosyBrown2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5505
	(205 155 155)   'RosyBrown3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5506
	(139 105 105)   'RosyBrown4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5507
	( 65 105 225)   'royalblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5508
	( 72 118 255)   'RoyalBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5509
	( 67 110 238)   'RoyalBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5510
	( 58  95 205)   'RoyalBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5511
	( 39  64 139)   'RoyalBlue4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5512
	(139  69  19)   'saddlebrown'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5513
	(250 128 114)   'salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5514
	(255 140 105)   'salmon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5515
	(238 130  98)   'salmon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5516
	(205 112  84)   'salmon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5517
	(139  76  57)   'salmon4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5518
	(244 164  96)   'sandybrown'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5519
	( 255 206 137)  'scoActiveBackground'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5520
	( 43  45  49)   'scoActiveForeground'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5521
	( 254 222 255)  'scoActiveTopShadow'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5522
	( 172 186 204)  'scoAltBackground'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5523
	( 203 203 192)  'scoBackground'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5524
	( 11   0 113)   'scoForeground'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5525
	( 141 178 215)  'scoHighlight'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5526
	( 255 240 248)  'scoTopShadow'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5527
	( 46 139  87)   'seagreen'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5528
	( 84 255 159)   'SeaGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5529
	( 78 238 148)   'SeaGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5530
	( 67 205 128)   'SeaGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5531
	( 46 139  87)   'SeaGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5532
	(255 245 238)   'seashell'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5533
	(255 245 238)   'seashell1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5534
	(238 229 222)   'seashell2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5535
	(205 197 191)   'seashell3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5536
	(139 134 130)   'seashell4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5537
	(142 56 142)    'sgi beet'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5538
	(197 193 170)   'sgi bright gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5539
	(197 193 170)   'sgi bright grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5540
	(113 198 113)   'sgi chartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5541
	( 85  85  85)   'sgi dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5542
	( 85  85  85)   'sgi dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5543
	(  0   0   0)   'sgi gray 0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5544
	(255 255 255)   'sgi gray 100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5545
	( 30  30  30)   'sgi gray 12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5546
	( 40  40  40)   'sgi gray 16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5547
	( 51  51  51)   'sgi gray 20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5548
	( 61  61  61)   'sgi gray 24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5549
	( 71  71  71)   'sgi gray 28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5550
	( 81  81  81)   'sgi gray 32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5551
	( 91  91  91)   'sgi gray 36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5552
	( 10  10  10)   'sgi gray 4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5553
	(102 102 102)   'sgi gray 40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5554
	(112 112 112)   'sgi gray 44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5555
	(122 122 122)   'sgi gray 48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5556
	(132 132 132)   'sgi gray 52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5557
	(142 142 142)   'sgi gray 56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5558
	(153 153 153)   'sgi gray 60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5559
	(163 163 163)   'sgi gray 64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5560
	(173 173 173)   'sgi gray 68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5561
	(183 183 183)   'sgi gray 72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5562
	(193 193 193)   'sgi gray 76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5563
	( 20  20  20)   'sgi gray 8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5564
	(204 204 204)   'sgi gray 80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5565
	(214 214 214)   'sgi gray 84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5566
	(224 224 224)   'sgi gray 88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5567
	(234 234 234)   'sgi gray 92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5568
	(244 244 244)   'sgi gray 96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5569
	(  0   0   0)   'sgi grey 0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5570
	(255 255 255)   'sgi grey 100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5571
	( 30  30  30)   'sgi grey 12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5572
	( 40  40  40)   'sgi grey 16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5573
	( 51  51  51)   'sgi grey 20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5574
	( 61  61  61)   'sgi grey 24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5575
	( 71  71  71)   'sgi grey 28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5576
	( 81  81  81)   'sgi grey 32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5577
	( 91  91  91)   'sgi grey 36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5578
	( 10  10  10)   'sgi grey 4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5579
	(102 102 102)   'sgi grey 40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5580
	(112 112 112)   'sgi grey 44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5581
	(122 122 122)   'sgi grey 48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5582
	(132 132 132)   'sgi grey 52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5583
	(142 142 142)   'sgi grey 56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5584
	(153 153 153)   'sgi grey 60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5585
	(163 163 163)   'sgi grey 64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5586
	(173 173 173)   'sgi grey 68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5587
	(183 183 183)   'sgi grey 72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5588
	(193 193 193)   'sgi grey 76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5589
	( 20  20  20)   'sgi grey 8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5590
	(204 204 204)   'sgi grey 80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5591
	(214 214 214)   'sgi grey 84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5592
	(224 224 224)   'sgi grey 88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5593
	(234 234 234)   'sgi grey 92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5594
	(244 244 244)   'sgi grey 96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5595
	(125 158 192)   'sgi light blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5596
	(170 170 170)   'sgi light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5597
	(170 170 170)   'sgi light grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5598
	(132 132 132)   'sgi medium gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5599
	(132 132 132)   'sgi medium grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5600
	(142 142  56)   'sgi olive drab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5601
	(198 113 113)   'sgi salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5602
	(113 113 198)   'sgi slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5603
	( 56 142 142)   'sgi teal'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5604
	( 40  40  40)   'sgi very dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5605
	( 40  40  40)   'sgi very dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5606
	(214 214 214)   'sgi very light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5607
	(214 214 214)   'sgi very light grey'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5608
	(142 56 142)    'SGIBeet'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5609
	(197 193 170)   'SGIBrightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5610
	(197 193 170)   'SGIBrightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5611
	(113 198 113)   'SGIChartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5612
	( 85  85  85)   'SGIDarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5613
	( 85  85  85)   'SGIDarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5614
	(  0   0   0)   'SGIGray0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5615
	(255 255 255)   'SGIGray100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5616
	( 30  30  30)   'SGIGray12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5617
	( 40  40  40)   'SGIGray16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5618
	( 51  51  51)   'SGIGray20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5619
	( 61  61  61)   'SGIGray24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5620
	( 71  71  71)   'SGIGray28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5621
	( 81  81  81)   'SGIGray32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5622
	( 91  91  91)   'SGIGray36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5623
	( 10  10  10)   'SGIGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5624
	(102 102 102)   'SGIGray40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5625
	(112 112 112)   'SGIGray44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5626
	(122 122 122)   'SGIGray48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5627
	(132 132 132)   'SGIGray52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5628
	(142 142 142)   'SGIGray56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5629
	(153 153 153)   'SGIGray60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5630
	(163 163 163)   'SGIGray64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5631
	(173 173 173)   'SGIGray68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5632
	(183 183 183)   'SGIGray72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5633
	(193 193 193)   'SGIGray76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5634
	( 20  20  20)   'SGIGray8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5635
	(204 204 204)   'SGIGray80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5636
	(214 214 214)   'SGIGray84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5637
	(224 224 224)   'SGIGray88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5638
	(234 234 234)   'SGIGray92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5639
	(244 244 244)   'SGIGray96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5640
	(  0   0   0)   'SGIGrey0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5641
	(255 255 255)   'SGIGrey100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5642
	( 30  30  30)   'SGIGrey12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5643
	( 40  40  40)   'SGIGrey16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5644
	( 51  51  51)   'SGIGrey20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5645
	( 61  61  61)   'SGIGrey24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5646
	( 71  71  71)   'SGIGrey28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5647
	( 81  81  81)   'SGIGrey32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5648
	( 91  91  91)   'SGIGrey36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5649
	( 10  10  10)   'SGIGrey4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5650
	(102 102 102)   'SGIGrey40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5651
	(112 112 112)   'SGIGrey44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5652
	(122 122 122)   'SGIGrey48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5653
	(132 132 132)   'SGIGrey52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5654
	(142 142 142)   'SGIGrey56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5655
	(153 153 153)   'SGIGrey60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5656
	(163 163 163)   'SGIGrey64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5657
	(173 173 173)   'SGIGrey68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5658
	(183 183 183)   'SGIGrey72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5659
	(193 193 193)   'SGIGrey76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5660
	( 20  20  20)   'SGIGrey8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5661
	(204 204 204)   'SGIGrey80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5662
	(214 214 214)   'SGIGrey84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5663
	(224 224 224)   'SGIGrey88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5664
	(234 234 234)   'SGIGrey92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5665
	(244 244 244)   'SGIGrey96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5666
	(125 158 192)   'SGILightBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5667
	(170 170 170)   'SGILightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5668
	(170 170 170)   'SGILightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5669
	(132 132 132)   'SGIMediumGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5670
	(132 132 132)   'SGIMediumGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5671
	(142 142  56)   'SGIOliveDrab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5672
	(198 113 113)   'SGISalmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5673
	(113 113 198)   'SGISlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5674
	( 56 142 142)   'SGITeal'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5675
	( 40  40  40)   'SGIVeryDarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5676
	( 40  40  40)   'SGIVeryDarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5677
	(214 214 214)   'SGIVeryLightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5678
	(214 214 214)   'SGIVeryLightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5679
	(160  82  45)   'sienna'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5680
	(255 130  71)   'sienna1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5681
	(238 121  66)   'sienna2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5682
	(205 104  57)   'sienna3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5683
	(139  71  38)   'sienna4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5684
	(135 206 235)   'skyblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5685
	(135 206 255)   'SkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5686
	(126 192 238)   'SkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5687
	(108 166 205)   'SkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5688
	( 74 112 139)   'SkyBlue4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5689
	(112 128 144)   'slategray'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5690
	(112 128 144)   'slategrey'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5691
	(106  90 205)   'slateblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5692
	(131 111 255)   'SlateBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5693
	(122 103 238)   'SlateBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5694
	(105  89 205)   'SlateBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5695
	( 71  60 139)   'SlateBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5696
	(198 226 255)   'SlateGray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5697
	(185 211 238)   'SlateGray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5698
	(159 182 205)   'SlateGray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5699
	(108 123 139)   'SlateGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5700
	(255 250 250)   'snow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5701
	(255 250 250)   'snow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5702
	(238 233 233)   'snow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5703
	(205 201 201)   'snow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5704
	(139 137 137)   'snow4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5705
	(  0 255 127)   'springgreen'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5706
	(  0 255 127)   'SpringGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5707
	(  0 238 118)   'SpringGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5708
	(  0 205 102)   'SpringGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5709
	(  0 139  69)   'SpringGreen4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5710
	( 70 130 180)   'steelblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5711
	( 99 184 255)   'SteelBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5712
	( 92 172 238)   'SteelBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5713
	( 79 148 205)   'SteelBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5714
	( 54 100 139)   'SteelBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5715
	(210 180 140)   'tan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5716
	(255 165  79)   'tan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5717
	(238 154  73)   'tan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5718
	(205 133  63)   'tan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5719
	(139  90  43)   'tan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5720
	(216 191 216)   'thistle'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5721
	(255 225 255)   'thistle1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5722
	(238 210 238)   'thistle2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5723
	(205 181 205)   'thistle3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5724
	(139 123 139)   'thistle4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5725
	(255  99  71)   'tomato'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5726
	(255  99  71)   'tomato1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5727
	(238  92  66)   'tomato2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5728
	(205  79  57)   'tomato3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5729
	(139  54  38)   'tomato4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5730
	( 64 224 208)   'turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5731
	(  0 245 255)   'turquoise1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5732
	(  0 229 238)   'turquoise2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5733
	(  0 197 205)   'turquoise3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5734
	(  0 134 139)   'turquoise4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5735
	(238 130 238)   'violet'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5736
	(208  32 144)   'violetred'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5737
	(255  62 150)   'VioletRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5738
	(238  58 140)   'VioletRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5739
	(205  50 120)   'VioletRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5740
	(139  34  82)   'VioletRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5741
	(245 222 179)   'wheat'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5742
	(255 231 186)   'wheat1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5743
	(238 216 174)   'wheat2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5744
	(205 186 150)   'wheat3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5745
	(139 126 102)   'wheat4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5746
	(255 255 255)   'white'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5747
	(245 245 245)   'whitesmoke'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5748
	(255 255   0)   'yellow'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5749
	(154 205  50)   'yellowgreen'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5750
	(255 255   0)   'yellow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5751
	(238 238   0)   'yellow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5752
	(205 205   0)   'yellow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5753
	(139 139   0)   'yellow4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5754
    ) pairWiseDo:[ :value :name |
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5755
	StandardColorValues at:name put:value
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5756
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5757
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5758
     WinWorkstation initializeStandardColorNames
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5759
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5760
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5761
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5762
nativeWindows:aBoolean
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5763
    "enable / disable use of native windows"
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5764
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5765
    NativeWindows := aBoolean
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5766
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5767
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5768
!WinWorkstation class methodsFor:'debugging'!
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5769
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  5770
bitmapHandleCounts
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5771
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5772
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  5773
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5774
#ifdef COUNT_BMP_RESOURCES
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  5775
    RETURN ( __MKSMALLINT(__cnt_bitmap));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5776
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5777
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5778
#endif
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  5779
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  5780
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  5781
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5782
cursorHandleCounts
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5783
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5784
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5785
%{  /* NOCONTEXT */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5786
#ifdef COUNT_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5787
    RETURN ( __MKSMALLINT(__cnt_cur));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5788
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5789
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5790
#endif
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  5791
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  5792
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  5793
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  5794
debug2
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  5795
    "enable more debug prints - this will vanish"
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  5796
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  5797
%{  /* NOCONTEXT */
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  5798
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  5799
    __debug__ = 2;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  5800
%}
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  5801
!
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  5802
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5803
debug:aBoolean
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5804
    "enable/disable debug prints - this will vanish"
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5805
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5806
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5807
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5808
    __debug__ = (aBoolean == true) ? 1 : 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5809
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5810
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5811
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5812
fontHandleCounts
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5813
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5814
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  5815
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5816
#ifdef COUNT_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5817
    RETURN ( __MKSMALLINT(__cnt_font));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5818
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5819
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5820
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5821
%}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5822
!
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5823
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5824
gcDataHandleCounts
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5825
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5826
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5827
%{  /* NOCONTEXT */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5828
#ifdef COUNT_RESOURCES
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  5829
    RETURN ( __MKSMALLINT(__cnt_gcData));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5830
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5831
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5832
#endif
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  5833
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  5834
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  5835
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  5836
printHandleCounts
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5837
   "show prim values"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5838
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  5839
   ('WINWORKSTATION: pW=', self windowHandleCounts printString,
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  5840
    'pB=',self bitmapHandleCounts printString,
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  5841
    'pGc=',self gcDataHandleCounts printString,
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  5842
    'pbmpdc=',self bmpDcHandleCounts printString) errorPrintNL
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  5843
!
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  5844
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  5845
windowHandleCounts
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5846
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5847
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5848
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5849
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5850
    RETURN ( __MKSMALLINT(__cnt_createWindows));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5851
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5852
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  5853
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5854
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5855
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5856
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5857
!WinWorkstation class methodsFor:'queries'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5858
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5859
platformName
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5860
    "ST-80 compatibility.
2777
60ba83db1fab comment
Claus Gittinger <cg@exept.de>
parents: 2766
diff changeset
  5861
     Return a string describing the display systems platform.
60ba83db1fab comment
Claus Gittinger <cg@exept.de>
parents: 2766
diff changeset
  5862
     WinWorkstation always returns 'WIN32'."
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5863
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5864
    ^ 'WIN32'  
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5865
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5866
    "Modified: 26.5.1996 / 15:32:46 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5867
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5868
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5869
!WinWorkstation methodsFor:'accessing & queries'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5870
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5871
activateOnClick:aBoolean
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5872
    "set/clear the activateOnClick behavior.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5873
     If on, a click into a window raises and activates
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5874
     the window.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5875
     Windows users typically enable this;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5876
     users which are used to the X-Window system typically prefer
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5877
     it disabled.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5878
     Returns the previous setting.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5879
     The default is true."
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5880
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5881
%{  /* NOCONTEXT */
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5882
    OBJ rslt = __activateOnClick ? true : false;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5883
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5884
    if (aBoolean == true) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5885
       __activateOnClick = 1;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5886
    } else {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5887
       if (aBoolean == false) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5888
	   __activateOnClick = 0;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5889
       }
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5890
    }
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5891
    RETURN (rslt);
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5892
%}
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  5893
    "
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  5894
     Display activateOnClick:true
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  5895
     Display activateOnClick:false
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  5896
    "
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  5897
!
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  5898
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5899
anyButtonMotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5900
    "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
  5901
     This is the devices mask."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5902
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5903
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5904
    RETURN ( __MKSMALLINT(Button1MotionMask | Button2MotionMask | Button3MotionMask));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  5905
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5906
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5907
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5908
blackpixel
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5909
    "return the colornumber of black"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5910
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5911
    ^ blackpixel
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5912
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5913
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5914
button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5915
    "return the state-mask for button1 in motion events' state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5916
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5917
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5918
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5919
    RETURN (__MKSMALLINT(Button1MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5920
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5921
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5922
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5923
     Display button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5924
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5925
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5926
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5927
button2MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5928
    "return the state-mask for button2 in motion events' state-field
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5929
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5930
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5931
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5932
    RETURN (__MKSMALLINT(Button2MotionMask)); 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5933
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5934
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5935
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5936
button3MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5937
    "return the state-mask for button3 in motion events' state-field
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5938
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5939
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5940
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5941
    RETURN (__MKSMALLINT(Button3MotionMask)); 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5942
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5943
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5944
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5945
buttonMotionMask:aButton
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5946
    "return the state-mask for button1 in motion events state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5947
     This is the devices mask."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5948
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5949
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5950
    if (aButton == __MKSMALLINT(1)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5951
	RETURN (__MKSMALLINT(Button1MotionMask));    
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5952
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5953
    if (aButton == __MKSMALLINT(2)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5954
	RETURN (__MKSMALLINT(Button2MotionMask));    
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5955
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5956
    if (aButton == __MKSMALLINT(3)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5957
	RETURN (__MKSMALLINT(Button3MotionMask));    
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5958
    }
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
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5961
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5962
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5963
controlMask
3261
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  5964
    "return the state-mask for the CTRL modified in motion events' state-field.
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  5965
     Obsolete"
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  5966
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  5967
%{  /* NOCONTEXT */
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  5968
    RETURN (__MKSMALLINT(ControlMask));
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  5969
%}
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  5970
!
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  5971
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  5972
ctrlModifierMask
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5973
    "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
  5974
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5975
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5976
    RETURN (__MKSMALLINT(ControlMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5977
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5978
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5979
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5980
defaultEventMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5981
    "return a mask to enable some events by default."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5982
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5983
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5984
    RETURN (__MKSMALLINT( ExposureMask | StructureNotifyMask |
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5985
			 KeyPressMask | KeyReleaseMask |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5986
			 EnterWindowMask | LeaveWindowMask |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5987
			 ButtonPressMask | ButtonMotionMask | ButtonReleaseMask ));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5988
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5989
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5990
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5991
displayFileDescriptor
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5992
    "return the displays fileNumber for select, if any"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5993
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5994
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5995
   /* RETURN (nil);*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5996
   RETURN ( __MKEXTERNALADDRESS(hInputEvent));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5997
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5998
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5999
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6000
displayName
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6001
    "return the display-connections display name.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6002
     For Windows, a dummy name is returned"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6003
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6004
    ^ 'local'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6005
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6006
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6007
focusFollowsMouse:aBoolean
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6008
    "set/clear the focusFollowsMouse behavior.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6009
     If on, the view under the mouse gets the keyboard input
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6010
     (however, within a windowGroup, ST/X can still forward the event 
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6011
      the groups focusView...).
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6012
     Windows users typically disable this;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6013
     users which are used to the X-Window system typically prefer
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6014
     it enabled.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6015
     Returns the previous setting.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6016
     The default is false."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6017
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6018
%{  /* NOCONTEXT */
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6019
    OBJ rslt = __focusFollowsMouse ? true : false;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6020
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6021
    if (aBoolean == true) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6022
       __focusFollowsMouse = 1;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6023
    } else {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6024
       if (aBoolean == false) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6025
	   __focusFollowsMouse = 0;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6026
       }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6027
    }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6028
    RETURN (rslt);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6029
%}
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6030
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6031
     WinWorkstation focusFollowsMouse:true
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6032
     WinWorkstation focusFollowsMouse:false
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6033
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6034
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6035
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6036
getSystemColor:aKey
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6037
    "retrieve a windows system color.
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6038
     The styleSheet/View classes may use this to setup default colors"
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6039
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6040
    |rgb|
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6041
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6042
    rgb := self primGetSystemColor:aKey.
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6043
    rgb notNil ifTrue:[
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6044
	^ Color
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6045
	    redByte:((rgb bitShift:-16) bitAnd:16rFF)
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6046
	    greenByte:((rgb bitShift:-8) bitAnd:16rFF)
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6047
	    blueByte:(rgb bitAnd:16rFF)
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6048
    ].
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6049
    ^ nil
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6050
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6051
    "
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6052
     Display getSystemColor:#COLOR_WINDOW
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6053
     Display getSystemColor:#COLOR_HIGHLIGHT
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6054
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6055
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6056
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6057
getSystemMetrics:aNumberOrSymbol
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6058
    "get a system metrics value; 
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6059
     the argument is a #define-like symbol as described in the windows API;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6060
     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
  6061
     which must be the define-value."
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6062
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6063
%{  /* NOCONTEXT */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6064
    int info = 0;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6065
    int isBool = 0;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6066
    int arg;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6067
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6068
    if (__isSmallInteger(aNumberOrSymbol)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6069
	arg = __intVal(aNumberOrSymbol);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6070
    } else if ((aNumberOrSymbol == @symbol(swapButton)) || (aNumberOrSymbol == @symbol(SM_SWAPBUTTON))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6071
	arg = SM_SWAPBUTTON;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6072
	isBool = 1;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6073
    } else if ((aNumberOrSymbol == @symbol(mousePresent)) || (aNumberOrSymbol == @symbol(SM_MOUSEPRESENT))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6074
	arg = SM_MOUSEPRESENT;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6075
	isBool = 1;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6076
    } else if ((aNumberOrSymbol == @symbol(mouseButtons)) || (aNumberOrSymbol == @symbol(SM_CMOUSEBUTTONS))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6077
	arg = SM_CMOUSEBUTTONS;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6078
    } else if ((aNumberOrSymbol == @symbol(iconWidth)) || (aNumberOrSymbol == @symbol(SM_CXICON))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6079
	arg = SM_CXICON;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6080
    } else if ((aNumberOrSymbol == @symbol(iconHeight)) || (aNumberOrSymbol == @symbol(SM_CYICON))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6081
	arg = SM_CYICON;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  6082
    } else if ((aNumberOrSymbol == @symbol(iconWidth)) || (aNumberOrSymbol == @symbol(SM_CXDOUBLECLK))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6083
	arg = SM_CXDOUBLECLK;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  6084
    } else if ((aNumberOrSymbol == @symbol(iconHeight)) || (aNumberOrSymbol == @symbol(SM_CYDOUBLECLK))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6085
	arg = SM_CYDOUBLECLK;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6086
    } else if ((aNumberOrSymbol == @symbol(cursorWidth)) || (aNumberOrSymbol == @symbol(SM_CXCURSOR))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6087
	arg = SM_CXCURSOR;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6088
    } else if ((aNumberOrSymbol == @symbol(cursorHeight)) || (aNumberOrSymbol == @symbol(SM_CYCURSOR))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6089
	arg = SM_CYCURSOR;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6090
    } else if ((aNumberOrSymbol == @symbol(captionHeight)) || (aNumberOrSymbol == @symbol(SM_CYCAPTION))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6091
	arg = SM_CYCAPTION;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6092
    } else if ((aNumberOrSymbol == @symbol(resizeFrameWidth)) || (aNumberOrSymbol == @symbol(SM_CXFRAME))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6093
	arg = SM_CXFRAME;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6094
    } else if ((aNumberOrSymbol == @symbol(resizeFrameHeight)) || (aNumberOrSymbol == @symbol(SM_CYFRAME))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6095
	arg = SM_CYFRAME;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6096
    } else if ((aNumberOrSymbol == @symbol(borderFrameWidth)) || (aNumberOrSymbol == @symbol(SM_CXBORDER))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6097
	arg = SM_CXBORDER;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6098
    } else if ((aNumberOrSymbol == @symbol(borderFrameHeight)) || (aNumberOrSymbol == @symbol(SM_CYBORDER))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6099
	arg = SM_CYBORDER;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6100
    } else if (aNumberOrSymbol == @symbol(SM_CXDLGFRAME)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6101
	arg = SM_CXDLGFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6102
    } else if (aNumberOrSymbol == @symbol(SM_CYDLGFRAME)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6103
	arg = SM_CYDLGFRAME;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6104
    } else if ((aNumberOrSymbol == @symbol(fullScreenWindowWidth)) || (aNumberOrSymbol == @symbol(SM_CXFULLSCREEN))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6105
	arg = SM_CXFULLSCREEN;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6106
    } else if ((aNumberOrSymbol == @symbol(fullScreenWindowHeight)) || (aNumberOrSymbol == @symbol(SM_CYFULLSCREEN))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6107
	arg = SM_CYFULLSCREEN;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6108
    } else if ((aNumberOrSymbol == @symbol(screenWidth)) || (aNumberOrSymbol == @symbol(SM_CXSCREEN))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6109
	arg = SM_CXSCREEN;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6110
    } else if ((aNumberOrSymbol == @symbol(screenHeight)) || (aNumberOrSymbol == @symbol(SM_CYSCREEN))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6111
	arg = SM_CYSCREEN;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6112
    } else if ((aNumberOrSymbol == @symbol(minWindowWidth)) || (aNumberOrSymbol == @symbol(SM_CXMIN))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6113
	arg = SM_CXMIN;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6114
    } else if ((aNumberOrSymbol == @symbol(minWindowHeight)) || (aNumberOrSymbol == @symbol(SM_CYMIN))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6115
	arg = SM_CYMIN;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6116
    } else if ((aNumberOrSymbol == @symbol(vScrollbarWidth)) || (aNumberOrSymbol == @symbol(SM_CXVSCROLL))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6117
	arg = SM_CXVSCROLL;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6118
    } else if ((aNumberOrSymbol == @symbol(hScrollbarHeight)) || (aNumberOrSymbol == @symbol(SM_CYHSCROLL))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6119
	arg = SM_CYHSCROLL;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6120
    } else if ((aNumberOrSymbol == @symbol(vThumbHeight)) || (aNumberOrSymbol == @symbol(SM_CYVTHUMB))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6121
	arg = SM_CYVTHUMB;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6122
    } else if ((aNumberOrSymbol == @symbol(hThumbWidth)) || (aNumberOrSymbol == @symbol(SM_CXHTHUMB))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6123
	arg = SM_CXHTHUMB;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6124
    } else if ((aNumberOrSymbol == @symbol(SM_CXSIZE))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6125
	arg = SM_CXSIZE;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6126
    } else if ((aNumberOrSymbol == @symbol(SM_CYSIZE))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6127
	arg = SM_CYSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6128
    } else if ((aNumberOrSymbol == @symbol(SM_CYVSCROLL))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6129
	arg = SM_CYVSCROLL;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6130
    } else if ((aNumberOrSymbol == @symbol(SM_CXHSCROLL))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6131
	arg = SM_CXHSCROLL;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6132
    } else if ((aNumberOrSymbol == @symbol(SM_CXMINTRACK))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6133
	arg = SM_CXMINTRACK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6134
    } else if ((aNumberOrSymbol == @symbol(SM_CYMINTRACK))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6135
	arg = SM_CYMINTRACK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6136
    } else if ((aNumberOrSymbol == @symbol(SM_CXICONSPACING))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6137
	arg = SM_CXICONSPACING;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6138
    } else if ((aNumberOrSymbol == @symbol(SM_CYICONSPACING))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6139
	arg = SM_CYICONSPACING;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6140
    } else if ((aNumberOrSymbol == @symbol(SM_CYMENU))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6141
	arg = SM_CYMENU;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6142
    } else if ((aNumberOrSymbol == @symbol(SM_MENUDROPALIGNMENT))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6143
	arg = SM_MENUDROPALIGNMENT;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6144
    } else if ((aNumberOrSymbol == @symbol(SM_PENWINDOWS))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6145
	arg = SM_PENWINDOWS;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6146
    } else if ((aNumberOrSymbol == @symbol(SM_DBCSENABLED))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6147
	arg = SM_DBCSENABLED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6148
    } else if ((aNumberOrSymbol == @symbol(SM_CXFIXEDFRAME))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6149
	arg = SM_CXFIXEDFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6150
    } else if ((aNumberOrSymbol == @symbol(SM_CYFIXEDFRAME))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6151
	arg = SM_CYFIXEDFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6152
    } else if ((aNumberOrSymbol == @symbol(SM_CXSIZEFRAME))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6153
	arg = SM_CXSIZEFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6154
    } else if ((aNumberOrSymbol == @symbol(SM_CYSIZEFRAME))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6155
	arg = SM_CYSIZEFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6156
    } else if ((aNumberOrSymbol == @symbol(SM_CYKANJIWINDOW))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6157
	arg = SM_CYKANJIWINDOW;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6158
    } else if ((aNumberOrSymbol == @symbol(SM_SECURE))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6159
	arg = SM_SECURE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6160
    } else if ((aNumberOrSymbol == @symbol(SM_CXEDGE))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6161
	arg = SM_CXEDGE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6162
    } else if ((aNumberOrSymbol == @symbol(SM_CYEDGE))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6163
	arg = SM_CYEDGE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6164
    } else if ((aNumberOrSymbol == @symbol(SM_CXMINSPACING))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6165
	arg = SM_CXMINSPACING;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6166
    } else if ((aNumberOrSymbol == @symbol(SM_CYMINSPACING))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6167
	arg = SM_CYMINSPACING;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6168
    } else if ((aNumberOrSymbol == @symbol(SM_CXSMICON))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6169
	arg = SM_CXSMICON;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6170
    } else if ((aNumberOrSymbol == @symbol(SM_CYSMICON))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6171
	arg = SM_CYSMICON;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6172
    } else if ((aNumberOrSymbol == @symbol(SM_CYSMCAPTION))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6173
	arg = SM_CYSMCAPTION;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6174
    } else if ((aNumberOrSymbol == @symbol(SM_CXSMSIZE))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6175
	arg = SM_CXSMSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6176
    } else if ((aNumberOrSymbol == @symbol(SM_CYSMSIZE))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6177
	arg = SM_CYSMSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6178
    } else if ((aNumberOrSymbol == @symbol(SM_CXMENUSIZE))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6179
	arg = SM_CXMENUSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6180
    } else if ((aNumberOrSymbol == @symbol(SM_CYMENUSIZE))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6181
	arg = SM_CYMENUSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6182
    } else if ((aNumberOrSymbol == @symbol(SM_ARRANGE))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6183
	arg = SM_ARRANGE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6184
    } else if ((aNumberOrSymbol == @symbol(SM_CXMINIMIZED))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6185
	arg = SM_CXMINIMIZED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6186
    } else if ((aNumberOrSymbol == @symbol(SM_CYMINIMIZED))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6187
	arg = SM_CYMINIMIZED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6188
    } else if ((aNumberOrSymbol == @symbol(SM_CXMAXTRACK))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6189
	arg = SM_CXMAXTRACK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6190
    } else if ((aNumberOrSymbol == @symbol(SM_CYMAXTRACK))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6191
	arg = SM_CYMAXTRACK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6192
    } else if ((aNumberOrSymbol == @symbol(SM_CXMAXIMIZED))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6193
	arg = SM_CXMAXIMIZED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6194
    } else if ((aNumberOrSymbol == @symbol(SM_CYMAXIMIZED))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6195
	arg = SM_CYMAXIMIZED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6196
    } else if ((aNumberOrSymbol == @symbol(SM_NETWORK))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6197
	arg = SM_NETWORK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6198
    } else if ((aNumberOrSymbol == @symbol(SM_CXDRAG))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6199
	arg = SM_CXDRAG;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6200
    } else if ((aNumberOrSymbol == @symbol(SM_CYDRAG))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6201
	arg = SM_CYDRAG;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6202
    } else if ((aNumberOrSymbol == @symbol(SM_NETWORK))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6203
	arg = SM_NETWORK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6204
    } else if ((aNumberOrSymbol == @symbol(SM_SHOWSOUNDS))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6205
	arg = SM_SHOWSOUNDS;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6206
    } else if ((aNumberOrSymbol == @symbol(SM_CXMENUCHECK))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6207
	arg = SM_CXMENUCHECK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6208
    } else if ((aNumberOrSymbol == @symbol(SM_CYMENUCHECK))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6209
	arg = SM_CYMENUCHECK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6210
    } else if ((aNumberOrSymbol == @symbol(SM_SLOWMACHINE))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6211
	arg = SM_SLOWMACHINE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6212
    } else if ((aNumberOrSymbol == @symbol(SM_MIDEASTENABLED))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6213
	arg = SM_MIDEASTENABLED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6214
    } else if ((aNumberOrSymbol == @symbol(SM_MOUSEWHEELPRESENT))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6215
	arg = SM_MOUSEWHEELPRESENT;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6216
    } else if ((aNumberOrSymbol == @symbol(SM_XVIRTUALSCREEN))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6217
	arg = SM_XVIRTUALSCREEN;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6218
    } else if ((aNumberOrSymbol == @symbol(SM_YVIRTUALSCREEN))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6219
	arg = SM_YVIRTUALSCREEN;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6220
    } else if ((aNumberOrSymbol == @symbol(SM_CXVIRTUALSCREEN))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6221
	arg = SM_CXVIRTUALSCREEN;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6222
    } else if ((aNumberOrSymbol == @symbol(SM_CYVIRTUALSCREEN))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6223
	arg = SM_CYVIRTUALSCREEN;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6224
    } else if ((aNumberOrSymbol == @symbol(SM_CMONITORS))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6225
	arg = SM_CMONITORS;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6226
    } else if ((aNumberOrSymbol == @symbol(SM_SAMEDISPLAYFORMAT))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6227
	arg = SM_SAMEDISPLAYFORMAT;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6228
    } else if ((aNumberOrSymbol == @symbol(SM_IMMENABLED))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6229
	arg = SM_IMMENABLED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6230
    } else if ((aNumberOrSymbol == @symbol(SM_DEBUG))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6231
	arg = SM_DEBUG;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6232
#ifdef SM_REMOTESESSION
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6233
    } else if ((aNumberOrSymbol == @symbol(SM_REMOTESESSION))) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6234
	arg = SM_REMOTESESSION;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6235
#endif
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6236
    } else {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6237
	RETURN (nil);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6238
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6239
    info = GetSystemMetrics(arg);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6240
    if (isBool) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6241
	RETURN (info ? true : false);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6242
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6243
    RETURN (__MKSMALLINT(info));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6244
%}
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6245
    "
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6246
     Screen current getSystemMetrics:#SM_MOUSEWHEELPRESENT
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6247
     Screen current getSystemMetrics:#SM_ARRANGE
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6248
    "
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6249
!
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6250
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6251
getSystemParametersInfo:aNumberOrSymbol
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6252
    "get a system parameter value; 
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6253
     the argument is a #define-like symbol as described in the windows API;
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6254
     However, to allow for future values to be retrieved, also allow an integer
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6255
     which must be the define-value."
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6256
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6257
    | info menuFontInfoArray statusFontInfoArray messageFontInfoArray 
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6258
      menuFont statusFont messageFont |
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6259
%{ 
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6260
    int retVal = 0;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6261
    int isBool = 0;
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6262
    int isString = 0;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6263
    int isRect = 0;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6264
    int isNonClientInfo = 0;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6265
    int arg, param;
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6266
    void *pRslt;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6267
    union {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6268
	char buffer[1024];
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6269
	RECT rect;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6270
	NONCLIENTMETRICS nc;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6271
    } rslt;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6272
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6273
    if (__isSmallInteger(aNumberOrSymbol)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6274
	arg = __intVal(aNumberOrSymbol);
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6275
    } else if (aNumberOrSymbol == @symbol(SPI_GETDESKWALLPAPER)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6276
	arg = SPI_GETDESKWALLPAPER;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6277
	isString = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6278
#ifdef SPI_GETDROPSHADOW
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6279
    } else if (aNumberOrSymbol == @symbol(SPI_GETDROPSHADOW)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6280
	arg = SPI_GETDROPSHADOW;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6281
	isBool = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6282
#endif
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6283
#ifdef SPI_GETFLATMENU
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6284
    } else if (aNumberOrSymbol == @symbol(SPI_GETFLATMENU)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6285
	arg = SPI_GETFLATMENU;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6286
	isBool = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6287
#endif
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6288
#ifdef SPI_GETWHEELSCROLLLINES
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6289
    } else if (aNumberOrSymbol == @symbol(SPI_GETWHEELSCROLLLINES)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6290
	arg = SPI_GETWHEELSCROLLLINES;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6291
#endif
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6292
#ifdef SPI_GETHOTTRACKING
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6293
    } else if (aNumberOrSymbol == @symbol(SPI_GETHOTTRACKING)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6294
	arg = SPI_GETHOTTRACKING;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6295
	isBool = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6296
#endif
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6297
#ifdef SPI_GETTOOLTIPANIMATION
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6298
    } else if (aNumberOrSymbol == @symbol(SPI_GETTOOLTIPANIMATION)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6299
	arg = SPI_GETTOOLTIPANIMATION;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6300
	isBool = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6301
#endif
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6302
#ifdef SPI_GETWORKAREA
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6303
    } else if (aNumberOrSymbol == @symbol(SPI_GETWORKAREA)) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6304
	arg = SPI_GETWORKAREA;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6305
	isRect = 1;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6306
#endif
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6307
#ifdef SPI_GETNONCLIENTMETRICS
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6308
    } else if (aNumberOrSymbol == @symbol(SPI_GETNONCLIENTMETRICS)) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6309
	arg = SPI_GETNONCLIENTMETRICS;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6310
	rslt.nc.cbSize = sizeof ( rslt.nc ) ;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6311
	isNonClientInfo = 1;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6312
#endif
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6313
    } else {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6314
	RETURN (nil);
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6315
    }
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6316
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6317
    param = 0;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6318
    pRslt = (void *)&rslt;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6319
    if (isString) {
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6320
	param = sizeof(rslt);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6321
    }
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6322
    retVal = SystemParametersInfo(arg, param, pRslt, 0);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6323
    if (! retVal) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6324
	RETURN (nil);
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6325
    }
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6326
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6327
    if (isBool) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6328
	RETURN (info ? true : false);
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6329
    }
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6330
    if (isString) {
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6331
	RETURN (__MKSTRING(rslt.buffer));
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6332
    }
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6333
    if (isRect) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6334
	RETURN ( __SSEND4(__DEF_Rectangle, @symbol(left:top:right:bottom:), 0,
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6335
			__MKSMALLINT(rslt.rect.left), 
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6336
			__MKSMALLINT(rslt.rect.top), 
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6337
			__MKSMALLINT(rslt.rect.right), 
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6338
			__MKSMALLINT(rslt.rect.bottom)) ); 
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6339
    }
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6340
    if (isNonClientInfo) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6341
	menuFontInfoArray = __extractLogicalFontParameters(&rslt.nc.lfMenuFont);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6342
	statusFontInfoArray = __extractLogicalFontParameters(&rslt.nc.lfStatusFont);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6343
	messageFontInfoArray = __extractLogicalFontParameters(&rslt.nc.lfMessageFont);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6344
    }
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6345
    
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6346
   out: ;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6347
%}.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6348
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6349
    menuFontInfoArray notNil ifTrue:[
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6350
	menuFont := self fontDescriptionFromLogicalFontInfoArray:menuFontInfoArray.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6351
	statusFont := self fontDescriptionFromLogicalFontInfoArray:statusFontInfoArray.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6352
	messageFont := self fontDescriptionFromLogicalFontInfoArray:messageFontInfoArray.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6353
	^ (Dictionary new)
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6354
	    at:#menuFont put:menuFont;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6355
	    at:#statusFont put:statusFont;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6356
	    at:#messageFont put:messageFont;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6357
	    yourself.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6358
    ].
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6359
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6360
    ^ nil
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6361
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6362
    "
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6363
     Screen current getSystemParametersInfo:#SPI_GETDESKWALLPAPER
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6364
     Screen current getSystemParametersInfo:#SPI_GETDROPSHADOW
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6365
     Screen current getSystemParametersInfo:#SPI_GETFLATMENU        
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6366
     Screen current getSystemParametersInfo:#SPI_GETWHEELSCROLLLINES  
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6367
     Screen current getSystemParametersInfo:#SPI_GETHOTTRACKING  
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6368
     Screen current getSystemParametersInfo:#SPI_GETTOOLTIPANIMATION  
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6369
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6370
     Screen current getSystemParametersInfo:#SPI_GETWORKAREA 
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6371
     Screen current getSystemParametersInfo:#SPI_GETNONCLIENTMETRICS 
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6372
    "
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6373
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6374
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6375
ignoreButtonPressOnActivate:aBoolean
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6376
    "set/clear the ignoreButtonPressOnActivate behavior.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6377
     If on, the button-press which activated a window is ignored (eaten),
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6378
     and not passed to the window.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6379
     If off, the window receives the buttonPress after the window is activated.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6380
     The default is true, since it avoids unwanted selections due to window
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6381
     activation.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6382
     Returns the previous setting."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6383
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6384
%{  /* NOCONTEXT */
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6385
    OBJ rslt = __ignoreButtonPressOnActivate ? true : false;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6386
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6387
    if (aBoolean == true) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6388
       __ignoreButtonPressOnActivate = 1;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6389
    } else {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6390
       if (aBoolean == false) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6391
	   __ignoreButtonPressOnActivate = 0;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6392
       }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6393
    }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6394
    RETURN (rslt);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6395
%}
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6396
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6397
     WinWorkstation ignoreButtonPressOnActivate:true
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6398
     WinWorkstation ignoreButtonPressOnActivate:false
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6399
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6400
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6401
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6402
primGetSystemColor:aKey
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  6403
%{  /* NOCONTEXT */
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  6404
    int p;
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6405
    int rgb, r, g, b;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  6406
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6407
    if (aKey == @symbol(COLOR_WINDOW)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  6408
      p = COLOR_WINDOW;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  6409
    } else if (aKey == @symbol(COLOR_WINDOWTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  6410
      p = COLOR_WINDOWTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  6411
    } else if (aKey == @symbol(COLOR_MENU)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  6412
      p = COLOR_MENU;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  6413
    } else if (aKey == @symbol(COLOR_MENUTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  6414
      p = COLOR_MENUTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  6415
    } else if (aKey == @symbol(COLOR_BTNFACE)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  6416
      p = COLOR_BTNFACE;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  6417
    } else if (aKey == @symbol(COLOR_BTNSHADOW)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  6418
      p = COLOR_BTNSHADOW;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  6419
    } else if (aKey == @symbol(COLOR_BTNTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  6420
      p = COLOR_BTNTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  6421
    } else if (aKey == @symbol(COLOR_GRAYTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  6422
      p = COLOR_GRAYTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  6423
    } else if (aKey == @symbol(COLOR_HIGHLIGHT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  6424
      p = COLOR_HIGHLIGHT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  6425
    } else if (aKey == @symbol(COLOR_HIGHLIGHTTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  6426
      p = COLOR_HIGHLIGHTTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  6427
    } else if (aKey == @symbol(COLOR_MENU)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  6428
      p = COLOR_MENU;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  6429
    } else if (aKey == @symbol(COLOR_MENUTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  6430
      p = COLOR_MENUTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  6431
    } else if (aKey == @symbol(COLOR_SCROLLBAR)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  6432
      p = COLOR_SCROLLBAR;
2239
f535b1178597 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  6433
#ifdef COLOR_SHADOW
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  6434
    } else if (aKey == @symbol(COLOR_SHADOW)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  6435
      p = COLOR_SHADOW;
2239
f535b1178597 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  6436
#endif
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6437
#ifdef COLOR_BACKGROUND
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6438
    } else if (aKey == @symbol(COLOR_BACKGROUND)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6439
      p = COLOR_BACKGROUND;
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6440
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6441
#ifdef COLOR_ACTIVECAPTION
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6442
    } else if (aKey == @symbol(COLOR_ACTIVECAPTION)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6443
      p = COLOR_ACTIVECAPTION;
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6444
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6445
#ifdef COLOR_INACTIVECAPTION
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6446
    } else if (aKey == @symbol(COLOR_INACTIVECAPTION)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6447
      p = COLOR_INACTIVECAPTION;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6448
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6449
#ifdef COLOR_WINDOWFRAME
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6450
    } else if (aKey == @symbol(COLOR_WINDOWFRAME)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6451
      p = COLOR_WINDOWFRAME;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6452
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6453
#ifdef COLOR_CAPTIONTEXT
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6454
    } else if (aKey == @symbol(COLOR_CAPTIONTEXT)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6455
      p = COLOR_CAPTIONTEXT;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6456
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6457
#ifdef COLOR_ACTIVEBORDER
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6458
    } else if (aKey == @symbol(COLOR_ACTIVEBORDER)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6459
      p = COLOR_ACTIVEBORDER;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6460
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6461
#ifdef COLOR_INACTIVEBORDER
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6462
    } else if (aKey == @symbol(COLOR_INACTIVEBORDER)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6463
      p = COLOR_INACTIVEBORDER;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6464
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6465
#ifdef COLOR_APPWORKSPACE
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6466
    } else if (aKey == @symbol(COLOR_APPWORKSPACE)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6467
      p = COLOR_APPWORKSPACE;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6468
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6469
#ifdef COLOR_INACTIVECAPTIONTEXT
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6470
    } else if (aKey == @symbol(COLOR_INACTIVECAPTIONTEXT)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6471
      p = COLOR_INACTIVECAPTIONTEXT;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6472
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6473
#ifdef COLOR_BTNHIGHLIGHT
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6474
    } else if (aKey == @symbol(COLOR_BTNHIGHLIGHT)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6475
      p = COLOR_BTNHIGHLIGHT;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6476
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6477
#ifdef COLOR_3DDKSHADOW
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6478
    } else if (aKey == @symbol(COLOR_3DDKSHADOW)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6479
      p = COLOR_3DDKSHADOW;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6480
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6481
#ifdef COLOR_3DLIGHT
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6482
    } else if (aKey == @symbol(COLOR_3DLIGHT)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6483
      p = COLOR_3DLIGHT;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6484
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6485
#ifdef COLOR_INFOTEXT
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6486
    } else if (aKey == @symbol(COLOR_INFOTEXT)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6487
      p = COLOR_INFOTEXT;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6488
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6489
#ifdef COLOR_INFOBK
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6490
    } else if (aKey == @symbol(COLOR_INFOBK)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6491
      p = COLOR_INFOBK;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6492
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6493
#ifdef COLOR_HOTLIGHT
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6494
    } else if (aKey == @symbol(COLOR_HOTLIGHT)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6495
      p = COLOR_HOTLIGHT;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6496
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6497
#ifdef COLOR_GRADIENTACTIVECAPTION
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6498
    } else if (aKey == @symbol(COLOR_GRADIENTACTIVECAPTION)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6499
      p = COLOR_GRADIENTACTIVECAPTION;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6500
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6501
#ifdef COLOR_GRADIENTINACTIVECAPTION
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6502
    } else if (aKey == @symbol(COLOR_GRADIENTINACTIVECAPTION)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6503
      p = COLOR_GRADIENTINACTIVECAPTION;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6504
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6505
#ifdef COLOR_DESKTOP
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6506
    } else if (aKey == @symbol(COLOR_DESKTOP)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6507
      p = COLOR_DESKTOP;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6508
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6509
#ifdef COLOR_3DFACE
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6510
    } else if (aKey == @symbol(COLOR_3DFACE)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6511
      p = COLOR_3DFACE;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6512
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6513
#ifdef COLOR_3DSHADOW
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6514
    } else if (aKey == @symbol(COLOR_3DSHADOW)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6515
      p = COLOR_3DSHADOW;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6516
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6517
#ifdef COLOR_3DHIGHLIGHT
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6518
    } else if (aKey == @symbol(COLOR_3DHIGHLIGHT)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6519
      p = COLOR_3DHIGHLIGHT;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6520
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6521
#ifdef COLOR_3DHILIGHT
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6522
    } else if (aKey == @symbol(COLOR_3DHILIGHT)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6523
      p = COLOR_3DHILIGHT;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6524
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6525
#ifdef COLOR_BTNHILIGHT
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6526
    } else if (aKey == @symbol(COLOR_BTNHILIGHT)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6527
      p = COLOR_BTNHILIGHT;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  6528
#endif
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  6529
    } else {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  6530
      RETURN (nil);
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  6531
    }
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6532
    rgb = GetSysColor(p);
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6533
    /* win uses BGR order */
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6534
    r = rgb & 0xFF;
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6535
    g = (rgb >> 8) & 0xFF;
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6536
    b = (rgb >> 16) & 0xFF;
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6537
    rgb = (((r << 8) | g) << 8) | b;
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6538
    RETURN (__MKSMALLINT(rgb));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6539
%}.
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6540
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6541
    "
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6542
     Screen current getSystemColor:#COLOR_HOTLIGHT      
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6543
     Screen current getSystemColor:#COLOR_HIGHLIGHT      
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6544
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6545
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6546
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6547
primViewIdFromPoint:aPoint in:windowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6548
    "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
  6549
     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
  6550
     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
  6551
     - 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
  6552
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  6553
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6554
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6555
    OBJ xp, yp;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6556
    int xpos, ypos;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6557
    HWND child_return;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6558
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6559
    if (ISCONNECTED
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6560
     && __isExternalAddress(windowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6561
     && __isPoint(aPoint))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6562
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6563
	xp = _point_X(aPoint);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6564
	yp = _point_Y(aPoint);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6565
	if (__bothSmallInteger(xp, yp))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6566
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6567
	    POINT p;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6568
	    HWND hWnd = _HWNDVal(windowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6569
	    p.x = __intVal(xp);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6570
	    p.y = __intVal(yp);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6571
	    ScreenToClient(hWnd, &p);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6572
	    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
  6573
	    /*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
  6574
	    if ((child_return) && (child_return != hWnd))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6575
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6576
		RETURN ( __MKEXTERNALADDRESS(child_return) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6577
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6578
	    RETURN ( nil );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6579
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6580
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6581
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6582
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6583
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6584
protocolVersion
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6585
    "return the displays protocol version.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6586
     For Windows, a dummy number is returned"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6587
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6588
    ^ '1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6589
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6590
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6591
     Display protocolVersion
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6592
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6593
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6594
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6595
rightButtonIsLowerWindow:aBoolean
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6596
    "set/clear the rightButtonIsLowerWindow behavior.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6597
     If on, a right-button press in the window-title area lowers the
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6598
     window.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6599
     The default is true, since a lower-window operation is very useful,
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6600
     and not provided by the standard windows applications.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6601
     Returns the previous setting."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6602
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6603
%{  /* NOCONTEXT */
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6604
    OBJ rslt = __rightButtonIsLowerWindow ? true : false;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6605
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6606
    if (aBoolean == true) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6607
       __rightButtonIsLowerWindow = 1;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6608
    } else {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6609
       if (aBoolean == false) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6610
	   __rightButtonIsLowerWindow = 0;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6611
       }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6612
    }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6613
    RETURN (rslt);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6614
%}
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6615
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6616
     WinWorkstation rightButtonIsLowerWindow:true
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6617
     WinWorkstation rightButtonIsLowerWindow:false
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6618
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6619
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6620
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6621
serverVendor
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6622
    "return the server vendor string. 
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6623
     For Windows, a dummy name is returned"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6624
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6625
    ^ 'microsoft'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6626
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6627
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6628
     Display serverVendor
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6629
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6630
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6631
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6632
shiftMask
3261
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6633
    "return the state-mask for the SHIFT modified in motion events' state-field.
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6634
     Obsolete"
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6635
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6636
%{  /* NOCONTEXT */
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6637
    RETURN (__MKSMALLINT(ShiftMask));
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6638
%}
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6639
!
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6640
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6641
shiftModifierMask
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6642
    "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
  6643
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6644
%{  /* NOCONTEXT */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6645
    RETURN (__MKSMALLINT(ShiftMask));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6646
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6647
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6648
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6649
shiftedLeftButtonIsLowerWindow:aBoolean
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6650
    "set/clear the shiftedLeftButtonIsLowerWindow behavior.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6651
     If on, a shift-left-button press in the window-title area lowers the
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6652
     window.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6653
     The default is true, since a lower-window operation is very useful,
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6654
     and not provided by the standard windows applications.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6655
     Notice, this duplicates the rightButtonIsLowerWindow behavior,
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6656
     but is useful with single-button mice.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6657
     Returns the previous setting."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6658
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6659
%{  /* NOCONTEXT */
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6660
    OBJ rslt = __shiftedLeftButtonIsLowerWindow ? true : false;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6661
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6662
    if (aBoolean == true) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6663
       __shiftedLeftButtonIsLowerWindow = 1;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6664
    } else {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6665
       if (aBoolean == false) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6666
	   __shiftedLeftButtonIsLowerWindow = 0;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6667
       }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6668
    }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6669
    RETURN (rslt);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6670
%}
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6671
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6672
     WinWorkstation shiftedLeftButtonIsLowerWindow:true
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6673
     WinWorkstation shiftedLeftButtonIsLowerWindow:false
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6674
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6675
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6676
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6677
supportedSystemColorKeys
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6678
    "return a collection of supported systemColor keys"
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6679
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6680
    ^#( 
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6681
	COLOR_WINDOW
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6682
	COLOR_WINDOWTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6683
	COLOR_MENU
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6684
	COLOR_MENUTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6685
	COLOR_BTNFACE
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6686
	COLOR_BTNSHADOW
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6687
	COLOR_BTNTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6688
	COLOR_GRAYTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6689
	COLOR_HIGHLIGHT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6690
	COLOR_HIGHLIGHTTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6691
	COLOR_MENU
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6692
	COLOR_MENUTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6693
	COLOR_SCROLLBAR
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6694
	COLOR_SHADOW
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6695
    )
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6696
!
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  6697
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6698
translatePoint:aPoint from:windowId1 to:windowId2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6699
    "given a point in window1, return the coordinate in window2.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6700
     This expects a device coordinate (relative to the first views origin)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6701
     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
  6702
     - use to xlate points from a window to rootwindow"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6703
2276
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  6704
    |x1 y1 x2 y2|
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  6705
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  6706
    x1 := x2 := aPoint x truncated.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  6707
    y1 := y2 := aPoint y truncated.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  6708
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  6709
%{
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  6710
    HWND w1, w2;
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  6711
    POINT point;
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  6712
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  6713
    if (__isExternalAddress(windowId1)
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  6714
     && __isExternalAddress(windowId2)
2279
30a35be06995 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2276
diff changeset
  6715
     && __bothSmallInteger(x1, y1)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  6716
	w1 = _HWNDVal(windowId1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  6717
	w2 = _HWNDVal(windowId2);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  6718
	point.x = __intVal(x1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  6719
	point.y = __intVal(y1);
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  6720
	CPRINTF(("TransPoint %x %d/%d ->",w1,point.x,point.y));
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  6721
	if (ClientToScreen(w1,&point) == FALSE) {
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  6722
	    RETURN (nil);
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  6723
	}
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  6724
	if (ScreenToClient(w2,&point) == FALSE) {
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  6725
	    RETURN (nil);
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  6726
	}
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  6727
	CPRINTF((" %x %d/%d\n",w2,point.x,point.y));
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  6728
	RETURN (__MKPOINT_INT(point.x, point.y));
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  6729
    }
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  6730
    RETURN (nil);
2276
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  6731
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6732
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6733
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6734
vendorRelease
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6735
    "return the display-servers vendor release 
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6736
     - should normally not be of any interest, 
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6737
     but may be usefule for special cases.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6738
     (to avoid bugs in certain implementations / releases)"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6739
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6740
    ^ 1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6741
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6742
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6743
     Display vendorRelease
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6744
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6745
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6746
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6747
viewIdFromPoint:aPoint in:windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6748
    "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
  6749
     hit by this coordinate. Return nil if no view was hit.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6750
     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
  6751
     - 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
  6752
     
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6753
    windowId notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6754
	aPoint isPoint ifTrue:[
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6755
	    "/(aPoint x > 30000) ifTrue:[self halt.].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6756
	    "/(aPoint y > 30000) ifTrue:[self halt.].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6757
	    "/aPoint printString errorPrintCR.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6758
	    ^ self primViewIdFromPoint:aPoint asPoint truncated in:windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6759
	]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6760
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6761
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6762
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6763
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6764
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6765
whitepixel
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6766
    "return the colornumber of white"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6767
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6768
    ^ whitepixel
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6769
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6770
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6771
!WinWorkstation methodsFor:'accessing display capabilities'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6772
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6773
captionHeight
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6774
    "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
  6775
     standard topWindows."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6776
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6777
    ^ self getSystemMetrics:#captionHeight
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6778
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6779
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6780
iconSizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6781
    "Get the preferred/supported icon sizes."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6782
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6783
    |d w h|
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6784
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6785
    w := self getSystemMetrics:#iconWidth.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6786
    h := self getSystemMetrics:#iconHeight.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6787
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6788
    d := IdentityDictionary new.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6789
    d at:#minWidth put:w.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6790
    d at:#maxWidth put:h.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6791
    d at:#widthStep put:1.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6792
    d at:#minHeight put:w.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6793
    d at:#maxHeight put:h.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6794
    d at:#heightStep put:1.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6795
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6796
    ^ OrderedCollection with:d
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6797
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6798
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6799
     Display iconSizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6800
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6801
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6802
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
  6803
nativeDialogs
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
  6804
    ^ NativeDialogs ? false
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
  6805
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
  6806
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
  6807
nativeDialogs:aBoolean
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
  6808
    NativeDialogs := aBoolean
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
  6809
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
  6810
    "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
  6811
     Screen current nativeDialogs:true.
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
  6812
     Dialog confirm:'Do You feel good ?'.  
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
  6813
     Dialog warn:'A Warning'.  
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
  6814
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
  6815
     Screen current nativeDialogs:false.
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
  6816
     Dialog confirm:'Do You feel good ?'   
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
  6817
     Dialog warn:'A Warning'.  
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
  6818
    "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
  6819
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
  6820
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6821
preferredIconSize
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6822
    "Get the preferrered icon size. 
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6823
     Here, workaround windows (bug?) which returns 32@32
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6824
     although, 20@20 is much nicer"
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6825
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6826
    ^ 20@20
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6827
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6828
    "
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6829
     Display preferredIconSize  
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6830
    "
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6831
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6832
    "Modified: / 28.9.1998 / 13:49:54 / cg"
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6833
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6834
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6835
scrollsAsynchronous
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6836
    "return true, if this display asynchronously sends expose events after a
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6837
     scroll operation. False otherwise. Asynchronous expose events are an X
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6838
     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
  6839
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6840
    ^ true "/ false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6841
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6842
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6843
supportedImageFormats
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6844
    "return an array with supported image formats; each array entry
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6845
     is another array, consisting of depth and bitsPerPixel values."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6846
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6847
    |info|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6848
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6849
    info := IdentityDictionary new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6850
    info at:#depth put:depth.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6851
    info at:#bitsPerPixel put:depth.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6852
    info at:#padding put:32.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6853
    ^ Array with:info
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  6854
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  6855
    "
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  6856
     Disply supportedImageFormats
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  6857
    "
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  6858
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  6859
    "Modified: / 10.9.1998 / 23:14:05 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6860
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6861
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6862
supportsDeepIcons
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6863
    "return true, if this device supports deepicons."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6864
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6865
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6866
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6867
2604
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  6868
supportsIconMasks
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  6869
    "return true, if this device supports masked icons.
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  6870
     For now, return false since somehow icons are inverted
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  6871
     if we use masks (and I dont know yet why)."
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  6872
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  6873
    ^ false
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  6874
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  6875
    "
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  6876
     Display supportsIconMasks 
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  6877
    "
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  6878
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  6879
    "Modified: / 28.4.1999 / 19:59:17 / cg"
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  6880
!
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  6881
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6882
supportsIconViews
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6883
    "return true, if this device supports views as icons."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6884
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6885
    ^ false "/ true
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6886
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6887
    "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6888
     Display supportsIconViews
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6889
    "
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
    "Modified: 10.6.1996 / 20:11:48 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6892
    "Created: 10.6.1996 / 21:08:18 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6893
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6894
2632
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  6895
supportsMaskedDrawingWith:aForm
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  6896
    "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
  6897
     to be used as paint color. 
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  6898
     Sorry - win95 only supports 8x8 masks."
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  6899
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  6900
    isWin95 ifFalse:[
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  6901
	^ true
2632
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  6902
    ].
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  6903
    ^ (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
  6904
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  6905
    "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
  6906
    "Modified: / 4.5.1999 / 12:58:31 / cg"
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6907
!
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  6908
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  6909
supportsViewBackgroundPixmap:aForm
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  6910
    "return true, if the device allows the given pixmap as
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  6911
     viewBackground. If false is returned,
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  6912
     drawing is done by (possibly) slower smalltalk code.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  6913
     Sorry - win95 only supports 8x8 masks."
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  6914
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  6915
    isWin95 ifFalse:[
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  6916
	^ true
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  6917
    ].
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  6918
    ^ (aForm width == 8) and:[aForm height == 8]
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  6919
!
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  6920
2908
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  6921
supportsWindowBorder:aNumber
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  6922
    "return true, if this device supports bordered windows.
3109
f29d9b8a978d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3080
diff changeset
  6923
     Right now, some drawing stuff depends on (at least) a border of 1 pixel
2908
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  6924
     to be supported by the device.
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  6925
     ST/X's views are being rewritten to draw the border manually in the
3109
f29d9b8a978d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3080
diff changeset
  6926
     future. (Windows only supports borders 1 and noBorder)"
f29d9b8a978d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3080
diff changeset
  6927
f29d9b8a978d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3080
diff changeset
  6928
    ^ (aNumber ? 0) <= 1
2908
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  6929
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  6930
    "
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  6931
     Display supportsWindowBorder:1 
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  6932
    "
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  6933
!
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  6934
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  6935
usableExtent
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  6936
    "return the usable extent of the display (in pixels).
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  6937
     Normally, the same as extent, but may be smaller, in
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  6938
     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
  6939
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6940
    ^ (self getSystemMetrics:#fullScreenWindowWidth)
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  6941
      @
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6942
      (self getSystemMetrics:#fullScreenWindowHeight)
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6943
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6944
    "
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6945
     Display usableExtent
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6946
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6947
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6948
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6949
!WinWorkstation methodsFor:'bitmap/window creation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6950
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6951
addMenuItemWithLabel:aString toWindowID:aWindowId
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6952
    "not yet"
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6953
%{
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6954
#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
  6955
    if (__isExternalAddress(aWindowId)) {
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6956
	HWND hWin = _HWNDVal(aWindowId);
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6957
	HMENU hMenu;
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6958
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6959
	hMenu = GetMenu(hWin);
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6960
	if (hMenu) {
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6961
        
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6962
	}
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6963
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6964
#endif
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6965
%}
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6966
!
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  6967
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6968
createBitmapFromArray:anArray width:w height:h
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6969
    |bitmapId|
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
    bitmapId := self primCreateBitmapFromArray:anArray width:w height:h.
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  6972
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6973
    bitmapId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6974
	'WINWORKSTATION: cannot create bitmap' errorPrintCR.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6975
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6976
    ^ bitmapId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6977
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6978
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6979
createBitmapWidth:w height:h
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6980
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  6981
%{
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  6982
    HANDLE newBitmapHandle;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  6983
    int b_width, b_height;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  6984
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  6985
    if (__bothSmallInteger(w, h)) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  6986
	b_width = __intVal(w);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  6987
	b_height = __intVal(h);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  6988
	newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, NULL);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  6989
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6990
	if (newBitmapHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6991
#ifdef COUNT_BMP_RESOURCES
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6992
	    __cnt_bitmap++;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  6993
	    RES_BMP_PRINTF(("CreateBitmap %x %d\n",newBitmapHandle, __cnt_bitmap));
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  6994
#endif
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  6995
	    RETURN ( __MKOBJ(newBitmapHandle));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6996
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  6997
	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6998
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6999
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7000
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7001
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7002
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7003
createPixmapWidth:w height:h depth:d
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7004
    "allocate a pixmap on the Xserver, the contents is undefined
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7005
     (i.e. random). Return a bitmap id or nil"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7006
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7007
%{
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7008
    HANDLE newBitmapHandle;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7009
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7010
    /*printf("CreateBitmap Color\n");*/
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7011
    if (__bothSmallInteger(w, h) && __isSmallInteger(d) && ISCONNECTED) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7012
	if (__intVal(d) == 1) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7013
	    newBitmapHandle = CreateBitmap(__intVal(w), __intVal(h) , 1, 1, NULL);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7014
	} else {
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  7015
#if 0
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7016
	    if (__intVal(d) != __depth) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7017
		printf("invalid depth\n");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7018
		RETURN (nil);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7019
	    } 
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7020
#endif
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7021
	    newBitmapHandle = CreateCompatibleBitmap(__rootDC, __intVal(w), __intVal(h) );
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7022
	}
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7023
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7024
	if (newBitmapHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7025
#ifdef COUNT_BMP_RESOURCES
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7026
	    __cnt_bitmap++;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7027
	    RES_BMP_PRINTF(("CreatePixmap %x %d\n",newBitmapHandle, __cnt_bitmap));
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7028
#endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7029
	    RETURN ( __MKOBJ(newBitmapHandle));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7030
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7031
	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7032
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7033
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7034
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7035
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7036
1467
9629ce710c53 added type argument to createWindowFor - prepare for native window support (windows)
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  7037
createWindowFor:aView type:typeSymbol
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7038
		 origin:origin
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7039
		 extent:extent
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7040
		 minExtent:minExt
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7041
		 maxExtent:maxExt
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7042
		 borderWidth:bWidth
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7043
		 subViewOf:wsuperView
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7044
		 style:wStyle
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7045
		 inputOnly:winputOnly
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7046
		 label:wlabel
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7047
		 owner:wowner
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7048
		 icon:wicon
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7049
		 iconMask:wiconMask
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7050
		 iconView:wiconView
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7051
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7052
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7053
    |xpos ypos wwidth wheight minWidth minHeight maxWidth maxHeight
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7054
     wsuperViewId wiconId wiconMaskId windowId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7055
     weventMask wiconHeight
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7056
     wiconWidth windowType windowClass moreArgs|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7057
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7058
    "/ bColorId wiconViewId bitGravity vBgColor vBgForm deepForm
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7059
    "/  preferredVisual preferredDepth  viewGravity wcursorId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7060
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7061
    displayId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7062
	self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7063
	^ nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7064
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7065
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7066
    origin notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7067
	xpos := origin x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7068
	ypos := origin y.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7069
    ] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7070
	xpos := ypos := 0.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7071
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7072
    extent notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7073
	wwidth := extent x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7074
	wheight := extent y.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7075
    ] ifFalse:[
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7076
	wwidth := 100.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7077
	wheight := 40.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7078
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7079
    minExt notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7080
	minWidth := minExt x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7081
	minHeight := minExt y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7082
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7083
    maxExt notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7084
	maxWidth := maxExt x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7085
	maxHeight := maxExt y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7086
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7087
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7088
    wsuperView notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7089
	wsuperViewId := wsuperView id
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7090
    ].
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
    wicon notNil ifTrue:[
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7093
	wiconId := wicon id.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7094
	wiconHeight := wicon height.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7095
	wiconWidth  := wicon width.
1418
d21112d621a1 prepared for iconMasks
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  7096
	wiconMask notNil ifTrue:[
d21112d621a1 prepared for iconMasks
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  7097
	    wiconMaskId := wiconMask id
d21112d621a1 prepared for iconMasks
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  7098
	]
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7099
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7100
"/    wiconView notNil ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7101
"/        wiconViewId := wiconView id
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7102
"/    ].
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7103
    weventMask := aView eventMask.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7104
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7105
    NativeWindows ifTrue:[
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7106
	windowType := aView nativeWindowType.
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7107
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7108
	"/ if it is already a string, take it as it is;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7109
	"/ otherwise, it must be a symbol and is used
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7110
	"/ as a key into the nativeClass translation map.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7111
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7112
	windowType isString ifTrue:[
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7113
	    windowClass := windowType
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7114
	] ifFalse:[
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7115
	    windowClass := NativeWindowClassTable at:windowType ifAbsent:nil
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7116
	]
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7117
    ].
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7118
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7119
    moreArgs := Array new:20.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7120
    moreArgs at:1 put:xpos.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7121
    moreArgs at:2 put:ypos.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7122
    moreArgs at:3 put:wwidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7123
    moreArgs at:4 put:wheight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7124
    moreArgs at:5 put:minWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7125
    moreArgs at:6 put:minHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7126
    moreArgs at:7 put:maxWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7127
    moreArgs at:8 put:maxHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7128
    moreArgs at:9 put:wsuperViewId.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7129
    moreArgs at:10 put:nil. "/ wcursorId.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7130
    moreArgs at:11 put:wiconId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7131
    moreArgs at:12 put:wiconMaskId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7132
    moreArgs at:13 put:wiconWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7133
    moreArgs at:14 put:wiconHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7134
    moreArgs at:15 put:windowType.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7135
    moreArgs at:16 put:windowClass.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7136
    moreArgs at:17 put:weventMask.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7137
    moreArgs at:18 put:(aView className asString).
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7138
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7139
    [
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7140
      windowId := self
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7141
		  primCreateWindowFor:aView
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7142
		  type:typeSymbol
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7143
		  borderWidth:bWidth
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7144
		  subViewOf:wsuperView
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7145
		  style:wStyle
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7146
		  inputOnly:winputOnly
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7147
		  label:wlabel
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7148
		  owner:wowner
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7149
		  icon:wicon
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7150
		  iconMask:wiconMask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7151
		  moreArgs:moreArgs.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7152
      aView setId:windowId.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7153
    ] valueUninterruptably.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7154
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7155
    windowId notNil ifTrue:[self addKnownView:aView withId:windowId].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7156
    ^ windowId
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
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7159
destroyGC:aGCId
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7160
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7161
    if (__isExternalAddress(aGCId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7162
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7163
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7164
	if (gcData == NULL) {
3126
5447d8c1d8d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3119
diff changeset
  7165
	    fprintf(stderr, "WinWorkstation [info]: oops - destroying GC twice\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7166
	    RETURN(self);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7167
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7168
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7169
#ifdef COUNT_RESOURCES
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7170
	 __cnt_gcData--;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7171
	RESPRINTF(("DestroyGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7172
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7173
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7174
#ifdef CACHE_LAST_DC
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7175
	if (lastGcData == gcData) {
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  7176
	    _releaseDC(gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7177
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7178
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7179
	__ExternalAddressInstPtr(aGCId)->e_address = NULL;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  7180
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  7181
	freeGcData(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7182
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7183
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7184
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7185
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7186
destroyPixmap:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7187
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7188
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7189
    if (__isExternalAddress(aDrawableId) && ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7190
	HANDLE bitmapHandle = _HANDLEVal(aDrawableId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7191
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7192
	if (bitmapHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7193
#ifdef COUNT_BMP_RESOURCES
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7194
	    __cnt_bitmap--;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7195
	    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
  7196
#endif
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7197
	    _DeleteObject(bitmapHandle, __LINE__);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7198
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7199
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7200
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7201
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7202
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7203
destroyView:aView withId:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7204
    self primDestroyView:aView withId:aWindowId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7205
    self removeKnownView:aView withId:aWindowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7206
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7207
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7208
gcFor:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7209
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7210
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7211
    HWND hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7212
    struct gcData *gcData;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7213
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7214
    if (__isExternalAddress(aDrawableId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7215
	hWnd = _HWNDVal(aDrawableId);
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7216
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7217
	if (! hWnd) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7218
	    RETURN (nil);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7219
	}
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7220
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7221
	gcData = newGcData();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7222
	if (! gcData) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7223
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7224
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7225
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7226
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7227
	__cnt_gcData++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7228
	RESPRINTF(("CreateGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7229
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7230
	gcData->hWnd = hWnd;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7231
	gcData->_hDC = 0;
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7232
	CPRINTF(("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
  7233
	RETURN ( __MKOBJ(gcData) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7234
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7235
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7236
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7237
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7238
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7239
gcForBitmap:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7240
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7241
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7242
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7243
    if (__isExternalAddress(aDrawableId)) {  /* HBITMAP */
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7244
	struct gcData *gcData;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7245
	BITMAP bitmap;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7246
	HBITMAP hBitmap = _HBITMAPVAL(aDrawableId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7247
	HDC hDC;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7248
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7249
	if (! hBitmap) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7250
	    RETURN (nil);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7251
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7252
	gcData = newGcData();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7253
	if (! gcData) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7254
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7255
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7256
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7257
	if (GetObject(hBitmap, sizeof(bitmap), &bitmap)) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7258
	    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
  7259
	} else {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7260
	    DPRINTF(("noinfo returned\n"));
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7261
	    /* mhmh - can this happen ? */
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7262
	    bitmap.bmBitsPixel = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7263
	}
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  7264
	gcData->hBitmap = hBitmap;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7265
	gcData->bitmapColorBitCount = bitmap.bmBitsPixel;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7266
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7267
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7268
	__cnt_gcData++;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7269
	RESPRINTF(("CreateGcData %d\n", __cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7270
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7271
	RETURN ( __MKOBJ(gcData) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7272
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7273
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7274
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7275
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7276
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7277
primCreateBitmapFromArray:anArray width:w height:h
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7278
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7279
%{ 
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7280
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7281
    HBITMAP newBitmapHandle;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7282
    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
  7283
    int row, col;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7284
    unsigned char *cp, *bPits;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7285
    unsigned char *b_bits = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7286
    int index;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7287
    OBJ num;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7288
    unsigned char *allocatedBits = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7289
    unsigned char fastBits[10000];
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7290
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7291
    if (__bothSmallInteger(w, h)
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7292
     && _isNonNilObject(anArray)) {
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7293
	OBJ cls = __qClass(anArray);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7294
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7295
	b_width = __intVal(w);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7296
	b_height = __intVal(h);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7297
	bytesPerRowST = (b_width + 7) / 8;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7298
	bytesPerRowWN = ((b_width + 15) / 16) * 2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7299
	padding = bytesPerRowWN - bytesPerRowST;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7300
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7301
	if ((padding == 0) && (cls == @global(ByteArray))) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7302
	    b_bits = __ByteArrayInstPtr(anArray)->ba_element;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7303
	    cp = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7304
	} else {
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7305
	    int nBytes = b_height * bytesPerRowWN;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7306
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7307
	    if (nBytes < sizeof(fastBits)) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7308
		cp = b_bits = fastBits;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7309
	    } else {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7310
		cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7311
		if (! cp) goto fail;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7312
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7313
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7314
	if (cp) {
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7315
	    if (cls == @global(Array)) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7316
		OBJ *op;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7317
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7318
		index = 1;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7319
		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
  7320
		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
  7321
		    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
  7322
			num = *op++;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7323
			if (! __isSmallInteger(num))
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7324
			    goto fail;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7325
			*cp++ = __intVal(num);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7326
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7327
		    cp += padding;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7328
		}
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7329
	    } else if (cls == @global(ByteArray)) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7330
		unsigned char *pBits;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7331
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7332
		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
  7333
		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
  7334
		    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
  7335
			*cp++ = ( *pBits++ /*^ 0xFF*/ );
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7336
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7337
		    cp += padding;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7338
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7339
	    } else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7340
		goto fail;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7341
	    }
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7342
	}
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7343
	CPRINTF(("create bitmap ...\n"));
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7344
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7345
	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
  7346
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7347
	if (newBitmapHandle ) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7348
#ifdef COUNT_BMP_RESOURCES
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7349
	    __cnt_bitmap++;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7350
	    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
  7351
#endif
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7352
	    DDPRINTF(("returning bitmap %x ...\n", newBitmapHandle));
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7353
	    if (allocatedBits) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7354
		free(allocatedBits);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7355
	    }
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7356
	    RETURN ( __MKOBJ(newBitmapHandle));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7357
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7358
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7359
fail: ;
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7360
    DDPRINTF(("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
  7361
    if (allocatedBits) {
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7362
	CPRINTF(("freeing up bitmap bits ...\n"));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7363
	free(allocatedBits);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7364
    }
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7365
    CPRINTF(("returning nil ...\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7366
    RETURN ( nil );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7367
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7368
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7369
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7370
primCreateWindowFor:aView type:aSymbol
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7371
	  borderWidth:bWidth subViewOf:wsuperView
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7372
	  style:wStyle inputOnly:winputOnly
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7373
	  label:wlabel owner:wowner
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7374
	  icon:wicon iconMask:wiconMask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7375
	  moreArgs:moreArgs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7376
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7377
%{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7378
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7379
    WNDCLASS wc;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7380
    long bg, bd, bw;
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  7381
    int winStyleBits, winEXStyleBits;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7382
    int w, h, x, y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7383
    int min_width, min_height;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7384
    int max_width, max_height;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7385
    OBJ eventMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7386
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7387
    HANDLE parentHandle;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7388
    HWND newWindowHandle;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7389
    OBJ xpos, ypos, wwidth, wheight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7390
    OBJ minWidth, minHeight, maxWidth, maxHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7391
    OBJ wsuperViewId, wcursorId, wiconId, wiconMaskId;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7392
    OBJ wiconWidth, wiconHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7393
    OBJ windowType, windowClass, windowId;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7394
    OBJ stClassName;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7395
    int isTopWindow = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7396
    localWindowInfo *lI;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7397
    static createWindowInfo cwi;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7398
    static nextSequenceNr = 1;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7399
    unsigned char* cp;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7400
    HBITMAP        xBitMap, maskBitmap;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7401
    HICON          xIcon = (HICON)0;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7402
    ICONINFO       iconInfo;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7403
    char *className;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7404
    char nameBuffer[256];
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7405
    unsigned char fastBits[10000];
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7406
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7407
    xpos = __ArrayInstPtr(moreArgs)->a_element[0];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7408
    ypos = __ArrayInstPtr(moreArgs)->a_element[1];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7409
    wwidth = __ArrayInstPtr(moreArgs)->a_element[2];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7410
    wheight = __ArrayInstPtr(moreArgs)->a_element[3];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7411
    minWidth = __ArrayInstPtr(moreArgs)->a_element[4];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7412
    minHeight = __ArrayInstPtr(moreArgs)->a_element[5];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7413
    maxWidth = __ArrayInstPtr(moreArgs)->a_element[6];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7414
    maxHeight = __ArrayInstPtr(moreArgs)->a_element[7];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7415
    wsuperViewId = __ArrayInstPtr(moreArgs)->a_element[8];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7416
    wcursorId = __ArrayInstPtr(moreArgs)->a_element[9];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7417
    wiconId = __ArrayInstPtr(moreArgs)->a_element[10];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7418
    wiconMaskId = __ArrayInstPtr(moreArgs)->a_element[11];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7419
    wiconWidth = __ArrayInstPtr(moreArgs)->a_element[12];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7420
    wiconHeight = __ArrayInstPtr(moreArgs)->a_element[13];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7421
    windowType = __ArrayInstPtr(moreArgs)->a_element[14];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7422
    windowClass = __ArrayInstPtr(moreArgs)->a_element[15];
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7423
    eventMask = __ArrayInstPtr(moreArgs)->a_element[16];
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7424
    stClassName = __ArrayInstPtr(moreArgs)->a_element[17];
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7425
    bg = WhitePixel;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7426
    bd = BlackPixel;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7427
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7428
    /* get bitmap for icon */
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7429
    if ( __isExternalAddress(wiconId) ) {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7430
	xBitMap = _HBITMAPVAL( wiconId );
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7431
	if ( xBitMap != 0 ) {
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  7432
	    BITMAP bm;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  7433
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  7434
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  7435
		int d = bm.bmPlanes * bm.bmBitsPixel;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  7436
		BYTE *ep;
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7437
		int height, width;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7438
		int nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7439
		unsigned char *allocatedBits = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7440
		int privateMask = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7441
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7442
		if ( __isExternalAddress(wiconMaskId) ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7443
		    maskBitmap = _HBITMAPVAL( wiconMaskId );
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7444
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7445
		    if (wiconMaskId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7446
			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
  7447
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7448
		    maskBitmap = 0;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7449
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7450
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7451
		/*
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7452
		 * if there is no mask, generate one
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7453
		 */
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7454
		if (maskBitmap == 0) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7455
		    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
  7456
		    height = __intVal( wiconHeight );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7457
		    width  = __intVal( wiconWidth  );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7458
		    nBytes = ( width + 15 ) / 8;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7459
		    nBytes = height * nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7460
		    if (nBytes < sizeof(fastBits)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7461
			ep = fastBits;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7462
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7463
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7464
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7465
		    if ( ep == 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7466
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7467
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7468
			memset(ep, 0, nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7469
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7470
			if ( maskBitmap == NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7471
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7472
			} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7473
			    privateMask = 1;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7474
			}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7475
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7476
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7477
		if ( maskBitmap != NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7478
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7479
		    iconInfo.fIcon = TRUE;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7480
		    iconInfo.hbmMask  = maskBitmap;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7481
		    iconInfo.hbmColor = xBitMap;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7482
		    xIcon = CreateIconIndirect( &iconInfo );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7483
		    if (privateMask) {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  7484
			_DeleteObject( maskBitmap, __LINE__ );
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  7485
		    }
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  7486
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7487
		    PRINTF(( "WinWorkstat [warning]: no mask for icon !\n" ));
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  7488
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7489
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7490
		if (allocatedBits) {
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  7491
		    free(allocatedBits);
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7492
		}
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  7493
	    }
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7494
	} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7495
	    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
  7496
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7497
    } else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7498
	if (wiconId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  7499
	    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
  7500
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7501
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7502
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7503
    if (__bothSmallInteger(wwidth, wheight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7504
	w = __intVal(wwidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7505
	h = __intVal(wheight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7506
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7507
	w = h = 100;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7508
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7509
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7510
    if (__bothSmallInteger(xpos, ypos)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7511
	x = __intVal(xpos);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7512
	y = __intVal(ypos);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7513
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7514
	x = y = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7515
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7516
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7517
    if (__bothSmallInteger(minWidth, minHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7518
	min_width = __intVal(minWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7519
	min_height = __intVal(minHeight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7520
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7521
	min_width = min_height = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7522
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7523
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7524
    if (__bothSmallInteger(maxWidth, maxHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7525
	max_width = __intVal(maxWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7526
	max_height = __intVal(maxHeight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7527
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7528
	max_width = max_height = 10000;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7529
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7530
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  7531
    winStyleBits = winEXStyleBits = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7532
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7533
    if (__isSmallInteger(bWidth)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7534
	bw = __intVal(bWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7535
	if (bw) {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7536
	    winStyleBits |= WS_BORDER;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7537
	    bw = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7538
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7539
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7540
	bw = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7541
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7542
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7543
    className = app_name;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7544
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  7545
#if 1
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7546
    if (__isString(windowClass)) {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7547
	className = __stringVal(windowClass);
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7548
    }
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7549
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7550
    if (__isString(windowClass)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7551
	if (__isInteger(wStyle)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7552
	    winStyleBits |= __longIntVal(wStyle);
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7553
	} else {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7554
	    if (windowType == @symbol(RadioButton)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7555
		winStyleBits |= BS_RADIOBUTTON;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7556
	    } else if (windowType == @symbol(CheckBox)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7557
		winStyleBits |= BS_CHECKBOX;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7558
	    } else if (windowType == @symbol(HorizontalScrollbar)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7559
		winStyleBits |= SBS_HORZ;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7560
	    } else if (windowType == @symbol(VerticalScrollBar)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7561
		winStyleBits |= SBS_VERT;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7562
	    }
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7563
	}
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7564
    }
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  7565
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7566
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7567
    if (__isExternalAddress(wsuperViewId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7568
	/*
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7569
	 * a child window
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7570
	 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7571
	parentHandle = _HANDLEVal(wsuperViewId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7572
	winStyleBits |= WS_CHILD;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7573
	if (winputOnly != true) {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7574
	    winStyleBits |= (WS_CLIPSIBLINGS|WS_CLIPCHILDREN);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7575
	    /*winStyleBits |= WS_CLIPCHILDREN;*/
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7576
	    DPRINTF(("parent handle=%x\n", parentHandle));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7577
	} else {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7578
	    winEXStyleBits |= WS_EX_TRANSPARENT;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7579
	    DPRINTF(("inputview parent handle=%x\n", parentHandle));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7580
	}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7581
#if 0
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7582
	winEXStyleBits |= WS_EX_NOPARENTNOTIFY;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7583
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7584
    } else {
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7585
	/*
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7586
	 * a top window (regular / popUp or dialog)
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7587
	 */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7588
	parentHandle = NULL;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7589
	isTopWindow = 1;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7590
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  7591
#ifdef TOPWINDOWCLASS
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7592
	{
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7593
	    this could fail, since a pointer to local buf is passed
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7594
	    to the window-creation code (in the other thread ...)
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7595
        
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7596
	    static winCount = 1;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7597
	    char buf[300];
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7598
	    char *stName;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7599
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7600
# ifdef __BORLANDC__
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7601
	    struct timeb timebuffer;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7602
	    ftime(&timebuffer);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7603
# else
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7604
	    struct _timeb timebuffer;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7605
	    _ftime(&timebuffer);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7606
# endif
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7607
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7608
	    if (__isString(stClassName)) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7609
		stName = __stringVal(stClassName);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7610
	    } else {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7611
		stName = app_name;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7612
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7613
	    sprintf(buf, "S%d.%d%s", HIWORD(timebuffer.time), ++winCount, stName);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7614
	    DPRINTF(("topview - registerClass:%s\n",buf));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7615
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7616
	    wc.style = /* CS_HREDRAW | CS_VREDRAW | CS_OWNDC  |*/ CS_DBLCLKS;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7617
	    wc.lpfnWndProc = (WNDPROC) MainWndProc;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7618
	    wc.cbClsExtra = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7619
	    wc.cbWndExtra = N_WINDOW_PRIVATE;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7620
	    wc.hInstance = (HANDLE) __getHInstance();
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7621
	    if (xIcon) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7622
		wc.hIcon   = xIcon;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7623
		/* wc.hIconSm = wiconId; In 4.x there are large and small icons */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7624
	    } else {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7625
		wc.hIcon = NULL;        /* THIS MUST BE NULL TO DELETE ICONS */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7626
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7627
	    wc.hCursor = 0 /* LoadCursor(NULL, IDC_ARROW) */;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7628
	    wc.hbrBackground = 0; /*CreateSolidBrush (bg);*/
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7629
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7630
	    wc.lpszMenuName =  NULL;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7631
	    wc.lpszClassName = buf;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7632
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7633
	    if (!RegisterClass(&wc)) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7634
		PRINTF(("RegisterClass failed\n"));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7635
		RETURN( nil );
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7636
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7637
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7638
	    className = buf;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7639
	}
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7640
#endif
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7641
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7642
	if (wStyle == @symbol(popUp)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7643
	    winStyleBits |= WS_POPUP;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  7644
	    winStyleBits |= WS_DISABLED;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7645
	    winEXStyleBits |= WS_EX_TOOLWINDOW;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  7646
	    CPRINTF(("Create popUpWindow\n"));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7647
#if 0
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7648
	    parentHandle = GetActiveWindow();
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7649
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7650
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7651
	} else if (wStyle == @symbol(dialog)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7652
/*
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7653
	    winStyleBits |= WS_OVERLAPPED | WS_CAPTION | WS_THICKFRAME;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7654
*/
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7655
	    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
  7656
	    winStyleBits |= WS_POPUP;
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7657
	    winStyleBits |= DS_NOIDLEMSG;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7658
	    //winEXStyleBits |= WS_EX_TOOLWINDOW;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7659
	    if ((min_width || min_height)
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7660
	     && (min_width == max_width)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7661
	     && (min_height == max_height)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7662
		winStyleBits &= ~WS_THICKFRAME;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7663
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7664
	} else {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  7665
	    //winStyleBits |= WS_OVERLAPPEDWINDOW;
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  7666
	    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
  7667
	    //winEXStyleBits |= WS_EX_CLIENTEDGE;
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  7668
	    winEXStyleBits |= WS_EX_WINDOWEDGE;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  7669
	    //winEXStyleBits |= WS_EX_ACCEPTFILES;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7670
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7671
	winStyleBits |= WS_CLIPCHILDREN;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7672
    }
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  7673
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7674
    rec.left = x;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7675
    rec.top = y;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7676
    rec.right = x + w;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7677
    rec.bottom = y+ h;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7678
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7679
    /* use static memory for the createwindowInfo;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7680
     * this is required, since we cannot pass the address of a local struct,
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7681
     * due to the possibility of late eventProcessing (after the method is left)
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7682
     * when in a sizeMove-loop.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7683
     * (in this case, the message remains in the evQ, but is processed
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7684
     *  early via the pending- mechanism)
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7685
     * in order to detect such an alrady processed message, a sequenceNumber
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7686
     * is passed with the message and also stored in the cwi.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7687
     * If this sequence number differes, we got a late message.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7688
     */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7689
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7690
    /*
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7691
     * check if previous request has been properly processed ...
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7692
     */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7693
    if (cwi.sequenceNr && (cwi.sequenceNr != INVALIDATED_CWI)) {
3126
5447d8c1d8d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3119
diff changeset
  7694
	fprintf(stderr, "WinWorkstation [info]: oops - unprocessed createWindow still pending\n");
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7695
	/* this prevents the event processor from interpreting this message */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7696
	cwi.sequenceNr = nextSequenceNr;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7697
    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7698
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7699
    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
  7700
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7701
#ifdef ADJUSTWINDOW
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7702
    AdjustWindowRectEx(&rec, winStyleBits, 0, cwi.winStyleBitsEx);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7703
    w = rec.right - rec.left;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7704
    h = rec.bottom - rec.top;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7705
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7706
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7707
    DPRINTF(("create%s pos==%d/%d size=%d/%d bw=%d parent %x class='%s'...\n",
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7708
		((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
  7709
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7710
    /* allocate localMemory for Window */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7711
    lI = (localWindowInfo *) malloc(sizeof(localWindowInfo));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7712
    if (! lI) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7713
	fprintf(stderr, "WinWorkstation [error]: malloc failed in CreateWindow\n");
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7714
	RETURN ( nil );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7715
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7716
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7717
    memset(lI, 0, sizeof(localWindowInfo));
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  7718
    lI->mouseX = lI->mouseY = -9999;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  7719
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7720
    if (isTopWindow) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7721
	if (rec.left < 0) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7722
	    rec.left = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7723
	    rec.right = w;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7724
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7725
	if (rec.top < 0) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7726
	    rec.top = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7727
	    rec.bottom = h;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7728
	}
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7729
	lI->flag = LI_TOPWIN;
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  7730
    } else {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7731
	if (bw) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7732
	    // adjust for border
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7733
	    rec.left++;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7734
	    rec.top++;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7735
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7736
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7737
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  7738
    if (winputOnly == true) {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7739
	lI->flag |= LI_INPUTWIN;
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  7740
    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7741
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  7742
#if 0
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  7743
    /*
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  7744
     * this leads to leftOver pixel-garbage (views)
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  7745
     * under win95 ...
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  7746
     */
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  7747
    if (winStyleBits & WS_POPUP) 
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  7748
#else
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  7749
    if (wStyle == @symbol(popUp))
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  7750
#endif
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  7751
    {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7752
	cwi.className = app_namePopup;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7753
    } else {
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  7754
	if (wStyle == @symbol(dialog)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  7755
	    cwi.className = app_nameDialog;
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  7756
	} else {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  7757
	    cwi.className = className;
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  7758
	}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7759
    }
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  7760
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7761
    cwi.winStyleBits = winStyleBits;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7762
    cwi.parentHandle = parentHandle;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7763
    cwi.x = rec.left;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7764
    cwi.y = rec.top;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7765
    cwi.dx = rec.right - rec.left;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7766
    cwi.dy = rec.bottom - rec.top;
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7767
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7768
    if (isTopWindow) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7769
	rec.left = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7770
	rec.top = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7771
	rec.right = min_width;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7772
	rec.bottom = min_height;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7773
#ifdef ADJUSTWINDOW
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7774
	AdjustWindowRectEx(&rec, winStyleBits, 0, cwi.winStyleBitsEx);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7775
#endif
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7776
	lI->minWidth = rec.right - rec.left;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7777
	lI->minHeight = rec.bottom - rec.top;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7778
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7779
	rec.left = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7780
	rec.top = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7781
	rec.right = max_width;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7782
	rec.bottom = max_height;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7783
#ifdef ADJUSTWINDOW
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7784
	AdjustWindowRectEx(&rec, winStyleBits, 0, cwi.winStyleBitsEx);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7785
#endif
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7786
	lI->maxWidth = rec.right - rec.left;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7787
	lI->maxHeight = rec.bottom - rec.top;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7788
    } else {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7789
	lI->minWidth = lI->minHeight = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7790
	lI->maxWidth = lI->maxHeight = 9999;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7791
    }
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  7792
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  7793
    lI->viewBgBrush = __whiteBrush;
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  7794
    lI->viewBgColor = WhitePixel;
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  7795
    lI->bdColor = BlackPixel;
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  7796
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7797
    if (__isSmallInteger(eventMask))
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7798
	lI->eventMask = __intVal(eventMask);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7799
    else
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7800
	lI->eventMask = 0xffffffff;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7801
    DPRINTF(("eventMask is %x\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7802
#ifdef DEBUGMASK1
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7803
    printMask(lI->eventMask);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7804
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7805
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7806
    lI->bw = bw;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7807
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7808
    cwi.newWinHandle = newWindowHandle = NULL;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7809
    cwi.windowName = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7810
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7811
    if (isTopWindow) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7812
	if (__isString(wlabel) || __isSymbol(wlabel)) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7813
	    strcpy(nameBuffer, (char *) __stringVal(wlabel));
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7814
	    cwi.windowName = nameBuffer;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7815
	    DPRINTF(("title = %s\n", cwi.windowName));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7816
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7817
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7818
2665
4b88034ccb36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2664
diff changeset
  7819
    cwi.infoWasRead = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7820
    cwi.localWindowInfo = lI;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7821
    cwi.sequenceNr = nextSequenceNr;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7822
    nextSequenceNr = (nextSequenceNr + 1) & 0x7FFF;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7823
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7824
#ifndef NEW_CREATE_EVENT 
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7825
    cwi.hCreateEvent = hCreateEvent;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7826
    ResetEvent(cwi.hCreateEvent);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7827
#else
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7828
    /* creating a new event does not work - why ? */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7829
    cwi.hCreateEvent = CreateEvent(
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7830
	NULL,        /* no security attributes */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7831
	FALSE,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7832
	FALSE,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7833
	NULL);       /* name of mutex */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7834
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7835
    if (cwi.hCreateEvent == NULL) {
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  7836
	fprintf(stderr, "WinWorkstation [error]: oops - CreateEvent failed in CreateWindow: %d\n", GetLastError() );
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7837
	cwi.sequenceNr = INVALIDATED_CWI;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7838
	RETURN ( nil );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7839
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7840
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7841
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7842
    /*
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7843
     * kludge to allow for createWindow while in sizeMove processing loop
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7844
     */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7845
    if (pendingCREATEWINDOWInfo) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7846
	fprintf(stderr, "WinWorkstation [error]: oops - pending create\n");
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7847
    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7848
    pendingCREATEWINDOWInfo = &cwi;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7849
    pendingSequenceNr = cwi.sequenceNr;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7850
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7851
    if (PostThreadMessage(_dispatchThreadId, WM_THREAD_CREATEWINDOW, cwi.sequenceNr, (INT)(&cwi)) == FALSE) {
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  7852
	fprintf(stderr, "WinWorkstation [error]: oops - PostThreadMessage failed in CreateWindow: %d\n", GetLastError() );
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7853
	free(lI);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7854
	RETURN (nil);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7855
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7856
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7857
    if (cwi.newWinHandle != NULL) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7858
	cwi.sequenceNr = INVALIDATED_CWI;
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  7859
	cwi.hCreateEvent = NULL;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7860
	/* wow - that was quick ... */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7861
    } else {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7862
	DWORD dwWaitResult;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7863
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7864
	/* wait for the window to be created ... */
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  7865
	dwWaitResult = WaitForSingleObject(hCreateEvent, 1000L);
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7866
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7867
	/* no longer want to get informed ... */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7868
	cwi.hCreateEvent = NULL;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7869
	cwi.sequenceNr = INVALIDATED_CWI;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7870
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7871
	switch (dwWaitResult) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7872
	    // The thread got mutex ownership.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7873
	    case WAIT_OBJECT_0:
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7874
		break;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7875
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7876
	    // Cannot get mutex ownership due to time-out.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7877
	    case WAIT_TIMEOUT:
3470
04010359ddbe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3469
diff changeset
  7878
		DEBUGPRINT((stderr, "WinWorkstation [error]: oops - timeout in CreateWindow\n"));
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7879
		break;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7880
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7881
	    // Got ownership of the abandoned mutex object.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7882
	    default:
3470
04010359ddbe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3469
diff changeset
  7883
		DEBUGPRINT((stderr, "WinWorkstation [warning]: CreateEvent abandoned\n"));
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7884
		break;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7885
	}
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7886
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7887
#ifdef NEW_CREATE_EVENT
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7888
	CloseHandle(cwi.hCreateEvent);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7889
#endif
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7890
    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7891
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7892
    pendingCREATEWINDOWInfo = 0;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7893
    newWindowHandle = cwi.newWinHandle;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7894
    DPRINTF(("handle = %x\n", newWindowHandle));
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7895
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7896
    if (! newWindowHandle) {
3810
70cda330d80a *** empty log message ***
penk
parents: 3809
diff changeset
  7897
	fprintf(stderr, "WinWorkstation [error]: CreateWindow failed: %d\n", GetLastError() );
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  7898
	if (cwi.infoWasRead) {
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  7899
	    free(lI);
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  7900
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7901
	RETURN ( nil );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7902
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7903
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  7904
#ifdef CACHE_LAST_DC
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  7905
    if (lastGcData && (lastGcHWIN == newWindowHandle)) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  7906
	_releaseDC(lastGcData);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  7907
    }
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  7908
#endif
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  7909
#ifdef CACHE_LAST_WM_PAINT_DC
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  7910
    if (last_wm_paint_dc && (last_wm_paint_win == newWindowHandle)) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  7911
	ReleaseDC(newWindowHandle, last_wm_paint_dc);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  7912
	last_wm_paint_win = last_wm_paint_dc = 0;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  7913
    }
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  7914
#endif
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  7915
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7916
    windowId = __MKOBJ(newWindowHandle);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7917
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7918
    if (1 /* isTopWindow */) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7919
	/*
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7920
	 * mhmh - what is that raise for ?
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7921
	 */
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7922
	SetWindowPos(newWindowHandle, HWND_TOP, 0, 0, 0, 0, 
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7923
		     SWP_NOSENDCHANGING |
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7924
		     SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7925
    }
2697
0fbd675cf5b2 update region processing
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
  7926
    if (isTopWindow) {
0fbd675cf5b2 update region processing
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
  7927
	BringWindowToTop(newWindowHandle);
0fbd675cf5b2 update region processing
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
  7928
    }
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  7929
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  7930
#ifndef TOPWINDOWCLASS
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  7931
    if (xIcon) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7932
	SendMessage(newWindowHandle, WM_SETICON, ICON_SMALL, (LPARAM)xIcon);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  7933
	SendMessage(newWindowHandle, WM_SETICON, ICON_BIG, (LPARAM)xIcon);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  7934
    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  7935
#endif      
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  7936
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7937
    DPRINTF(("done - create\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7938
    RETURN (windowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7939
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7940
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7941
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7942
primDestroyView:aView withId:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7943
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7944
%{  /* NOCONTEXT */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7945
    HICON oldIcon;
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  7946
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7947
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7948
	HWND win = _HWNDVal(aWindowId);
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  7949
        
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  7950
	if (win && IsWindow(win)) {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  7951
#ifndef TOPWINDOWCLASS
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  7952
	    oldIcon = (HICON) GetClassLong(win, GCL_HICON);
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  7953
	    SetClassLong(win, GCL_HICON, (DWORD)0);
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  7954
	    /* It has to be checked whether this can be deleted!!!!! */
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  7955
	    if ( oldIcon ) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7956
		if ( DestroyIcon( oldIcon )) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7957
		    DPRINTF(( "Old icon deleted\n" ));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7958
		} else {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7959
		    fprintf(stderr, "failed to destroy icon\n");
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7960
		}
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  7961
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  7962
#endif
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  7963
	   /*printf("post WM_THREAD_DESTROYWINDOW\n");*/
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  7964
	    PostMessage(win, WM_THREAD_DESTROYWINDOW, 0, 0);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7965
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7966
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7967
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7968
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7969
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7970
rootWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7971
    "return the id of the root window.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7972
     This is the window you see as background,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7973
     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
  7974
     since some window managers install a virtual root window on top
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7975
     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
  7976
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7977
    ^ rootWin
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7978
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7979
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7980
!WinWorkstation methodsFor:'color stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7981
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7982
colorRed:redVal green:greenVal blue:blueVal
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7983
    "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
  7984
     This method is obsoleted by #colorScaledRed:scaledGreen:scaledBlue:"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7985
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7986
    |r g b|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7987
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7988
    r := self percentToDeviceColorValue:redVal.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7989
    g := self percentToDeviceColorValue:greenVal.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7990
    b := self percentToDeviceColorValue:blueVal.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7991
    ^ self colorScaledRed:r scaledGreen:g scaledBlue:b
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7992
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7993
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7994
colorScaledRed:r scaledGreen:g scaledBlue:b
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7995
    "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
  7996
     (i.e. colorID)"
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7997
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  7998
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7999
    int id, ir, ig, ib;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8000
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8001
    if (__bothSmallInteger(r, g) && __isSmallInteger(b)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8002
	id = RGB2st(__intVal(r),__intVal(g),__intVal(b));
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  8003
	CPRINTF(("alloc color %d/%d/%d -> %x\n", ir, ig, ib, id));
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8004
	RETURN ( __MKSMALLINT(id) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8005
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8006
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8007
    self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8008
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8009
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8010
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8011
freeColor:colorIndex
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8012
    "free a display color when its no longer needed.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8013
     A dummy here, since RGB colors are never freed."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8014
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8015
    'free color' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8016
    ^ self
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8017
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8018
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8019
getRGBFrom:index into:aBlock
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8020
    "get rgb components (0..100) of color in map at:index,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8021
     and evaluate the 3-arg block, aBlock with them"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8022
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8023
    |val|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8024
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8025
    self getScaledRGBFrom:index into:[:r :g :b |
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8026
	val := aBlock
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8027
		value:(r * 100.0 / 16rFFFF)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8028
		value:(g * 100.0 / 16rFFFF)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8029
		value:(b * 100.0 / 16rFFFF)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8030
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8031
    'get RGB' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8032
    ^ val
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8033
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8034
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8035
getRGBFromName:colorName into:aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8036
    "get rgb components (0..100) of color named colorName,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8037
     and evaluate the 3-arg block, aBlock with them"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8038
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8039
    |val|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8040
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8041
    self getScaledRGBFromName:colorName into:[:r :g :b |
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8042
	r isNil ifTrue:[^nil].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8043
	val := aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8044
		value:(r * 100.0 / 16rFFFF)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8045
		value:(g * 100.0 / 16rFFFF)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8046
		value:(b * 100.0 / 16rFFFF)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8047
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8048
    ^val
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8049
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8050
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8051
getScaledRGBFrom:index into:aBlock
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8052
    "get rgb components (0 .. 16rFFFF) of color in map at:index,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8053
     and evaluate the 3-arg block, aBlock with them"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8054
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8055
    |r g b|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8056
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8057
    int id = __intVal(index);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8058
    int iR, iG, iB;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8059
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8060
    id = st2RGB(id,0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8061
    iR = id & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8062
    iG = (id >> 8) & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8063
    iB = (id >> 16) & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8064
    iR = (iR << 8) | iR;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8065
    iG = (iG << 8) | iG;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8066
    iB = (iB << 8) | iB;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8067
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8068
    r = __MKSMALLINT(iR);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8069
    g = __MKSMALLINT(iG);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8070
    b = __MKSMALLINT(iB);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8071
    /*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
  8072
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8073
    ^ aBlock value:r value:g value:b
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8074
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8075
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8076
getScaledRGBFromName:colorName into:aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8077
    "get scaled rgb components (0..16rFFFF) of color named colorName,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8078
     and evaluate the 3-arg block, aBlock with them"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8079
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  8080
    |triple r g b found cName|
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8081
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8082
    r := g := b := 0.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8083
    found := false.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8084
    (colorName startsWith:$#) ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8085
	"/ color in r/g/b hex notation
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8086
	r := Integer readFrom:(colorName copyFrom:2 to:3) radix:16.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8087
	g := Integer readFrom:(colorName copyFrom:4 to:5) radix:16.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8088
	b := Integer readFrom:(colorName copyFrom:6 to:7) radix:16.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8089
	found := true.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8090
    ] ifFalse:[
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  8091
	cName := colorName asString.
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  8092
	triple := StandardColorValues at:cName ifAbsent:nil.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8093
	triple isNil ifTrue:[
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  8094
	    "/ try lowercase name
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  8095
	    cName := cName asLowercase.
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  8096
	    triple := StandardColorValues at:cName ifAbsent:nil.
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  8097
	    triple isNil ifTrue:[
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  8098
		"/ try lowercase without intermixed spaces
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  8099
		cName := cName asCollectionOfWords asStringWith:nil.
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  8100
		triple := StandardColorValues at:cName ifAbsent:nil.
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  8101
	    ].
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8102
	].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8103
	triple notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8104
	    r := triple at:1.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8105
	    g := triple at:2.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8106
	    b := triple at:3.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8107
	    found := true.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8108
	].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8109
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8110
    found ifFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8111
	('WinWorkstation: unknown color: ' , colorName) infoPrintCR.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8112
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8113
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8114
    ^ 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
  8115
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8116
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8117
listOfAvailableColors
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8118
    "return a list of all available colornames.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8119
     This should not be used, since colornames are very
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8120
     display-specific (here X-specific)."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8121
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8122
    |aStream list line index colorName|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8123
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8124
    aStream := FileStream readonlyFileNamed:'/usr/lib/X11/rgb.txt'.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8125
    aStream isNil ifTrue:[^ nil].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8126
    list := OrderedCollection new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8127
    [aStream atEnd] whileFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8128
	line := aStream nextLine.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8129
	line notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8130
	    "skip the r/g/b numbers"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8131
	    index := 1.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8132
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8133
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8134
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8135
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8136
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8137
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8138
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8139
	    colorName := line copyFrom:index.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8140
	    ((colorName occurrencesOf:(Character space)) == 0) ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8141
		list add:colorName
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8142
	    ]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8143
	]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8144
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8145
    aStream close.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8146
    ^ list sort
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8147
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8148
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8149
     Screen current listOfAvailableColors
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8150
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8152
    "Modified: 11.9.1996 / 15:26:28 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8153
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8154
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8155
percentToDeviceColorValue:aPercentage
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8156
    "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
  8157
     WIN-component value (0..16rFFFF) as an integer"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8158
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8159
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8160
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8161
    if (__isSmallInteger(aPercentage)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8162
	RETURN ( __MKSMALLINT(0xFFFF * __intVal(aPercentage) / 100) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8163
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8164
    if (__isFloat(aPercentage)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8165
	RETURN ( __MKSMALLINT(0xFFFF * (int)(__floatVal(aPercentage)) / 100) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8166
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8167
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8168
    ^ (16rFFFF * aPercentage / 100) rounded
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8169
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8170
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8171
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
  8172
    "change a palette index.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8173
     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
  8174
     - 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
  8175
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8176
     '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
  8177
     ^ self.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8178
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8179
    "Created: 30.1.1998 / 09:27:48 / md"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8180
    "Modified: 30.1.1998 / 09:30:22 / md"
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
!WinWorkstation methodsFor:'cursor stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8184
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8185
builtInCursorShapes
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8186
    "return a collection of standard cursor names.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8187
     Those are built into Windows and need not be created as
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8188
     user cursors.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8189
     (actually, there are more than those below ...)"
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8190
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8191
    "/ if you add something here, also add to #shapeNumberFromCursor ...
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8192
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8193
    ^ #(
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8194
	#upLeftArrow            "/ IDC_ARROW
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8195
	#upDownArrow            "/ IDC_SIZENS
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8196
	#leftRightArrow         "/ IDC_SIZEWE
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8197
	#text                   "/ IDC_IBEAM
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8198
	#wait                   "/ IDC_WAIT
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8199
	#execute                "/ IDC_APPSTARTING
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8200
	#crossHair              "/ IDC_CROSS
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8201
	#fourWay                "/ IDC_SIZEALL
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8202
	#upRightHand            "/ IDC_ARROW
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8203
	#noDrop                 "/ IDC_NO
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8204
	#stop                   "/ IDC_NO
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8205
       )
3110
0058dbbb19df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3109
diff changeset
  8206
0058dbbb19df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3109
diff changeset
  8207
    "Modified: / 10.12.1999 / 15:16:26 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8208
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8209
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8210
createCursorShape:aShape
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8211
    "create a cursor given a shape-symbol"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8212
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8213
    |number|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8214
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8215
    number := self shapeNumberFromSymbol:aShape.
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8216
    number isNil ifTrue:[^ nil].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8217
    ^ self primCreateCursorShapeNr:number
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8218
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8219
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8220
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
  8221
    "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
  8222
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8223
    |padding bpl bplPadded srcOffs dstOffs
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8224
     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
  8225
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8226
    cW := self getSystemMetrics:#cursorWidth.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8227
    cH := self getSystemMetrics:#cursorHeight.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  8228
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8229
    "/ ('cursorWidth ',cW printString,'cursorHeight ',cH printString) infoPrintCR.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8230
    src := sourceBytes.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8231
    mask := maskBytes.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8232
    padding := self cursorBitmapPadding.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8233
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8234
    "/ repadding and/or resizing required ?
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8235
    bpl := sourceBytes size / h.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8236
    bplPadded := (cW + padding - 1) // padding * 2.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8237
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8238
    bpl ~~ bplPadded ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8239
	 "/     'repad cursor bits' infoPrintCR.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8240
	srcPadded := ByteArray new:(bplPadded * cH).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8241
	nB := bpl min: bplPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8242
	nR := cH min: h.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8243
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8244
	dstOffs := srcOffs := 1.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8245
	1 to:nR do:[:row |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8246
	    srcPadded
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8247
		replaceFrom:dstOffs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8248
		to:(dstOffs+nB-1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8249
		with:src
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8250
		startingAt:srcOffs.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8251
	    dstOffs := dstOffs + bplPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8252
	    srcOffs := srcOffs + bpl.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8253
	].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8254
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8255
	maskPadded := ByteArray new:(bplPadded * cH).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8256
	dstOffs := srcOffs := 1.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8257
	1 to:nR do:[:row |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8258
	    maskPadded
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8259
		replaceFrom:dstOffs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8260
		to:(dstOffs+nB-1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8261
		with:mask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8262
		startingAt:srcOffs.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8263
	    dstOffs := dstOffs + bplPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8264
	    srcOffs := srcOffs + bpl.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8265
	].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8266
	src := srcPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8267
	mask := maskPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8268
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8269
    ].
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8270
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8271
    src invert.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8272
    1 to:src size do:[:index |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8273
	src byteAt:index put:((src byteAt:index) bitAnd:(mask byteAt:index)).
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8274
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8275
    mask invert.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8276
    cursor := self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8277
	primCreateCursorSourceBits:src
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8278
	maskBits:mask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8279
	hotX:hx hotY:hy
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8280
	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
  8281
    cursor notNil ifTrue:[^ cursor ].
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8282
    'WinWorkstation [warning]: could not create bitmap cursor' infoPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8283
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8284
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8285
cursorBitmapPadding
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8286
    ^ 16 "/ windows requires short-padded rows
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8287
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8288
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8289
destroyCursor:aCursorId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8290
    "destroy a cursor"
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8291
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8292
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8293
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8294
    if (ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8295
	if (__isExternalAddress(aCursorId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8296
	    HCURSOR curs = _HCURSORVal(aCursorId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8297
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8298
	    if (curs) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8299
#ifdef KEEP_STD_CURSORS
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8300
		if ((curs != H_C_ARROW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8301
		 && (curs != H_C_CROSS)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8302
		 && (curs != H_C_IBEAM)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8303
		 && (curs != H_C_ICON)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8304
		 && (curs != H_C_NO)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8305
		 && (curs != H_C_SIZE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8306
		 && (curs != H_C_SIZEALL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8307
		 && (curs != H_C_SIZENESW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8308
		 && (curs != H_C_SIZENS)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8309
		 && (curs != H_C_SIZENWSE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8310
		 && (curs != H_C_UPARROW)
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  8311
		 && (curs != H_C_APPSTARTING)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8312
		 && (curs != H_C_WAIT)) 
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8313
#endif /* KEEP_STD_CURSORS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8314
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8315
		    DestroyCursor(curs);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8316
#ifdef COUNT_RESOURCES
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8317
		    __cnt_cur--;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8318
		    RESPRINTF(("DestroyCursor %d\n",__cnt_cur));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8319
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8320
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8321
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8322
	    RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8323
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8324
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8325
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8326
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8327
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8328
needDeviceFormsForCursor
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8329
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8330
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8331
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8332
primCreateCursorShapeNr:number
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8333
    " create a standard (shape) cursor"
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8334
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8335
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8336
    HCURSOR newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8337
    LPCTSTR cId;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8338
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8339
    if (__isSmallInteger(number)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8340
	cId = (LPCTSTR)(__intVal(number));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8341
	newCursor = LoadCursor(NULL, cId);
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8342
	if (newCursor) {
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  8343
#ifdef KEEP_STD_CURSORS
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8344
	    if (cId == IDC_ARROW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8345
		H_C_ARROW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8346
	    else if (cId == IDC_CROSS)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8347
		H_C_CROSS = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8348
	    else if (cId == IDC_IBEAM)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8349
		H_C_IBEAM = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8350
	    else if (cId == IDC_ICON)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8351
		H_C_ICON = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8352
	    else if (cId == IDC_NO)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8353
		H_C_NO = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8354
	    else if (cId == IDC_SIZE)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8355
		H_C_SIZE = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8356
	    else if (cId == IDC_SIZEALL)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8357
		H_C_SIZEALL = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8358
	    else if (cId == IDC_SIZENESW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8359
		H_C_SIZENESW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8360
	    else if (cId == IDC_SIZENS)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8361
		H_C_SIZENS = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8362
	    else if (cId == IDC_SIZENWSE)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8363
		H_C_SIZENWSE = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8364
	    else if (cId == IDC_UPARROW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8365
		H_C_UPARROW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8366
	    else if (cId == IDC_WAIT)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8367
		H_C_WAIT = newCursor;
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  8368
	    else if (cId == IDC_APPSTARTING)
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  8369
		H_C_APPSTARTING = newCursor;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8370
#endif /* KEEP_STD_CURSORS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8371
	    RETURN ( __MKOBJ(newCursor) );
1127
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
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8374
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8375
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8376
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8377
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8378
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
  8379
    "create a cursor from given pixels"
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8380
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8381
%{  
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8382
    HCURSOR newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8383
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8384
    if (__isByteArray(src)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8385
     && __isByteArray(mask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8386
     && __bothSmallInteger(hx, hy)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8387
     && __bothSmallInteger(w, h)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8388
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8389
	newCursor = CreateCursor((HANDLE) __getHInstance(),
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8390
				 __intVal(hx), __intVal(hy),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8391
				 __intVal(w), __intVal(h),
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8392
				 __ByteArrayInstPtr(mask)->ba_element,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8393
				 __ByteArrayInstPtr(src)->ba_element);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8394
	if (newCursor) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8395
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8396
	    __cnt_cur++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8397
	    RESPRINTF(("CreateCursor %d\n",__cnt_cur));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8398
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8399
	    RETURN ( __MKOBJ(newCursor));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8400
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8401
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8402
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8403
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8404
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8405
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8406
shapeNumberFromSymbol:shape
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8407
    "given a shape-symbol, return the corresponding cursor-number,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8408
     or nil if no such standard cursor exists."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8409
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8410
    "this is pure Win-knowlegde - but you may easily add more"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8411
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8412
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8413
    if (shape == @symbol(upRightHand)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8414
	RETURN ( __MKSMALLINT( (INT)IDC_ARROW));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8415
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8416
    if (shape == @symbol(upLeftArrow)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8417
	RETURN ( __MKSMALLINT( (INT)IDC_ARROW));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8418
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8419
    if (shape == @symbol(upDownArrow)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8420
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENS));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8421
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8422
    if (shape == @symbol(leftRightArrow)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8423
	RETURN ( __MKSMALLINT( (INT)IDC_SIZEWE));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8424
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8425
    if (shape == @symbol(text)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8426
	RETURN ( __MKSMALLINT( (INT)IDC_IBEAM));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8427
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8428
    if (shape == @symbol(wait)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8429
	RETURN ( __MKSMALLINT( (INT)IDC_WAIT));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8430
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8431
    if (shape == @symbol(crossHair)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8432
	RETURN ( __MKSMALLINT( (INT)IDC_CROSS));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8433
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8434
    if (shape == @symbol(fourWay)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8435
	RETURN ( __MKSMALLINT( (INT)IDC_SIZEALL));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8436
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8437
    if (shape == @symbol(execute)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8438
	RETURN ( __MKSMALLINT( (INT)IDC_APPSTARTING));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8439
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8440
    if (shape == @symbol(noDrop)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8441
	RETURN ( __MKSMALLINT( (INT)IDC_NO));
3110
0058dbbb19df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3109
diff changeset
  8442
    }
0058dbbb19df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3109
diff changeset
  8443
    if (shape == @symbol(stop)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8444
	RETURN ( __MKSMALLINT( (INT)IDC_NO));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8445
    }
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  8446
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  8447
    if (shape == @symbol(IDC_UPARROW)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8448
	RETURN ( __MKSMALLINT( (INT)IDC_UPARROW));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  8449
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  8450
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  8451
    if (shape == @symbol(IDC_SIZE)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8452
	RETURN ( __MKSMALLINT( (INT)IDC_SIZE));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  8453
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  8454
    if (shape == @symbol(IDC_SIZENWSE)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8455
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENWSE));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  8456
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  8457
    if (shape == @symbol(IDC_SIZENESW)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8458
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENESW));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  8459
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  8460
    if (shape == @symbol(IDC_NO)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8461
	RETURN ( __MKSMALLINT( (INT)IDC_NO));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  8462
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  8463
#ifdef IDC_HELP
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  8464
    if (shape == @symbol(IDC_HELP)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  8465
	RETURN ( __MKSMALLINT( (INT)IDC_HELP));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  8466
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  8467
#endif
1127
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
"/    ('WINWORKSTATION: invalid cursorShape:' , shape printString) infoPrintNL.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8470
    ^  nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8471
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8472
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8473
!WinWorkstation methodsFor:'drawing'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8474
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8475
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
  8476
		width:w height:h
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8477
    "do a bit-blt; copy bits from the rectangle defined by
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8478
     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
  8479
     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
  8480
     argument is not integer."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8481
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
  8482
%{  
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  8483
    struct gcData *dstGcData = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8484
    struct gcData *srcGcData = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8485
    HDC srcDC = (HDC)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8486
    HDC dstDC = (HDC)0;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8487
    int     dstGcOwnerThreadID;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8488
    HWND    dstGcHWIN;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8489
    HBITMAP dstGcHBITMAP;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8490
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8491
    if (! __isExternalAddress(srcGCId)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8492
     || ! __isExternalAddress(dstGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8493
	goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8494
    }
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8495
    srcGcData = _GCDATA(srcGCId);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8496
    dstGcData = _GCDATA(dstGCId);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8497
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8498
    if (__bothSmallInteger(w, h)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8499
     && __bothSmallInteger(srcX, srcY)
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8500
     && __bothSmallInteger(dstX, dstY)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8501
     && srcGcData
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8502
     && dstGcData) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8503
	int fun = BITBLT_COPY;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8504
	int src_fg, src_bg, dst_fg, dst_bg;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8505
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8506
	fun = dstGcData->bitbltrop2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8507
#if 0
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8508
	switch (fun) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8509
	  case BITBLT_COPY:
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8510
	    printf("BITBLT_COPY\n");
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8511
	    break;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8512
	  case BITBLT_COPYINVERTED:
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8513
	    printf("BITBLT_COPYINVERTED\n");
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8514
	    break;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8515
	  case BITBLT_XOR:
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8516
	    printf("BITBLT_XOR\n");
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8517
	    break;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8518
	  case BITBLT_AND:
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8519
	    printf("BITBLT_AND\n");
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8520
	    break;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8521
	  case BITBLT_OR:
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8522
	    printf("BITBLT_OR\n");
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8523
	    break;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8524
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8525
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8526
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8527
	/*
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8528
	 * a scroll operation ?
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8529
	 */
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8530
	if (srcGcData->hWnd 
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8531
	 && ((srcGcData->hWnd == dstGcData->hWnd)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8532
	 && (fun == BITBLT_COPY))) {
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  8533
	    RECT rec, updRect;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8534
	    RECT invRec;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8535
	    HRGN updRgn = 0, dstRgn = 0, nUpdRgn = 0;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8536
	    int _srcX = __intVal(srcX);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8537
	    int _srcY = __intVal(srcY);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8538
	    int _dstX = __intVal(dstX);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8539
	    int _dstY = __intVal(dstY);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8540
	    int _w = __intVal(w);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8541
	    int _h = __intVal(h);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8542
	    int noExpose = 0;
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8543
	    int _deltaX, _deltaY;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8544
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8545
#ifdef CACHE_LAST_DC
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8546
	    if (lastGcData) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8547
		_releaseDC(lastGcData);     
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8548
	    }
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8549
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8550
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8551
	    rec.left = _srcX;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8552
	    rec.top  = _srcY;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8553
	    rec.right = rec.left + _w;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8554
	    rec.bottom = rec.top + _h;
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8555
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8556
	    _deltaX = _dstX - _srcX;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8557
	    _deltaY = _dstY - _srcY;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8558
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8559
	    DPRINTF(("dst and src is HWND %x fun == BITBLT_COPY --> scroll %d/%d\n",
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8560
		    srcGcData->hWnd,
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8561
		    _deltaX,
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8562
		    _deltaY));
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8563
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8564
	    if ((_deltaX == 0) && (_deltaY == 0)) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8565
		noExpose = 1;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8566
	    } else {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8567
		updRgn = CreateRectRgn(0, 0, 0, 0);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8568
		ScrollWindowEx(srcGcData->hWnd,
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8569
			    _deltaX,   
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8570
			    _deltaY,   
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8571
			    &rec,            /* area to scroll */
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8572
			    0,               /* clip region */
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8573
			    updRgn, 
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8574
			    NULL, /* &invRec, */
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8575
			    0 /* SW_ERASE | SW_INVALIDATE */);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8576
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8577
		/*
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8578
		 * we are not interested in the source-area;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8579
		 * only care for exposed areas in the dst area.
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8580
		 */
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8581
		dstRgn = CreateRectRgn(_dstX, _dstY, _dstX+_w, _dstY+_h); 
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8582
		nUpdRgn = CreateRectRgn(0, 0, 0, 0); 
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8583
		switch (CombineRgn(nUpdRgn, updRgn, dstRgn, RGN_AND)) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8584
		    case ERROR:
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8585
			_DeleteObject(nUpdRgn, __LINE__);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8586
			nUpdRgn = updRgn;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8587
			noExpose = 1;
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8588
			break;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8589
		    case NULLREGION:
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8590
			noExpose = 1;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8591
			break;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8592
		    default:
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8593
			if (__generateExposes(srcGcData->hWnd, nUpdRgn, __WM_GEXPOSE, 1) <= 0) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8594
			    noExpose = 1;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8595
			}
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8596
			break;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8597
		}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8598
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8599
	    if (noExpose) {
2705
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  8600
		/*
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  8601
		 * no exposes generated - must send a NOEXPOSE
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  8602
		 */
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  8603
		enqEvent(ExposureMask, srcGcData->hWnd, __WM_NOGEXPOSE, 0, 0, 0, 0, 0, EV_NOTIME);
2705
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  8604
	    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8605
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8606
	    if (dstRgn) {
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8607
		_DeleteObject(dstRgn, __LINE__);
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8608
	    }
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8609
	    if (nUpdRgn && (nUpdRgn != updRgn)) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8610
		_DeleteObject(nUpdRgn, __LINE__);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8611
	    }
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8612
	    if (updRgn) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8613
		_DeleteObject(updRgn, __LINE__);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8614
	    }
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8615
	    RETURN ( self );
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8616
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8617
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8618
	fun = dstGcData->bitbltrop2;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8619
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8620
	if (0 /* fun == BITBLT_COPY */) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8621
	    src_fg = dst_fg = 0xFFFFFF;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8622
	    src_bg = dst_bg = 0x000000;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8623
	} else {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8624
	    src_fg = srcGcData->fgColor;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8625
	    src_bg = srcGcData->bgColor;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8626
	    dst_fg = dstGcData->fgColor;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8627
	    dst_bg = dstGcData->bgColor;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8628
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8629
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8630
	/*
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8631
	 * a simple copy (like scroll, but in a bitmap) ?
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8632
	 */
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8633
	if ((srcGcData == dstGcData)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8634
	 && (fun == BITBLT_COPY)) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8635
	    RECT rec, uprec;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8636
	    int _srcX, _srcY;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8637
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8638
	    rec.left = _srcX = __intVal(srcX);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8639
	    rec.top = _srcY = __intVal(srcY);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8640
	    rec.right = rec.left + __intVal(w);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8641
	    rec.bottom = rec.top + __intVal(h);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8642
	    srcDC = _getDC(srcGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8643
	    SetBkColor(srcDC, src_fg);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8644
	    SetTextColor(srcDC, src_bg);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8645
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8646
	    DPRINTF(("dst and src is DC %x fun == BITBLT_COPY  --> scrolling %d %d\n",srcDC,__intVal(dstX) - __intVal(srcX),__intVal(dstY) - __intVal(srcY)));
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8647
	    ScrollDC(srcDC, __intVal(dstX)-_srcX, 
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8648
			    __intVal(dstY)-_srcY, 
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8649
			    &rec, 0, 0, &uprec);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8650
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8651
	    SetBkColor(srcDC, srcGcData->bgColor);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8652
	    SetTextColor(srcDC, srcGcData->fgColor);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8653
#ifndef CACHE_LAST_DC
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8654
	    _releaseDC(srcGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8655
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8656
	    RETURN ( self );
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8657
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8658
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8659
#ifdef xxCACHE_LAST_DC
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8660
/* mhmh - this should not be needed */
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8661
	if (lastGcData) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8662
	    _releaseDC(lastGcData);     
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8663
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8664
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8665
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8666
	if (dstGcData == srcGcData) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8667
	    srcDC = dstDC = _getDC(dstGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8668
	} else {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8669
	    srcDC = _getDC(srcGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8670
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8671
	    /* 
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8672
	     * kludge - pretent nothing is cached for a moment,
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8673
	     * to avoid release in getDC below ...
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8674
	     */
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8675
#ifdef CACHE_LAST_DC
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8676
	    dstGcOwnerThreadID = lastGcOwnerThreadID;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8677
	    dstGcHWIN = lastGcHWIN;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8678
	    dstGcHBITMAP = lastGcHBITMAP;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8679
	    lastGcData = 0;  
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8680
#endif
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8681
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8682
	    dstDC = _getDC(dstGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8683
	    SetBkColor(dstDC, dst_fg);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8684
	    SetTextColor(dstDC, dst_bg);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8685
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8686
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8687
	SetBkColor(srcDC, src_fg);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8688
	SetTextColor(srcDC, src_bg); 
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8689
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8690
	CPRINTF(("bitblt src f:%x b:%x",GetTextColor(srcDC),GetBkColor(srcDC)));
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8691
	CPRINTF(("dst f:%x b:%x\n",GetTextColor(dstDC),GetBkColor(dstDC)));
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8692
	if (BitBlt(dstDC,
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8693
	     __intVal(dstX), __intVal(dstY),
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8694
	     __intVal(w), __intVal(h),
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8695
	     srcDC,
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8696
	     __intVal(srcX), __intVal(srcY),
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8697
	     fun)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8698
	   == 0
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8699
	  ) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8700
	    fprintf(stderr, "WinWorkstation [info]: ERROR in BitBlt\n");
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8701
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8702
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8703
	if (dstGcData != srcGcData) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8704
	    SetBkColor(dstDC, dstGcData->bgColor);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8705
	    SetTextColor(dstDC, dstGcData->fgColor);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8706
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8707
	SetBkColor(srcDC, srcGcData->bgColor);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8708
	SetTextColor(srcDC, srcGcData->fgColor);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8709
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8710
	if (srcGcData != dstGcData) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8711
	    _releaseDC(srcGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8712
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8713
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8714
#ifdef CACHE_LAST_DC
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8715
	/*
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8716
	 * kludge again - restore last-DC cache 
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8717
	 */
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8718
	lastGcData = dstGcData;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8719
	lastGcOwnerThreadID = dstGcOwnerThreadID;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8720
	lastGcHWIN = dstGcHWIN;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8721
	lastGcHBITMAP = dstGcHBITMAP;
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8722
#else
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8723
	_releaseDC(dstGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8724
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8725
	RETURN ( self );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8726
    }
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  8727
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8728
 fail: ;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8729
%}.
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8730
    self primitiveFailed.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8731
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8732
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8733
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8734
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
  8735
		width:w height:h
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8736
    "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
  8737
     copy bits from the rectangle defined by
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8738
     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
  8739
     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
  8740
     argument is not integer."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8741
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8742
    ^ self
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8743
	copyFromId:sourceId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8744
		 x:srcX y:srcY gc:srcDCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8745
		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
  8746
	     width:w height:h
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8747
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8748
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8749
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
  8750
    "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
  8751
     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
  8752
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  8753
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8754
    int __x, __y, w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8755
    float angle1, angle2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8756
    double f;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8757
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8758
    if (__isSmallInteger(startAngle))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8759
	angle1 = (float)(__intVal(startAngle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8760
    else if (__isFloat(startAngle)) {
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8761
	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
  8762
    } else if (__isShortFloat(startAngle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  8763
	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
  8764
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  8765
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8766
    if (__isSmallInteger(angle))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8767
	angle2 = (float)(__intVal(angle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8768
    else if (__isFloat(angle)) {
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8769
	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
  8770
    } else if (__isShortFloat(angle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  8771
	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
  8772
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  8773
2930
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
  8774
    if (angle2 <= 0) {
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
  8775
	RETURN (self);
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
  8776
    }
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
  8777
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8778
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8779
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8780
     && __bothSmallInteger(x, y)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8781
     && __bothSmallInteger(width, height)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8782
     {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8783
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8784
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  8785
	POINT p;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8786
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8787
	w = __intVal(width);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8788
	h = __intVal(height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8789
	__x = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8790
	__y = __intVal(y);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8791
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8792
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8793
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8794
	if (! GcDataGetPen(hDC, gcData)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8795
	    DPRINTF(("displayArc: no pen\n"));
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  8796
	} else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8797
	    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
  8798
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8799
	    xR = w / 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8800
	    yR = h / 2;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8801
	    if (angle2 - angle1 >= 360) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8802
		xB = xE = __x + xR + 0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8803
		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
  8804
	    } else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8805
		double sin(), cos();
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8806
		float rad1, rad2;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8807
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8808
		if (angle1 <= 180)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8809
		  angle1 = 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8810
		else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8811
		  angle1 = 360 + 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8812
		angle2 = angle1 - angle2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8813
		/* sigh - compute the intersections ... */
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8814
		rad1 = (angle1 * 3.14159265359) / 180.0;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8815
		rad2 = (angle2 * 3.14159265359) / 180.0;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8816
		xB = cos(rad1) * xR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8817
		yB = sin(rad1) * yR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8818
		xE = cos(rad2) * xR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8819
		yE = sin(rad2) * yR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8820
		xB = __x + xR - xB + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8821
		yB = __y + yR - yB + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8822
		xE = __x + xR - xE + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  8823
		yE = __y + yR - yE + 0.5;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8824
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8825
	    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
  8826
	    Arc(hDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8827
		__x, __y,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8828
		__x + w, __y + h,
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8829
		(int)xB, (int)yB,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8830
		(int)xE, (int)yE);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8831
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  8832
	    GcDataReleasePen(hDC, gcData);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  8833
	}
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  8834
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8835
	_releaseDC(gcData);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  8836
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8837
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8838
    }
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  8839
    bad: ;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  8840
%}.
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  8841
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8842
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8843
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8844
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
  8845
    "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
  8846
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8847
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8848
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8849
     /*&& __isExternalAddress(aDrawableId)*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8850
     && __bothSmallInteger(x0, y0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8851
     && __bothSmallInteger(x1, y1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8852
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8853
	int __x1 = __intVal(x1), __y1 = __intVal(y1);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8854
	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
  8855
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8856
/*      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
  8857
		    __intVal(x0), __intVal(y0),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8858
		    __x1, __y1,_HWNDVal(aDrawableId)));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8859
*/
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8860
	if (! GcDataGetPen(hDC, gcData)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8861
	    DPRINTF(("displayLine: no pen\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8862
	} else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8863
	    MoveToEx(hDC, __intVal(x0), __intVal(y0), NULL);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8864
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8865
	    LineTo(hDC, __x1, __y1);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  8866
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8867
	    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8868
	     * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8869
	     */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8870
	    LineTo(hDC, __x1+1, __y1);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  8871
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  8872
	    GcDataReleasePen(hDC, gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8873
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8874
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8875
	_releaseDC(gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8876
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8877
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8878
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8879
%}
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
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  8882
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
  8883
    "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
  8884
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8885
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8886
    if (__isExternalAddress(aGCId)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8887
     /* && __isExternalAddress(aDrawableId) */
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  8888
     && __bothSmallInteger(px, py)) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8889
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8890
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  8891
	POINT p;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8892
	int __x = __intVal(px), __y = __intVal(py);
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8893
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8894
#ifdef OLD
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8895
	int savedLStyle = gcData->lStyle;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8896
	int savedLWidth = gcData->lineWidth;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8897
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8898
	/*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8899
	 * 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
  8900
	 */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8901
	if ((gcData->lStyle != PS_SOLID)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  8902
	 || (gcData->lineWidth > 1)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8903
	    FLUSH_CACHED_DC(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8904
	    gcData->lStyle = PS_SOLID;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8905
	    gcData->lineWidth = 0;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8906
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8907
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8908
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8909
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8910
	if (! GcDataGetPen(hDC,gcData)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8911
	    DPRINTF(("displayPoint: no pen\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8912
	} else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8913
	    MoveToEx(hDC, __x, __y, NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8914
	    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8915
	     * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8916
	     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8917
	    LineTo(hDC, __x+1, __y);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  8918
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  8919
	    GcDataReleasePen(hDC, gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8920
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8921
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  8922
# ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8923
	_releaseDC(gcData);
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  8924
# endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8925
	if ((gcData->lStyle != savedLStyle)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8926
	 || (gcData->lineWidth != savedLWidth)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8927
	    FLUSH_CACHED_DC(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8928
	    gcData->lStyle = savedLStyle;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8929
	    gcData->lineWidth = savedLWidth;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8930
	}
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  8931
#else /* NEW */
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8932
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  8933
	hDC = _getDC(gcData);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  8934
	SetPixelV(hDC, __x, __y, gcData->fgColor);
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  8935
# ifndef CACHE_LAST_DC
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  8936
	_releaseDC(gcData);
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  8937
# endif
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8938
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  8939
#endif /* NEW */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8940
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8941
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8942
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8943
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8944
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8945
displayPolygon:aPolygon in:aDrawableId with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8946
    "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
  8947
     which define the polygon.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8948
     If any coordinate is not integer, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8949
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8950
    |numberOfPoints|
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8951
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8952
    numberOfPoints := aPolygon size.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8953
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8954
%{
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8955
    OBJ point, px, py;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8956
    int i, num;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8957
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8958
    if (__isExternalAddress(aGCId)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8959
     /* && __isExternalAddress(aDrawableId) */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8960
     && __isSmallInteger(numberOfPoints)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8961
	struct gcData *gcData = _GCDATA(aGCId);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8962
	HDC hDC = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8963
	POINT p;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8964
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8965
	num = __intVal(numberOfPoints);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8966
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8967
	for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8968
	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8969
	    if (! __isPoint(point)) goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8970
	    px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8971
	    py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8972
	    if (! __bothSmallInteger(px, py)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8973
		goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8974
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8975
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8976
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8977
	hDC = _getDC(gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8978
	if (! GcDataGetPen(hDC,gcData)) {
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8979
	    DPRINTF(("displayPolygon: no pen\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8980
	} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8981
	    for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8982
		point = __AT_(aPolygon, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8983
		px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8984
		py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8985
		p.x = __intVal(px);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8986
		p.y = __intVal(py);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8987
		if (i == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8988
		    MoveToEx(hDC, p.x, p.y, NULL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8989
		} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8990
		    if (i == (num-1)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8991
			PolylineTo(hDC, &p, 1);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8992
		    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8993
			LineTo(hDC, p.x, p.y);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8994
			/*
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8995
			 * end-point ...
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8996
			 */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8997
			LineTo(hDC, p.x+1, p.y);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8998
		    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8999
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9000
	    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  9001
	    GcDataReleasePen(hDC, gcData);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9002
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9003
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9004
#ifndef CACHE_LAST_DC
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9005
	_releaseDC(gcData);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9006
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9007
	RETURN ( self );
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9008
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9009
fail: ;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9010
%}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9011
!
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9012
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9013
displayPolylines:aPolyline in:aDrawableId with:aGCId
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9014
    "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
  9015
     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
  9016
     If any coordinate is not integer, an error is triggered."
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9017
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9018
    |numberOfPoints|
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9019
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9020
    numberOfPoints := aPolyline size.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9021
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9022
%{
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9023
    OBJ point, px, py;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9024
    int i, num;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9025
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9026
    if (__isExternalAddress(aGCId)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9027
     /* && __isExternalAddress(aDrawableId) */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9028
     && __isSmallInteger(numberOfPoints)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9029
	struct gcData *gcData = _GCDATA(aGCId);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9030
	HDC hDC = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9031
	POINT p;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9032
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9033
	num = __intVal(numberOfPoints);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9034
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9035
	for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9036
	    point = __AT_(aPolyline, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9037
	    if (! __isPoint(point)) goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9038
	    px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9039
	    py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9040
	    if (! __bothSmallInteger(px, py)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9041
		goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9042
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9043
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9044
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9045
	hDC = _getDC(gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9046
	if (! GcDataGetPen(hDC,gcData)) {
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9047
	    DPRINTF(("displayPolygon: no pen\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9048
	} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9049
	    for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9050
		point = __AT_(aPolyline, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9051
		px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9052
		py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9053
		p.x = __intVal(px);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9054
		p.y = __intVal(py);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9055
		if ((i & 1) == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9056
		    MoveToEx(hDC, p.x, p.y, NULL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9057
		} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9058
		    LineTo(hDC, p.x, p.y);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9059
		    /*
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9060
		     * end-point ...
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9061
		     */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9062
		    LineTo(hDC, p.x+1, p.y);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9063
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9064
	    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  9065
	    GcDataReleasePen(hDC, gcData);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9066
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9067
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9068
#ifndef CACHE_LAST_DC
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9069
	_releaseDC(gcData);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9070
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9071
	RETURN ( self );
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9072
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9073
fail: ;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  9074
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9075
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9076
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9077
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
  9078
    "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
  9079
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  9080
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9081
    int w, h;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9082
    int xL, yT;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9083
    if (__isExternalAddress(aGCId)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9084
     /* && __isExternalAddress(aDrawableId) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9085
     && __bothSmallInteger(x, y)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9086
     && __bothSmallInteger(width, height)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9087
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9088
	HDC hDC = _getDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9089
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9090
	xL = __intVal(x);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9091
	yT = __intVal(y);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9092
	w = __intVal(width);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9093
	h = __intVal(height);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9094
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9095
	DPRINTF(("displayRectangle: %d/%d -> %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9096
			xL, yT, w, h));
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  9097
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9098
	if ((w >= 0) && (h >= 0)) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9099
	    if (! GcDataGetPen(hDC,gcData)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9100
		DPRINTF(("displayRect: no pen\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9101
	    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9102
		MoveToEx(hDC, xL, yT, NULL);
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9103
#if 0
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9104
		LineTo(hDC, xL+w, yT);     // to top-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9105
		LineTo(hDC, xL+w, yT+h);   // to bot-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9106
		LineTo(hDC, xL, yT+h);     // to bot-left
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9107
		LineTo(hDC, xL, yT);       // back to top-left
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9108
#else
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9109
		LineTo(hDC, xL+w, yT);       // to top-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9110
		LineTo(hDC, xL+w, yT+h);     // to bot-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9111
		MoveToEx(hDC, xL, yT, NULL); // back to top-left
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9112
		LineTo(hDC, xL, yT+h);       // to bot-left
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9113
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9114
#ifndef PRE_31_JAN_03
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9115
		LineTo(hDC, xL+w+1, yT+h);   // move pen one pixel more
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9116
#else
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9117
		LineTo(hDC, xL+w, yT+h);     // to bot-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9118
#endif
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  9119
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9120
#endif
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9121
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  9122
		GcDataReleasePen(hDC, gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9123
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9124
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9125
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9126
	_releaseDC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9127
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9128
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9129
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9130
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9131
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9132
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9133
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
  9134
    "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
  9135
     foreground and background characters.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9136
     If the coordinates are not integers, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9137
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  9138
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9139
    unsigned char *cp;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9140
    OBJ cls;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9141
    int  i1, i2, l, n;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9142
    int nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9143
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9144
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9145
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9146
     && __isNonNilObject(aString)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9147
     && __bothSmallInteger(index1, index2)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9148
     && __bothSmallInteger(x, y)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9149
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9150
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9151
	int pX, pY;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9152
	HDC hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9153
	HFONT hOldFont;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9154
	pX = __intVal(x);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9155
	pY = __intVal(y);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9156
	pY -= gcData->fontAscent;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9157
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9158
	if (opaque == true) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9159
	    if (gcData->bkMode != BK_OPAQUE) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9160
		SetBkMode(hDC, OPAQUE);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9161
		gcData->bkMode = BK_OPAQUE;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9162
	    }
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9163
	} else {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9164
	    if (gcData->bkMode != BK_TRANSPARENT) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9165
		SetBkMode(hDC, TRANSPARENT);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9166
		gcData->bkMode = BK_TRANSPARENT;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9167
	    }
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9168
	}
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9169
#if 0
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9170
	hOldFont = SelectObject(hDC, gcData->hFont);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9171
	SetTextColor(hDC, gcData->fgColor);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9172
	SetBkColor(hDC, gcData->bgColor);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9173
#endif
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9174
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9175
	cls = __qClass(aString);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9176
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9177
	i1 = __intVal(index1) - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9178
	if (i1 >= 0) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9179
	    i2 = __intVal(index2) - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9180
	    if (i2 < i1) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9181
		goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9182
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9183
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9184
	    cp = _stringVal(aString);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9185
	    l = i2 - i1 + 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9186
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9187
	    if ((cls == @global(String)) || (cls == @global(Symbol))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9188
		n = _stringSize(aString);
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9189
		if (i2 < n) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9190
		    cp += i1;
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9191
		    CPRINTF(("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
  9192
2664
5077cdd062c5 cut long strings for TextOut
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  9193
		    if (l > 32767) {
5077cdd062c5 cut long strings for TextOut
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  9194
			l = 32767;
5077cdd062c5 cut long strings for TextOut
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  9195
		    }
5077cdd062c5 cut long strings for TextOut
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  9196
		    if (! TextOut(hDC, pX, pY, (char *)cp, l)) {
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9197
			PRINTF(("Textout failed. %d\n", GetLastError()));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9198
		    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9199
		    goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9200
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9201
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9202
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9203
	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9204
	    cp += nInstBytes;
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
  9205
	    n = __byteArraySize(aString) - nInstBytes;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9206
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9207
	    if (__isBytes(aString)) {
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9208
		if (i2 < n) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9209
		    cp += i1;
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9210
		    CPRINTF(("string: %s pos=%d/%d\n", cp, pX, pY));
2664
5077cdd062c5 cut long strings for TextOut
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  9211
		    if (l > 32767) {
5077cdd062c5 cut long strings for TextOut
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  9212
			l = 32767;
5077cdd062c5 cut long strings for TextOut
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  9213
		    }
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9214
		    if (! TextOut(hDC, pX, pY, (char *)cp, l)) {
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9215
			PRINTF(("Textout failed. %d\n", GetLastError()));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9216
		    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9217
		    goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9218
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9219
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9220
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
  9221
	    /* Unicode */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9222
	    if (__isWords(aString)) {
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
  9223
		n = n / 2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9224
		if (i2 < n) {
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
  9225
		    WIDECHAR *w_cp = (WIDECHAR *)cp;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
  9226
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
  9227
		    w_cp += i1;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
  9228
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
  9229
		    if (! TextOutW(hDC, pX, pY, w_cp, l)) {
3492
7cc5502dbf65 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3481
diff changeset
  9230
			PRINTF(("TextoutW failed. %d\n", GetLastError()));
7cc5502dbf65 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3481
diff changeset
  9231
		    }
7cc5502dbf65 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3481
diff changeset
  9232
		    goto ret;
7cc5502dbf65 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3481
diff changeset
  9233
		}
7cc5502dbf65 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3481
diff changeset
  9234
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9235
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9236
ret:   
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9237
#if 0
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9238
	SelectObject(hDC, hOldFont);
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9239
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9240
#ifndef CACHE_LAST_DC
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9241
	_releaseDC(gcData);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  9242
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9243
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9244
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9245
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9246
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9247
drawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9248
			  width:imageWidth height:imageHeight
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9249
			      x:srcx y:srcy
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9250
			   into:aDrawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9251
			      x:dstx y:dsty
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9252
			  width:w height:h
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9253
			   with:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9254
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9255
    "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
  9256
     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
  9257
     Individual source pixels have bitsPerPixel bits, allowing to draw
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9258
     depth and pixel-units to be different.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9259
     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
  9260
     depth - otherwise, primitive failure will be signalled.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9261
     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
  9262
     colors are allocated - otherwise the colors may be wrong."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9263
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9264
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9265
     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
  9266
     an unlimited stack, and thus cannot send primitiveFailed
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9267
    "
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9268
    (self primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9269
					width:imageWidth height:imageHeight
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9270
					     x:srcx y:srcy
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9271
					  into:aDrawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9272
					     x:dstx y:dsty
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9273
					 width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9274
					  with:aGCId)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9275
    ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9276
	"
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9277
	 also happens, if a segmentation violation occurs in the
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9278
	 XPutImage ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9279
	"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9280
	self primitiveFailed
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9281
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9282
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9283
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9284
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
  9285
	       in:aDrawableId with:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9286
    "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
  9287
     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
  9288
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  9289
%{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9290
    int __x, __y, w, h;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9291
    float angle1, angle2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9292
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9293
    if (__isSmallInteger(startAngle))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9294
	angle1 = (float)(__intVal(startAngle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9295
    else if (__isFloat(startAngle)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9296
	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
  9297
    } else if (__isShortFloat(startAngle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9298
	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
  9299
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  9300
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9301
    if (__isSmallInteger(angle))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9302
	angle2 = (float)(__intVal(angle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9303
    else if (__isFloat(angle)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9304
	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
  9305
    } else if (__isShortFloat(angle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9306
	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
  9307
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  9308
2930
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
  9309
    if (angle2 <= 0) {
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
  9310
	RETURN (self);
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
  9311
    }
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
  9312
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9313
    if (__isExternalAddress(aGCId)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9314
     /* && __isExternalAddress(aDrawableId) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9315
     && __bothSmallInteger(x, y)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9316
     && __bothSmallInteger(width, height)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9317
     {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9318
	struct gcData *gcData = _GCDATA(aGCId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9319
	HDC hDC;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9320
	HBRUSH hBrush;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9321
	HPEN prevPen = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9322
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9323
	w = __intVal(width);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9324
	h = __intVal(height);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9325
	__x = __intVal(x);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9326
	__y = __intVal(y);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9327
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9328
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9329
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9330
	if (!(hBrush = GcDataGetBrush(hDC, gcData))) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9331
	    DPRINTF(("fillArc: no brush\n"));
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  9332
	} else {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9333
	    HPEN hPen = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9334
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9335
	    if (0 /* __isWinNT */) {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9336
		if (! (hPen = GcDataGetPen(hDC, gcData))) {
2930
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
  9337
		    DPRINTF(("fillArc: no pen\n"));
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9338
		    goto failpen;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9339
		}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9340
	    } else {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9341
		prevPen = SelectObject(hDC, __nullPen);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9342
		w++;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9343
		h++;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9344
	    }
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9345
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9346
	    {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9347
		double xB, yB, xE, yE, xR, yR;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9348
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9349
		xR = w / 2;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9350
		yR = h / 2;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9351
		if (angle2 - angle1 >= 360) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9352
		    xB = xE = __x + xR + 0.5;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9353
		    yB = yE = __y /*+ yR + 0.5*/;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9354
		} else {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9355
		    double sin(), cos();
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9356
		    float rad1, rad2;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9357
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9358
		    if (angle1 <= 180)
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9359
			angle1 = 180 - angle1;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9360
		    else
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9361
			angle1 = 360 + 180 - angle1;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9362
		    angle2 = angle1 - angle2;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9363
		    /* sigh - compute the intersections ... */
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9364
		    rad1 = (angle1 * 3.14159265359) / 180.0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9365
		    rad2 = (angle2 * 3.14159265359) / 180.0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9366
		    xB = cos(rad1) * xR;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9367
		    yB = sin(rad1) * yR;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9368
		    xE = cos(rad2) * xR;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9369
		    yE = sin(rad2) * yR;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9370
		    xB = __x + xR - xB + 0.5;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9371
		    yB = __y + yR - yB + 0.5;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9372
		    xE = __x + xR - xE + 0.5;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9373
		    yE = __y + yR - yE + 0.5;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9374
		}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9375
		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
  9376
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9377
		Pie(hDC,
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9378
		    __x, __y,
2817
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  9379
		    __x + w + 1, __y + h + 1,
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9380
		    (int)xB, (int)yB,
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9381
		    (int)xE, (int)yE);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9382
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9383
		if (hPen) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9384
		    GcDataReleasePen(hDC, gcData);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9385
		}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9386
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9387
failpen:
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9388
#ifdef CACHE_LAST_CG
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9389
	    if (prevPen) SelectObject(hDC, prevPen);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9390
#endif
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9391
	    GcDataReleaseBrush(hDC, gcData);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9392
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9393
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9394
	_releaseDC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9395
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9396
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9397
    }
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  9398
    bad: ;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  9399
%}.
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  9400
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9401
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9402
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9403
fillPolygon:aPolygon in:aDrawableId with:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9404
    "fill a polygon given by its points.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9405
     If any coordinate is not integer, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9406
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9407
    |numberOfPoints|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9408
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9409
    numberOfPoints := aPolygon size.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9410
    self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9411
	primFillPolygon:aPolygon n:numberOfPoints 
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9412
	in:aDrawableId with:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9413
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9414
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9415
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
  9416
    "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
  9417
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  9418
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9419
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9420
    int w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9421
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9422
     && __isExternalAddress(aDrawableId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9423
     && __bothSmallInteger(x, y)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9424
     && __bothSmallInteger(width, height)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9425
	w = __intVal(width);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9426
	h = __intVal(height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9427
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9428
	if ((w >= 0) && (h >= 0)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9429
	    struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9430
	    HDC hDC;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9431
	    HBRUSH hBrush;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9432
	    RECT rct;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9433
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9434
	    hDC = _getDC(gcData);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  9435
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
  9436
	    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
  9437
	    if (! hBrush) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9438
		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
  9439
	    } else {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  9440
		rct.left = __intVal(x);
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9441
		rct.top  = __intVal(y);
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9442
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9443
#ifndef PRE_31_JAN_03
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9444
		rct.right  = rct.left + w;
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9445
		rct.bottom = rct.top  + h;
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9446
#else
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9447
		rct.right  = rct.left + w + 1;    /* definitiv ! */
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9448
		rct.bottom = rct.top  + h + 1;
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9449
#endif
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  9450
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9451
		CPRINTF(("fillRectangle:%d.%d -> %d.%d\n",rct.left,rct.top,rct.right,rct.bottom));
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9452
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  9453
		/*
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  9454
		 * for solid draws (without function), can use FillRect,
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  9455
		 * which is faster and does not need a pen.
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  9456
		 */
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
  9457
		if ((gcData->rop2 == R2_COPYPEN)
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
  9458
		 && (gcData->bitbltrop2 == BITBLT_COPY)) {
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  9459
		    AQUIRE_DRAW_MUTEX
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  9460
		    FillRect(hDC, &rct, hBrush);
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  9461
		    RELEASE_DRAW_MUTEX
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9462
		    GcDataReleaseBrush(hDC, gcData);
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
  9463
		} else {                              
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9464
		    HPEN prevPen;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9465
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9466
		    prevPen = SelectObject(hDC, __nullPen);
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  9467
/* sigh - conflict between ST/X's Rectangle and Win32's Rectangle */
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  9468
# undef Rectangle
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9469
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9470
#ifndef PRE_31_JAN_03
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9471
		    Rectangle(hDC, rct.left, rct.top, rct.right +1, rct.bottom +1);
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9472
#else
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
  9473
		    Rectangle(hDC, rct.left, rct.top, rct.right, rct.bottom);
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9474
#endif
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
  9475
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  9476
# define Rectangle __DEF_Rectangle
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
  9477
		    GcDataReleaseBrush(hDC, gcData);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9478
#ifdef CACHE_LAST_DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9479
		    SelectObject(hDC, prevPen);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9480
#endif
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  9481
		}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9482
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9483
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9484
	    _releaseDC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9485
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9486
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9487
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9488
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9489
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9490
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9491
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9492
primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9493
			      width:imageWidth height:imageHeight
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9494
				  x:srcx y:srcy
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9495
			       into:aDrawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9496
				  x:dstx y:dsty
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9497
			      width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9498
			       with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9499
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9500
    "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
  9501
     (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
  9502
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  9503
%{
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9504
    unsigned char fastBits[10000];
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9505
    unsigned char *b_bits = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9506
    unsigned char *allocatedBits = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9507
    struct gcData *gcData = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9508
    HDC hDC = (HDC)0;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9509
    unsigned char *__imageBits = 0;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9510
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9511
    if (__isByteArray(imageBits)) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9512
	__imageBits = __ByteArrayInstPtr(imageBits)->ba_element;
3850
6d3def73ffce also handle subclasses of externalBytes
Claus Gittinger <cg@exept.de>
parents: 3832
diff changeset
  9513
    } else if (__isExternalBytesLike(imageBits)) {
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9514
	__imageBits = (unsigned char *)(__externalBytesAddress(imageBits));
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9515
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9516
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9517
    if (ISCONNECTED
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9518
     && __isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9519
     && __isExternalAddress(aDrawableId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9520
     && __bothSmallInteger(srcx, srcy)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9521
     && __bothSmallInteger(dstx, dsty)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9522
     && __bothSmallInteger(w, h)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9523
     && __bothSmallInteger(imageWidth, imageHeight)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9524
     && __bothSmallInteger(imageDepth, bitsPerPixel)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9525
     && __isSmallInteger(padd)
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9526
     && __imageBits)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9527
     {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9528
	struct
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9529
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9530
	  BITMAPINFOHEADER bmiHeader;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9531
	  DWORD r;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9532
	  DWORD g;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9533
	  DWORD b;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9534
	} bitmap;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9535
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9536
	gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9537
	if (! gcData )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9538
	    goto fail;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9539
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9540
	DDPRINTF(("hDC = %x\n", hDC));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9541
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9542
	if (__intVal(padd) != WIN32PADDING) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9543
	    int row, col;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9544
	    unsigned char *cp;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9545
	    unsigned char *pBits;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9546
	    int b_width, b_height, bytesPerRowST, bytesPerRowWN, padding, nBytes;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9547
	    int bi = __intVal(bitsPerPixel);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9548
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9549
	    b_width = __intVal(w);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9550
	    b_height = __intVal(h);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9551
	    bytesPerRowST = (b_width * bi + (__intVal(padd)-1)) / __intVal(padd);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9552
	    bytesPerRowWN = (b_width * bi + (WIN32PADDING-1)) / WIN32PADDING * (WIN32PADDING/8);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9553
	    padding = bytesPerRowWN - bytesPerRowST;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9554
	    nBytes = b_height * bytesPerRowWN;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9555
	    /*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
  9556
	    if (padding) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9557
		if (nBytes < sizeof(fastBits)) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9558
		    cp = b_bits = fastBits;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9559
		} else {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9560
		    cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9561
		}
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9562
		if (cp) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9563
		    pBits = __imageBits;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9564
		    for (row = b_height; row; row--) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9565
			for (col = bytesPerRowST; col; col--) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9566
			    *cp++ = *pBits++;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9567
			}
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9568
			cp += padding;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9569
		    }
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9570
		} else
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9571
		    goto fail;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9572
	    }
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9573
	}
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9574
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9575
	if (b_bits == 0) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9576
	    b_bits = __imageBits;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9577
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9578
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9579
	bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9580
	bitmap.bmiHeader.biPlanes = 1;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9581
	if (__intVal(imageDepth) == 24) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9582
	    /*bitmap.bmiHeader.biCompression = BI_BITFIELDS;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9583
	    bitmap.r = 0xff0000;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9584
	    bitmap.g = 0x00ff00;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9585
	    bitmap.b = 0x0000ff;*/
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9586
	    bitmap.bmiHeader.biCompression = BI_RGB;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9587
	} else if (__intVal(imageDepth) == 16) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9588
	    /*bitmap.bmiHeader.biCompression = BI_RGB;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9589
	    bitmap.bmiHeader.biCompression = BI_BITFIELDS;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9590
	    bitmap.b = 0x001f;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9591
	    bitmap.g = 0x07e0;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9592
	    bitmap.r = 0xf800;*/
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9593
	    bitmap.b = 0;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9594
	    bitmap.g = 0;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9595
	    bitmap.r = 0;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9596
	    bitmap.bmiHeader.biCompression = BI_RGB;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9597
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9598
	bitmap.bmiHeader.biSizeImage = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9599
	bitmap.bmiHeader.biXPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9600
	bitmap.bmiHeader.biYPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9601
	bitmap.bmiHeader.biClrUsed = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9602
	bitmap.bmiHeader.biClrImportant = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9603
	bitmap.bmiHeader.biWidth = __intVal(imageWidth);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9604
	bitmap.bmiHeader.biHeight = -(__intVal(imageHeight));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9605
	bitmap.bmiHeader.biBitCount = __intVal(bitsPerPixel);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9606
	/*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
  9607
	SetDIBitsToDevice(hDC,__intVal(dstx),__intVal(dsty),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9608
			      __intVal(w), __intVal(h),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9609
			      __intVal(srcx), __intVal(srcy),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9610
			      0,__intVal(h),
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9611
			      (void *)b_bits,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9612
			      (BITMAPINFO*)&bitmap,DIB_RGB_COLORS);
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9613
	if (allocatedBits) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9614
	    free(allocatedBits);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9615
	}
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9616
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9617
	_releaseDC(gcData);
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9618
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9619
	RETURN ( true );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9620
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9621
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9622
fail: ;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9623
    PRINTF(("create temp bitmap FAILED!!!\n"));
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9624
    if (allocatedBits) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9625
	PRINTF(("freeing up temp bitmap bits ...\n"));
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  9626
	free(allocatedBits);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9627
    }
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9628
#ifndef CACHE_LAST_DC
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9629
    if (hDC) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9630
	_releaseDC(gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9631
    }
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9632
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9633
%}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9634
.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9635
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9636
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9637
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9638
primFillPolygon:aPolygon n:numberOfPoints in:aDrawableId with:aGCId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9639
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  9640
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9641
    OBJ point, px, py;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9642
    int i, num;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9643
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9644
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9645
     && __isExternalAddress(aDrawableId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9646
     && __isSmallInteger(numberOfPoints)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9647
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9648
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  9649
	POINT p;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  9650
	HBRUSH hBrush;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9651
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9652
	num = __intVal(numberOfPoints);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9653
	if (num < 3) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9654
	    RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9655
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9656
	for (i=0; i<num; i++) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9657
	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9658
	    if (! __isPoint(point)) goto fail;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  9659
	    px = _point_X(point);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  9660
	    py = _point_Y(point);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  9661
	    if (! __bothSmallInteger(px, py))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9662
		goto fail;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9663
	}
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  9664
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9665
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9666
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9667
	if (!(hBrush = GcDataGetBrush(hDC,gcData))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9668
	    DPRINTF(("fillPolygon: no brush\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9669
	} else {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9670
	    HPEN prevPen;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9671
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9672
	    prevPen = SelectObject(hDC, __nullPen);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9673
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  9674
	    BeginPath(hDC);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  9675
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9676
	    for (i=0; i<num; i++) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9677
		point = __AT_(aPolygon, __MKSMALLINT(i+1));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9678
		px = _point_X(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9679
		py = _point_Y(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9680
		if (i == 0) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9681
		    MoveToEx(hDC, __intVal(px), __intVal(py), NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9682
		} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9683
		    if (i == (num-1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9684
			p.x = __intVal(px);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9685
			p.y = __intVal(py);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9686
			PolylineTo(hDC, &p, 1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9687
		    } else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9688
			LineTo(hDC, __intVal(px), __intVal(py));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9689
		    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9690
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9691
	    }
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  9692
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  9693
	    EndPath(hDC);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  9694
	    FillPath(hDC);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9695
	    GcDataReleaseBrush(hDC, gcData);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9696
#ifdef CACHE_LAST_DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9697
	    SelectObject(hDC, prevPen);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9698
#endif
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9699
	}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9700
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9701
	_releaseDC(gcData);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  9702
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9703
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9704
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9705
fail: ;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9706
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9707
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9708
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9709
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9710
!WinWorkstation methodsFor:'event forwarding'!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9711
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  9712
activate:aBoolean view:aView
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  9713
    "some view was activated/deactivated.
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9714
     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
  9715
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  9716
    aBoolean ifFalse:[
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9717
	activeView := nil.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9718
	self focusOutView:aView.
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  9719
    ] ifTrue:[
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9720
	activeView := aView.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9721
	self focusInView:aView.
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  9722
    ].
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  9723
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  9724
    "Created: / 28.4.1999 / 14:51:51 / cg"
2599
9c0749ee47ed #activate:view: via sensor
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  9725
    "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
  9726
!
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  9727
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9728
configureX:x y:y width:w height:h view:aView
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9729
    "forward a configure for some view"
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9730
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9731
    "/ windows sends funny size changes (origin 3000@3000)
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9732
    "/ when the view is iconified.
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9733
    "/ ignore those ...
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9734
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9735
    aView realized ifTrue:[
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9736
	super configureX:x y:y width:w height:h view:aView
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9737
    ]
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9738
!
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9739
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9740
displayChange
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9741
    "the display metrics/settings have changed.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9742
     This is a speciality of windows.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9743
     TODO: Tell the viewStyle to update itself,
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9744
	   and tell all views to reinit their style.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9745
     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
  9746
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9747
    self initializeVariableScreenProperties.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9748
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9749
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9750
fontChange
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9751
    "the system fonts (users preferences) have changed.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9752
     This is a speciality of windows.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9753
     TODO: Tell the viewStyle to update itself,
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  9754
	   and tell all views to reinit their style.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9755
     For now,this is ignored."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9756
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  9757
    IgnoreFontChanges ~~ true ifTrue:[
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  9758
"/        'WinWorkstation [info]: fontChange ignored for now.' infoPrintCR
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  9759
    ]
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  9760
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  9761
    "Modified: / 19.5.1999 / 23:37:17 / cg"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9762
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9763
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9764
queryEndSession
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9765
    "system is about to be shut down.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9766
     This is a speciality of windows.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9767
     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
  9768
     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
  9769
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9770
    '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
  9771
    ^ true
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9772
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9773
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  9774
settingsChange
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  9775
    "some system settings (users preferences) have changed.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  9776
     This is a speciality of windows.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  9777
     For now, only a few attributes are reinitialized."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  9778
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  9779
    self initializeVariableSettingsProperties.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  9780
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  9781
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  9782
systemColorChange:aWindow
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9783
    "the system colors (users preferences) have changed.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9784
     This is a speciality of windows.
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  9785
     Tell the viewStyle to update itself,
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  9786
     and tell all view to reinit its style."
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  9787
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  9788
    |anyChange|
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  9789
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  9790
"/    'WinWorkstation [info]: systemColorChange for ' infoPrint.
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  9791
"/    aWindow printCR.
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  9792
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  9793
    IgnoreSysColorChanges ~~ true ifTrue:[
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9794
	"/ first check, if there was really a change
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9795
	"/ (when exceed is running, we get plenty of those messages ...)
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9796
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9797
	SystemColorValues isNil ifTrue:[
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9798
	    SystemColorValues := IdentityDictionary new.
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9799
	].
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9800
	anyChange := false.
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9801
	self supportedSystemColorKeys do:[:key |
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9802
	    |oldValue newValue|
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9803
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9804
	    oldValue := SystemColorValues at:key ifAbsent:nil.
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9805
	    newValue := self getSystemColor:key.
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9806
	    oldValue ~= newValue ifTrue:[
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9807
		SystemColorValues at:key put:newValue.
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9808
		anyChange := true.
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9809
	    ]
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9810
	].
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9811
	anyChange ifTrue:[
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9812
	    "/ TODO: this should go through the sensor ...
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9813
	    "/ ...and handled as an event by the views thread.
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9814
	    SimpleView readStyleSheetAndUpdateAllStyleCaches.
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9815
	    aWindow withAllSubViewsDo:[:aView |
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9816
		aView reinitStyle
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9817
	    ]
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  9818
	]
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  9819
    ]
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  9820
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  9821
    "Modified: / 10.9.1998 / 21:53:34 / cg"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9822
! !
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9823
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9824
!WinWorkstation methodsFor:'event handling'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9825
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9826
dispatchEventFor:aViewIdOrNil withMask:eventMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9827
    "central event handling method:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9828
     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
  9829
     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
  9830
     otherwise only events for the view with given id are processed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9831
     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
  9832
     handled.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9833
     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
  9834
	      pending event before calling this."
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9835
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9836
    (self getEventFor:aViewIdOrNil withMask:eventMask) ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9837
	AbortSignal handle:[:ex |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9838
	    ex return
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9839
	] do:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9840
	    self dispatchLastEvent.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9841
	]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9842
    ].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9843
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9844
    "Modified: 19.8.1997 / 17:10:42 / cg"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9845
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9846
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9847
dispatchExposeEventFor:aViewIdOrNil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9848
    "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
  9849
     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
  9850
     otherwise only events for the view with given id are processed."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9851
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9852
    self dispatchEventFor:aViewIdOrNil withMask:(self eventMaskFor:#expose)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9853
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9854
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9855
dispatchLastEvent
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9856
    |theView symS arg butt sibling windowID siblingID propertyID selectionID targetID requestorID
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9857
     eventType|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9858
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9859
%{  /* xxSTACK: 8000 */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9860
    struct queuedEvent *ev = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9861
    struct queuedEvent _ev_buf;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9862
    struct inlineCache *ipS;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9863
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9864
    static struct inlineCache vid = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9865
    static struct inlineCache conf = _ILC5;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9866
    static struct inlineCache skp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9867
    static struct inlineCache skr = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9868
    static struct inlineCache exp = _ILC5;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9869
    static struct inlineCache gexpS = _ILC6;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9870
    static struct inlineCache nexpS = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9871
    static struct inlineCache clr = _ILC5;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9872
    static struct inlineCache bp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9873
    static struct inlineCache br = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9874
    static struct inlineCache bmp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9875
    static struct inlineCache bsp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9876
    static struct inlineCache mot = _ILC4;
2733
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
  9877
    static struct inlineCache mwh = _ILC6;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9878
    static struct inlineCache unmap = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9879
    static struct inlineCache map = _ILC1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9880
    static struct inlineCache termS = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9881
    static struct inlineCache destr = _ILC1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9882
    static struct inlineCache setCurs = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9883
    static struct inlineCache focOut = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9884
    static struct inlineCache focIn = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9885
    static struct inlineCache act = _ILC2;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9886
    static struct inlineCache pe = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9887
    static struct inlineCache pl = _ILC2;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9888
    static struct inlineCache vis = _ILC1;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  9889
    static struct inlineCache sysClrChg = _ILC1;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9890
    static struct inlineCache fontChg = _ILC0;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  9891
    static struct inlineCache settingChg = _ILC0;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9892
    static struct inlineCache qEndSess = _ILC0;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9893
    static struct inlineCache powerDown = _ILC0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9894
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9895
    int x, y, w, h;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9896
    int keyCode, modifiers, isDoubleClick = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9897
    int isDown = 1;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  9898
    int state, dir;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9899
    OBJ upDown;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9900
    OBJ eB;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9901
    char nameBuffer[100];
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9902
    HWND hWnd = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9903
    DDPRINTF(("dispatchLast\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9904
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9905
    eB = __INST(eventBuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9906
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9907
    if (__isByteArray(eB)) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9908
	ev = (struct queuedEvent *)(__ByteArrayInstPtr(eB)->ba_element);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9909
    } else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9910
	fprintf(stderr, "WinWorkstation [error]: no eventBuffer\n");
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9911
	RETURN (false);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9912
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9913
    if (ev) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9914
	_ev_buf = *ev;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9915
	ev = &_ev_buf;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9916
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9917
    hWnd = ev->ev_hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9918
    if (!(hWnd /*&& IsWindow(hWnd)*/)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9919
	DPRINTF(("wrong hWnd in event in dispatchLastEvent\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9920
	RETURN (false);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9921
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9922
    {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9923
	OBJ t;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9924
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9925
	/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9926
	 * 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
  9927
	 * avoid creation & lookup then.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9928
	 */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9929
#if 1
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9930
	if ((t = __INST(lastId)) != nil) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9931
	    if (__isExternalAddress(t)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9932
		if (_HWNDVal(t) == hWnd) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9933
		    theView = __INST(lastView);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9934
		    if (__isNonNilObject(theView)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9935
			if (__qClass(theView) == nil) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9936
			    theView = nil;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9937
			}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9938
		    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9939
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9940
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9941
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9942
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9943
	if (theView == nil) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9944
	    windowID = __MKOBJ(ev->ev_hWnd);
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9945
	    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
  9946
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9947
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9948
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9949
    if (theView == nil) {
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9950
	DPRINTF(("nil view [hWnd=%x msg=0x%x] in dispatchEvent\n", 
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9951
		 ev->ev_hWnd, ev->ev_message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9952
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9953
	RETURN (false);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9954
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9955
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9956
    switch (ev->ev_message) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9957
	    case WM_WINDOWPOSCHANGED:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9958
		{
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  9959
		    RECT rct;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  9960
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  9961
		    x = ev->ev_x;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  9962
		    y = ev->ev_y;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  9963
		    w = ev->ev_w;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  9964
		    h = ev->ev_h;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  9965
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9966
		    DPRINTF((">>> WM_WINDOWPOSCHANGED -> configure %d/%d , %d/%d\n", x,y,w,h));
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  9967
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  9968
		    (*conf.ilc_func)(self,
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9969
				     @symbol(configureX:y:width:height:view:),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9970
				     nil, &conf,
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9971
				     __MKSMALLINT(x),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9972
				     __MKSMALLINT(y),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9973
				     __MKSMALLINT(w),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9974
				     __MKSMALLINT(h),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9975
				     theView);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9976
		}
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9977
		break;
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  9978
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  9979
	    case WM_DROPFILES:
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  9980
		{
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  9981
		  int i;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  9982
		  char buf[MAXPATH];
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  9983
		  HDROP hDrop = (HDROP)ev->ev_wParam;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  9984
		  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
  9985
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  9986
		  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
  9987
		  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
  9988
		      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
  9989
		      PRINTF(("Filename:%s\n",buf));
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  9990
		  }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  9991
		  DragFinish(hDrop);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  9992
		}
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  9993
		break;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9994
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9995
	    case WM_SHOWWINDOW:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9996
		if (ev->ev_wParam == TRUE) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9997
		    DPRINTF((">>> WM_SHOWWINDOW -> mappedView:\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9998
		    arg = @symbol(unobscured);
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9999
		    (*vis.ilc_func)(theView, 
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10000
				    @symbol(visibilityChange:), 
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10001
				    nil, &vis, arg);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10002
		    (*map.ilc_func)(self,
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10003
				    @symbol(mappedView:),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10004
				    nil, &map, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10005
		} else {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10006
		    DPRINTF((">>> WM_SHOWWINDOW -> unMappedView:\n"));
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10007
#if 0
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10008
		    arg = @symbol(fullyObscured);
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10009
		    (*vis.ilc_func)(theView, 
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10010
				    @symbol(visibilityChange:), 
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10011
				    nil, &vis, arg);
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10012
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10013
		    (*unmap.ilc_func)(self,
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10014
				      @symbol(unmappedView:),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10015
				      nil, &unmap, theView);
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10016
		}
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10017
		break;
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10018
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10019
	    case __WM_ICONIFIED:
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10020
		if (ev->ev_wParam) {
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10021
		    DPRINTF((">>> __WM_ICONIFIED -> unMappedView:\n"));
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10022
#if 0
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10023
		    arg = @symbol(fullyObscured);
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10024
		    (*vis.ilc_func)(theView, 
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10025
				    @symbol(visibilityChange:), 
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10026
				    nil, &vis, arg);
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10027
#endif
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10028
		    (*unmap.ilc_func)(self,
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10029
				      @symbol(unmappedView:),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10030
				      nil, &unmap, theView);
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10031
		} else {
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10032
		    DPRINTF((">>> __WM_DEICONIFIED -> mappedView:\n"));
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10033
		    arg = @symbol(unobscured);
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10034
		    (*vis.ilc_func)(theView, 
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10035
				    @symbol(visibilityChange:), 
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10036
				    nil, &vis, arg);
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10037
		    (*map.ilc_func)(self,
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10038
				    @symbol(mappedView:),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10039
				    nil, &map, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10040
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10041
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10042
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10043
	    case WM_CLOSE:
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10044
		DPRINTF((">>> WM_CLOSE -> terminateView:\n"));
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10045
		(*termS.ilc_func)(self,
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10046
				  @symbol(terminateView:), 
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10047
				  nil, &termS, theView);
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10048
		break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10049
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10050
	    case WM_DESTROY:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10051
		DPRINTF((">>> WM_DESTROY -> destroyedView\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10052
		(*destr.ilc_func)(self,
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10053
				  @symbol(destroyedView:),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10054
				  nil, &destr, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10055
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10056
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10057
	    case WM_ACTIVATE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10058
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10059
		switch (LOWORD(ev->ev_wParam)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10060
		    case WA_INACTIVE:
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10061
			DPRINTF((">>> WM_ACTIVATE inactive h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10062
			(*act.ilc_func)(self,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10063
					@symbol(activate:view:),
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10064
					nil, &act,
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10065
					false, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10066
			break;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10067
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10068
		    case WA_ACTIVE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10069
		    case WA_CLICKACTIVE:
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10070
			DPRINTF((">>> WM_ACTIVATE active h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10071
			(*act.ilc_func)(self,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10072
					@symbol(activate:view:),
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10073
					nil, &act,
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10074
					true, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10075
			break;
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10076
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10077
		    default:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10078
			break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10079
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10080
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10081
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10082
	    case WM_MOUSEACTIVATE:
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10083
		DPRINTF((">>> WM_MOUSEACTIVATE h=%x -> focusInView:\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10084
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10085
		(*focIn.ilc_func)(self,
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10086
				  @symbol(focusInView:),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10087
				  nil, &focIn, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10088
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10089
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10090
	    case WM_SETFOCUS:
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10091
		DPRINTF((">>> WM_SETFOCUS h=%x -> focusInView:\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10092
		(*focIn.ilc_func)(self,
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10093
				  @symbol(focusInView:),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10094
				  nil, &focIn, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10095
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10096
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10097
	    case WM_KILLFOCUS:
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10098
		DPRINTF((">>> WM_KILLFOCUS h=%x -> focusOutOfView\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10099
		(*focOut.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10100
				   @symbol(focusOutView:),
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10101
				   nil, &focOut, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10102
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10103
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10104
	    case __WM_GEXPOSE:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10105
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10106
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10107
		w = ev->ev_w;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10108
		h = ev->ev_h;
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10109
		DPRINTF((">>> __WM_GEXPOSE -> gExpose %d/%d -> %d/%d\n", x, y, w, h));
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 10110
#if 0
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10111
		if (GetWindow_unmapping(hWnd)) {
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10112
		    fprintf(stderr, "oops - WM_MOUSEENTER for unmapping\n");
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10113
		}
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 10114
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10115
		(*gexpS.ilc_func)(self,
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10116
				  @symbol(graphicsExposeX:y:width:height:final:view:), 
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10117
				  nil, &gexpS,
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10118
				  __MKSMALLINT(x),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10119
				  __MKSMALLINT(y),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10120
				  __MKSMALLINT(w),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10121
				  __MKSMALLINT(h),
2705
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
 10122
				  ev->ev_wParam ? true : false, 
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
 10123
				  theView);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10124
		break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10125
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10126
	    case __WM_NOGEXPOSE:
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10127
		DPRINTF((">>> __WM_NOGEXPOSE -> noExpose\n"));
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 10128
#if 0
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10129
		if (GetWindow_unmapping(hWnd)) {
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10130
		    fprintf(stderr, "oops - WM_MOUSEENTER for unmapping\n");
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10131
		}
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 10132
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10133
		 (*nexpS.ilc_func)(self,
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10134
				   @symbol(noExposeView:), nil, &nexpS,
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10135
				   theView);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10136
		break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10137
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10138
# ifdef LATE_GENERATE_EXPOSE
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10139
	    case __WM_PAINT:
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10140
		{
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10141
		    PAINTSTRUCT ps;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10142
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 10143
		    AQUIRE_DRAW_MUTEX
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10144
		    __generateExposes(hWnd, NULL, WM_PAINT, 0);
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 10145
		    RELEASE_DRAW_MUTEX
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 10146
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10147
# if 0
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10148
		    BeginPaint(hWnd, &ps);
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10149
		    EndPaint(hWnd, &ps);
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10150
# endif
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10151
		}
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10152
		break;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10153
# endif
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10154
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10155
	    case WM_PAINT:
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
 10156
		x = ev->ev_x;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
 10157
		y = ev->ev_y;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
 10158
		w = ev->ev_w;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
 10159
		h = ev->ev_h;
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10160
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 10161
#if 0
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10162
		if (GetWindow_unmapping(hWnd)) {
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10163
		    fprintf(stderr, "oops - WM_MOUSEENTER for unmapping\n");
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10164
		}
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 10165
#endif
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 10166
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 10167
#ifndef PRE_21_NOV
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
 10168
		__clearWindow(hWnd, x, y, w, h);
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 10169
#else
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 10170
# if WM_PAINT_CLEAR_LATE
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 10171
		__clearWindow(hWnd, x, y, w, h);
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 10172
# endif
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 10173
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 10174
#endif
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 10175
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10176
#ifdef DEBUG_COLORIZE_WM_PAINT_RECTS2
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10177
		{
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10178
		    HDC hDC;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10179
		    HBRUSH hBrush;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10180
		    RECT rect;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10181
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10182
		    hBrush = CreateSolidBrush(BlackPixel);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10183
		    hDC = GetWindowDC(hWnd);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10184
		    SelectClipRgn(hDC, NULL);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10185
		    rect.left = x;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10186
		    rect.top = y;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10187
		    rect.right = x+w;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10188
		    rect.bottom = y+h;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10189
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10190
		    FillRect(hDC, &rect, hBrush);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10191
		    _DeleteBrush(hBrush, __LINE__);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10192
		    ReleaseDC(hWnd, hDC);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10193
		}
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10194
#endif
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10195
		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
 10196
		(*exp.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10197
			 @symbol(exposeX:y:width:height:view:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10198
			 nil, &exp,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10199
			 __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10200
			 __MKSMALLINT(y),
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
 10201
			 __MKSMALLINT(w),
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
 10202
			 __MKSMALLINT(h),
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10203
			 theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10204
		break;
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
	    case WM_LBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10207
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10208
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10209
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10210
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10211
	    case WM_LBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10212
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10213
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10214
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10215
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10216
	    case WM_LBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10217
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10218
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10219
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10220
	    case WM_MBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10221
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10222
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10223
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10224
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10225
	    case WM_MBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10226
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10227
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10228
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10229
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10230
	    case WM_MBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10231
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10232
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10233
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10234
	    case WM_RBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10235
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10236
		butt = __MKSMALLINT(Button3);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10237
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10238
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10239
	    case WM_RBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10240
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10241
		butt = __MKSMALLINT(Button3);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10242
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10243
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10244
	    case WM_RBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10245
		butt = __MKSMALLINT(Button3);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10246
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10247
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10248
	    commonButtonDown:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10249
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10250
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10251
		modifiers = ev->ev_modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10252
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10253
		if (__INST(buttonTranslation) != nil) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10254
		    butt = __AT_(__INST(buttonTranslation), butt);
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
		arg = butt;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10257
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10258
		__INST(altDown) = (modifiers & AltMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10259
		__INST(metaDown) = (modifiers & MetaMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10260
		__INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10261
		__INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10262
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10263
		if (deltaDoubleClickX == -999) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10264
		    deltaDoubleClickX = GetSystemMetrics(SM_CXDOUBLECLK);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10265
		    deltaDoubleClickY = GetSystemMetrics(SM_CYDOUBLECLK);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10266
		}
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10267
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10268
		if (isDoubleClick) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10269
		    multiClickState = 1;
2683
934d038b270f initialize multiClickTime from settings, but use instVar
Claus Gittinger <cg@exept.de>
parents: 2682
diff changeset
 10270
		    nextMultiClickTime = ev->ev_time + __intVal(__INST(multiClickTimeDelta));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10271
		    ipS = &bmp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10272
		    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
 10273
		} else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10274
		    if (isDown) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10275
			if (multiClickState 
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10276
			 && (ev->ev_time < nextMultiClickTime)
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10277
			 && (x >= (lastClickX - (deltaDoubleClickX / 2)))
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10278
			 && (x <= (lastClickX + (deltaDoubleClickX / 2)))
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10279
			 && (y >= (lastClickY - (deltaDoubleClickY / 2)))
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10280
			 && (y <= (lastClickY + (deltaDoubleClickY / 2)))
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10281
			) {
2683
934d038b270f initialize multiClickTime from settings, but use instVar
Claus Gittinger <cg@exept.de>
parents: 2682
diff changeset
 10282
			    nextMultiClickTime = ev->ev_time + __intVal(__INST(multiClickTimeDelta));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10283
			    ipS = &bmp;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10284
			    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
 10285
			} else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10286
			    multiClickState = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10287
			    ipS = &bp;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10288
			    symS = @symbol(buttonPress:x:y:view:);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10289
			}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10290
		    } else {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10291
			ipS = &br;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10292
			symS = @symbol(buttonRelease:x:y:view:);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10293
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10294
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10295
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10296
		if (isDown || isDoubleClick) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10297
		    lastClickX = x;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10298
		    lastClickY = y;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10299
		}
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10300
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10301
		if (__isSymbol(arg)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10302
		    DPRINTF(("buttonPress/buttonRelease: %s %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10303
				__stringVal(arg), x, y));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10304
		} else {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10305
		    DPRINTF(("buttonPress/buttonRelease: %d %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10306
				__intVal(arg), x, y));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10307
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10308
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10309
		(*(*ipS).ilc_func)(self, symS, nil, ipS,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10310
				   arg,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10311
				   __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10312
				   __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10313
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10314
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10315
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10316
	    case __WM_MOUSEENTER:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10317
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10318
		y = ev->ev_y;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10319
		state = ev->ev_modifiers;
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
 10320
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10321
#ifdef DEBUG_WM_MOUSEENTER
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10322
		PRINTF((">>> WM_MOUSEENTER: %x %d/%d state:%x\n", ev->ev_hWnd, x, y, state));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10323
#else
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10324
		DPRINTF((">>> WM_MOUSEENTER: %d/%d %x\n", x, y, state));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10325
#endif
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 10326
#if 0
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10327
		if (GetWindow_unmapping(hWnd)) {
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10328
		    fprintf(stderr, "oops - WM_MOUSEENTER for unmapping\n");
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10329
		}
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 10330
#endif
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10331
		(*pe.ilc_func)(self, @symbol(pointerEnter:x:y:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10332
				    nil, &pe,
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10333
				    __MKSMALLINT(state),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10334
				    __MKSMALLINT(x),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10335
				    __MKSMALLINT(y),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10336
				    theView);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10337
		break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10338
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10339
	    case __WM_MOUSELEAVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10340
		state = ev->ev_modifiers;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10341
#ifdef DEBUG_WM_MOUSELEAVE
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10342
		PRINTF((">>> WM_MOUSELEAVE: %x state:%x\n", ev->ev_hWnd, state));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10343
#else
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10344
		DPRINTF((">>> WM_MOUSELEAVE: %x\n", state));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10345
#endif
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 10346
#if 0
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10347
		if (GetWindow_unmapping(hWnd)) {
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10348
		    fprintf(stderr, "oops - WM_MOUSEENTER for unmapping\n");
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 10349
		}
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 10350
#endif
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10351
		(*pl.ilc_func)(self, @symbol(pointerLeave:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10352
				    nil, &pl,
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10353
				    __MKSMALLINT(state),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10354
				    theView);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10355
		break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10356
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10357
	    case WM_MOUSEMOVE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10358
		x = ev->ev_x;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10359
		y = ev->ev_y;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10360
		state = ev->ev_modifiers;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10361
		DPRINTF((">>> WM_MOUSEMOVE: %d/%d %x\n", x, y, state));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10362
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10363
		(*mot.ilc_func)(self, @symbol(buttonMotion:x:y:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10364
				    nil, &mot,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10365
				    __MKSMALLINT(state),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10366
				    __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10367
				    __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10368
				    theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10369
		break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10370
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10371
#ifdef WM_MOUSEWHEEL
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10372
	    case WM_MOUSEWHEEL:
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10373
		state = ev->ev_modifiers;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10374
		dir = ev->ev_wParam;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10375
		DPRINTF((">>> WM_MOUSEWHEEL: %d %x\n", dir, state));
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10376
2733
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
 10377
		(*mwh.ilc_func)(self, @symbol(mouseWheelMotion:x:y:amount:deltaTime:view:),
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10378
				    nil, &mwh,
2733
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
 10379
				    __MKSMALLINT(state),
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
 10380
				    __MKSMALLINT(x),
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
 10381
				    __MKSMALLINT(y),
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10382
				    __MKSMALLINT(dir),
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10383
				    __MKUINT(ev->ev_time),
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10384
				    theView);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10385
		break;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10386
#endif
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10387
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10388
	    case WM_CHAR:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10389
		DPRINTF((">>> WM_CHAR: %d/%d\n", x, y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10390
		symS = @symbol(keyPress:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10391
		ipS = &skp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10392
		upDown = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10393
		goto keyPressAndRelease;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10394
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10395
	    case WM_SYSKEYUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10396
	    case WM_KEYUP:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10397
		DPRINTF((">>> WM_KEYUP / SYSKEYUP: %d/%d\n", x, y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10398
		symS = @symbol(keyRelease:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10399
		ipS = &skr;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10400
		upDown = false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10401
		goto keyPressAndRelease;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10402
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10403
	    case WM_SYSKEYDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10404
	    case WM_KEYDOWN:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10405
		DPRINTF((">>> WM_KEYDOWN / SYSKEYDOWN: %d/%d\n", x, y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10406
		symS = @symbol(keyPress:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10407
		ipS = &skp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10408
		upDown = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10409
		/* FALL INTO */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10410
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10411
	    keyPressAndRelease: ;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10412
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10413
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10414
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10415
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10416
#ifdef NOTDEF
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10417
		{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10418
		    BYTE vKeyState[256];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10419
		    char buff[5];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10420
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10421
		    GetKeyboardState(vKeyState);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10422
		    ToAscii(ev->ev_keyCode, ev->ev_scanCode, vKeyState, &buff; 0);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10423
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10424
#endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10425
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10426
		keyCode = ev->ev_keyCode;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10427
		modifiers = ev->ev_modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10428
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10429
		if (modifiers & TRANSLATED_KEY) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10430
		    if (modifiers & ControlMask) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10431
			if (keyCode < 0x20) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10432
			    keyCode = keyCode + 'a' - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10433
			    if (modifiers & ShiftMask) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10434
				keyCode = keyCode - 'a' + 'A';
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10435
			    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10436
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10437
		    } else if (modifiers & (MetaMask | AltMask)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10438
			if (! (modifiers & ShiftMask)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10439
			    if ((keyCode >= 'A') && (keyCode <= 'Z')) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10440
				keyCode = keyCode - 'A' + 'a';
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10441
			    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10442
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10443
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10444
		    arg = __MKCHARACTER(keyCode & 0xFF);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10445
		} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10446
		    switch (keyCode) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10447
			case VK_F1:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10448
			    arg = @symbol(F1);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10449
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10450
			case VK_F2:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10451
			    arg = @symbol(F2);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10452
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10453
			case VK_F3:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10454
			    arg = @symbol(F3);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10455
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10456
			case VK_F4:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10457
			    arg = @symbol(F4);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10458
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10459
			case VK_F5:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10460
			    arg = @symbol(F5);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10461
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10462
			case VK_F6:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10463
			    arg = @symbol(F6);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10464
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10465
			case VK_F7:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10466
			    arg = @symbol(F7);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10467
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10468
			case VK_F8:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10469
			    arg = @symbol(F8);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10470
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10471
			case VK_F9:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10472
			    arg = @symbol(F9);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10473
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10474
			case VK_F10:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10475
			    arg = @symbol(F10);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10476
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10477
			case VK_F11:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10478
			    arg = @symbol(F11);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10479
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10480
			case VK_F12:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10481
			    arg = @symbol(F12);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10482
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10483
			case VK_PRIOR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10484
			    arg = @symbol(Prior);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10485
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10486
			case VK_NEXT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10487
			    arg = @symbol(Next);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10488
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10489
			case VK_END:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10490
			    arg = @symbol(End);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10491
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10492
			case VK_HOME:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10493
			    arg = @symbol(Home);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10494
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10495
			case VK_LEFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10496
			    arg = @symbol(CursorLeft);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10497
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10498
			case VK_RIGHT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10499
			    arg = @symbol(CursorRight);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10500
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10501
			case VK_UP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10502
			    arg = @symbol(CursorUp);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10503
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10504
			case VK_DOWN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10505
			    arg = @symbol(CursorDown);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10506
			    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10507
			case VK_MENU:  /*alt key with w95 ???*/
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10508
			    arg = @symbol(Menu);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10509
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10510
			case VK_LMENU:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10511
			    arg = @symbol(Menu_L);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10512
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10513
			case VK_RMENU:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10514
			    arg = @symbol(Menu_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10515
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10516
			case VK_PAUSE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10517
			    arg = @symbol(Pause);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10518
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10519
			case VK_HELP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10520
			    arg = @symbol(Help);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10521
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10522
			case VK_EXECUTE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10523
			    arg = @symbol(Execute);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10524
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10525
			case VK_CANCEL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10526
			    arg = @symbol(Cancel);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10527
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10528
			case VK_SELECT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10529
			    arg = @symbol(Select);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10530
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10531
			case VK_PRINT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10532
			    arg = @symbol(Print);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10533
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10534
			case VK_SNAPSHOT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10535
			    arg = @symbol(Snapshot);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10536
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10537
			case VK_INSERT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10538
			    arg = @symbol(Insert);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10539
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10540
			case VK_DELETE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10541
			    arg = @symbol(Delete);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10542
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10543
			case VK_BACK:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10544
			    arg = @symbol(BackSpace);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10545
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10546
			case VK_LWIN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10547
			    arg = @symbol(Win_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10548
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10549
			case VK_RWIN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10550
			    arg = @symbol(Win_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10551
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10552
			case VK_APPS:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10553
			    arg = @symbol(Appl);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10554
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10555
			case VK_NUMPAD0:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10556
			    arg = @symbol(KeyPad0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10557
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10558
			case VK_NUMPAD1:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10559
			    arg = @symbol(KeyPad1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10560
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10561
			case VK_NUMPAD2:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10562
			    arg = @symbol(KeyPad2);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10563
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10564
			case VK_NUMPAD3:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10565
			    arg = @symbol(KeyPad3);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10566
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10567
			case VK_NUMPAD4:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10568
			    arg = @symbol(KeyPad4);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10569
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10570
			case VK_NUMPAD5:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10571
			    arg = @symbol(KeyPad5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10572
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10573
			case VK_NUMPAD6:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10574
			    arg = @symbol(KeyPad6);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10575
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10576
			case VK_NUMPAD7:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10577
			    arg = @symbol(KeyPad7);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10578
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10579
			case VK_NUMPAD8:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10580
			    arg = @symbol(KeyPad8);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10581
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10582
			case VK_NUMPAD9:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10583
			    arg = @symbol(KeyPad9);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10584
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10585
			case VK_LSHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10586
			    arg = @symbol(Shift_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10587
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10588
			case VK_RSHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10589
			    arg = @symbol(Shift_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10590
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10591
			case VK_LCONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10592
			    arg = @symbol(Ctrl_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10593
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10594
			case VK_RCONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10595
			    arg = @symbol(Ctrl_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10596
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10597
			case VK_CONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10598
			    arg = @symbol(Ctrl);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10599
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10600
			case VK_SHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10601
			    arg = @symbol(Shift);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10602
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10603
			case VK_TAB:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10604
			    arg = @symbol(Tab);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10605
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10606
			case VK_ESCAPE:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10607
			    arg = @symbol(Escape);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10608
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10609
			case VK_NUMLOCK:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10610
			    arg = @symbol(NumLock);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10611
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10612
			case VK_SCROLL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10613
			    arg = @symbol(ScrollLock);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10614
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10615
			case VK_RETURN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10616
			    arg = @symbol(Return);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10617
			    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10618
			default:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10619
			    nameBuffer[0] = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10620
			    /*GetKeyNameText(ev->ev_scanCode, nameBuffer, sizeof(nameBuffer));*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10621
			    DPRINTF(("char is <%d>\n", keyCode));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10622
			    arg = __MKCHARACTER(keyCode & 0xFF);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10623
			    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10624
		    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10625
		 }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10626
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10627
		DPRINTF(("%s: code=%x mod=%x\n", __stringVal(symS),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10628
				keyCode, modifiers));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10629
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10630
		__INST(altDown) = (modifiers & AltMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10631
		__INST(metaDown) = (modifiers & MetaMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10632
		__INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10633
		__INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10634
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10635
		(*(*ipS).ilc_func)(self, symS, nil, ipS,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10636
				   arg,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10637
				   __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10638
				   __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10639
				   theView);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10640
		break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10641
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10642
	   case WM_SYSCOLORCHANGE:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10643
		DPRINTF((">>> WM_SYSCOLORCHANGE\n"));
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
 10644
		(*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
 10645
		break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10646
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10647
	   case WM_FONTCHANGE:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10648
		DPRINTF((">>> WM_FONTCHANGE\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10649
		(*fontChg.ilc_func)(self, @symbol(fontChange), nil, &fontChg);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10650
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10651
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 10652
	   case WM_WININICHANGE:
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 10653
		DPRINTF((">>> WM_WININICHANGE\n"));
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 10654
		(*settingChg.ilc_func)(self, @symbol(settingsChange), nil, &settingChg);
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 10655
		break;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 10656
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10657
	   case WM_DISPLAYCHANGE:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10658
		DPRINTF((">>> WM_DISPLAYCHANGE\n"));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10659
		(*fontChg.ilc_func)(self, @symbol(displayChange), nil, &fontChg);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10660
		break;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10661
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10662
	   case WM_QUERYENDSESSION:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10663
		DPRINTF((">>> WM_QUERYENDSESSION\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10664
		(*qEndSess.ilc_func)(self, @symbol(queryEndSession), nil, &qEndSess);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10665
		break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10666
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10667
#ifdef LATER
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10668
	   case WM_POWER:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10669
		DPRINTF((">>> WM_POWER\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10670
		(*power.ilc_func)(self, @symbol(powerDown), nil, &power);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10671
	       break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10672
#endif
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10673
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10674
	    default:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 10675
		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
 10676
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10677
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10678
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10679
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10680
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10681
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10682
dispatchPendingEvents
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10683
    "central event handling method for modal operation.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10684
     (i.e. this is now only used in the modal debugger)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10685
     Dispatch any pending events; return when no more are pending.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10686
     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
 10687
     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
 10688
     we only handle exposes until the graphicsExpose arrives.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10689
     Other systems may not need such a kludge"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10690
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10691
    [self eventPendingWithSync:false] whileTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10692
	(self getEventFor:nil withMask:nil) ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10693
	    AbortSignal handle:[:ex |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10694
		ex return
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10695
	    ] do:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10696
		self dispatchLastEvent
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10697
	    ]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10698
	].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10699
    ]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10700
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10701
    "Modified: 19.8.1997 / 17:11:18 / cg"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10702
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10703
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10704
disposeEventsWithMask:aMask for:aWindowIdOrNil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10705
    "dispose (throw away) specific events. If aWindowId is nil,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10706
     events matching the mask are thrown away regardless of which
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10707
     view they are for. Otherwise, only matching events for that
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10708
     view are flushed."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10709
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10710
%{  /* NOCONTEXT */
2733
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
 10711
   DPRINTF(("WinWorkstation: disposeEventsWithMask:for: not yet implemented.\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10712
   RETURN ( self );
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10713
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10714
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10715
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10716
eventMaskFor:anEventSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10717
    "return the eventMask bit-constant corresponding to an event symbol"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10718
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10719
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10720
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10721
    int m = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10722
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10723
    if (anEventSymbol == @symbol(keyPress)) m = KeyPressMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10724
    else if (anEventSymbol == @symbol(keyRelease)) m = KeyReleaseMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10725
    else if (anEventSymbol == @symbol(buttonPress)) m = ButtonPressMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10726
    else if (anEventSymbol == @symbol(buttonRelease)) m = ButtonReleaseMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10727
    else if (anEventSymbol == @symbol(buttonMotion)) m = ButtonMotionMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10728
    else if (anEventSymbol == @symbol(pointerMotion)) m = PointerMotionMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10729
    else if (anEventSymbol == @symbol(expose)) m = ExposureMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10730
    else if (anEventSymbol == @symbol(focusChange)) m = FocusChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10731
    else if (anEventSymbol == @symbol(enter)) m = EnterWindowMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10732
    else if (anEventSymbol == @symbol(leave)) m = LeaveWindowMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10733
    else if (anEventSymbol == @symbol(keymapState)) m = KeymapStateMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10734
    else if (anEventSymbol == @symbol(visibilityChange)) m = VisibilityChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10735
    else if (anEventSymbol == @symbol(structureNotify)) m = StructureNotifyMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10736
    else if (anEventSymbol == @symbol(resizeRedirect)) m = ResizeRedirectMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10737
    else if (anEventSymbol == @symbol(propertyChange)) m = PropertyChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10738
    else if (anEventSymbol == @symbol(colormapChange)) m = ColormapChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10739
    RETURN (__MKSMALLINT(m));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10740
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10741
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10742
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10743
eventPending
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10744
    "return true, if any event is pending.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10745
     This looks for both the internal queue and the display connection."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10746
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10747
    ^ self eventPendingWithSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10748
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10749
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10750
eventPending:anEventSymbol for:aWindowIdOrNil
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10751
    "return true, if a specific event is pending"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10752
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10753
    ^ self eventsPending:(self eventMaskFor:anEventSymbol) for:aWindowIdOrNil withSync:false
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
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10756
eventPendingWithSync:doSync
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10757
    "return true, if any event is pending.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10758
     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
 10759
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10760
    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
 10761
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 10762
%{
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10763
    if (hasEventQueued()) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10764
	RETURN (true);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10765
    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 10766
%}.
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10767
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10768
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10769
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10770
eventQueued
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10771
    "return true, if any event is queued"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10772
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10773
    ^ self eventQueuedAlready
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10774
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10775
    "Created: 12.12.1995 / 21:43:00 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10776
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10777
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10778
eventQueuedAlready
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10779
    "return true, if any event is queued internally.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10780
     (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
 10781
      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
 10782
      the display connection)."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10783
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 10784
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10785
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10786
    DDPRINTF(("peek q - "));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10787
    if (hasEventQueued()) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10788
	DDPRINTF(("true\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10789
	RETURN (true);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10790
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10791
    DDPRINTF(("false\n"));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10792
%}.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10793
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10794
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10795
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10796
eventsPending:anEventMask for:aWindowIdOrNil withSync:doSync
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
 10797
    "return true, if any of the masked events is pending.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
 10798
     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
 10799
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10800
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10801
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10802
    DDPRINTF(("eventsPending mask %x - not implemented\n", __intVal(anEventMask)));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10803
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10804
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10805
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10806
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10807
exposeEventPendingFor:aWindowIdOrNil withSync:doSync
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10808
    "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
 10809
     or any view (if the arg is nil).
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
 10810
     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
 10811
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10812
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10813
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10814
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10815
getEventFor:aViewIdOrNil withMask:eventMask
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10816
    "read next event - put into local eventBuffer.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10817
     If aViewIdOrNil is nil, events for any view are fetched;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10818
     otherwise only events for that specific view will be fetched.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10819
     Returns true, if there was an event, false otherwise."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10820
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 10821
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10822
    HWND win, wWanted;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10823
    int evMask;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10824
    OBJ eB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10825
    struct queuedEvent *ev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10826
    struct queuedEvent *qev;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10827
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10828
    eB = __INST(eventBuffer);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10829
    if (! __isByteArray(eB)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10830
	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
 10831
	/* RETURN (false); */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10832
    } else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10833
	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
 10834
	ev->ev_message = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10835
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10836
	if (__isSmallInteger(eventMask)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10837
	    evMask = __intVal(eventMask);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10838
	} else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10839
	    evMask = ~0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10840
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10841
	if (__isExternalAddress(aViewIdOrNil)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10842
	    wWanted = _HWNDVal(aViewIdOrNil);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10843
	} else{
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10844
	    wWanted = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10845
	}
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
 10846
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10847
	do { /* only to allow continue */
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10848
	    if (deqEvent(ev, wWanted, evMask)) {
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 10849
#ifdef COMPRESS_WINDOWPOSCHANGED
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10850
		if ((ev->ev_hWnd == lastPos_win)
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10851
		 && (ev->ev_message == WM_WINDOWPOSCHANGED)
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 10852
		 && ((ev->ev_x != lastPos_x)
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 10853
		     || (ev->ev_y != lastPos_y)
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 10854
		     || (ev->ev_w != lastPos_w)
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 10855
		     || (ev->ev_h != lastPos_h))) {
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10856
		    /*
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 10857
		     * ignore intermediate resize events
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 10858
		     * (that event is an intermediate one, because the peek-values
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 10859
		     *  have already been updated for another event)
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10860
		     */
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 10861
		    EVENT_PRINTF(("ignored WINDOWPOSCHANGED (%d:%d / %d:%d / %d:%d / %d:%d\n",
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 10862
				  ev->ev_x, lastPos_x,
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 10863
				  ev->ev_y, lastPos_y,
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 10864
				  ev->ev_w, lastPos_w,
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 10865
				  ev->ev_h, lastPos_h ));
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10866
		    continue;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10867
		}
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 10868
#endif
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10869
		RETURN ( true );
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10870
	    }
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10871
	} while (0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10872
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10873
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10874
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10875
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10876
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10877
handleAllEvents
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10878
    "from now on, handle any kind of event.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10879
     Always with win32."
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10880
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10881
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10882
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10883
handleExposeOnlyFor:aView
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10884
    "from now on, handle expose events only.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10885
     Never with win32."
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10886
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10887
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10888
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10889
setEventMask:aMask in:aWindowId
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10890
    "tell the display, that we are only interested in events from aMask, which
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 10891
     is the bitwise-or of the eventMask bits (see 'eventMaskFor:')"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10892
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10893
%{  /* NOCONTEXT */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10894
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10895
    if (__isExternalAddress(aWindowId)
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10896
     && __isSmallInteger(aMask)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10897
	HWND hWnd = _HWNDVal(aWindowId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10898
	int mask = __intVal(aMask);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10899
	localWindowInfo *lI;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10900
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10901
	if (lI = GETLOCALWINDOWINFOPTR(hWnd)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10902
#ifdef DEBUGMASK
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10903
	    PRINTF(("new eventMask %x\n",mask));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10904
	    printMask(mask);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10905
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10906
	    lI->eventMask = mask;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10907
	    RETURN ( self );
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10908
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10909
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10910
%}.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 10911
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10912
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10913
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10914
!WinWorkstation methodsFor:'event sending'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10915
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10916
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
 10917
    "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
 10918
     TypeSymbol must be one of: #keyPress, #keyRelease, #buttonPress , #buttonRelease.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10919
     For buttonEvents, the keySymCodeOrButtonNr must be the buttons number (1, 2 ...);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10920
     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
 10921
     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
 10922
     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
 10923
     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
 10924
     (not very user friendly)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10925
2672
81c4e65507df *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
 10926
    'WinWorkstation [warning]: sendKeyOrButtonEvent unimplemented' infoPrintCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10927
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10928
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10929
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10930
!WinWorkstation methodsFor:'font stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10931
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10932
createFontFor:aFontName
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10933
    "a basic method for font allocation; this method allows
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10934
     any font to be aquired (even those not conforming to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10935
     standard naming conventions, such as cursor, fixed or k14)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10936
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 10937
%{  
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10938
    HGDIOBJ hFont;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10939
    char *fn;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10940
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10941
    if (__isString(aFontName) || __isSymbol(aFontName)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10942
	fn = __stringVal(aFontName);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10943
	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
 10944
	    hFont = GetStockObject(ANSI_FIXED_FONT);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10945
	} 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
 10946
	    hFont = GetStockObject(ANSI_VAR_FONT);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10947
	} else if ((strcmp(fn, "system") == 0) || (strcmp(fn, "SYSTEM_FONT") == 0)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10948
	    hFont = GetStockObject(SYSTEM_FONT);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10949
	} 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
 10950
	    hFont = GetStockObject(SYSTEM_FIXED_FONT);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 10951
	} 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
 10952
	    hFont = GetStockObject(DEVICE_DEFAULT_FONT);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10953
	} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10954
	    hFont = GetStockObject(ANSI_FIXED_FONT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10955
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10956
	if (hFont) {
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10957
	    DPRINTF(("createFontFor:%s -> %x\n", fn, hFont));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10958
	    RETURN ( __MKOBJ(hFont) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10959
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10960
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10961
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10962
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10963
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10964
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 10965
fontDescriptionFromLogicalFontInfoArray:anInfoArray
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 10966
    |fntDescr family face style logicalSize pointSize encoding|
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 10967
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 10968
    family := anInfoArray at:16.
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 10969
    face   := anInfoArray at:6.
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 10970
    style  := anInfoArray at:15.
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 10971
    logicalSize   := anInfoArray at:1.
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 10972
    encoding := anInfoArray at:17.
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 10973
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 10974
    logicalSize := logicalSize abs.
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 10975
    "/ convert from device to point size
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 10976
    pointSize := (logicalSize / self getLogicalPixelSizeY * 72.0).
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 10977
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 10978
    fntDescr := FontDescription
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 10979
		    family:family
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 10980
		    face:face
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 10981
		    style:style
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 10982
		    size:pointSize
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 10983
		    encoding:encoding.
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 10984
    ^ fntDescr.
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 10985
!
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 10986
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 10987
fontMetricsOf:fontId
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 10988
    "return a fonts metrics info object"
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 10989
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 10990
    |rawData info|
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10991
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 10992
    rawData := Array new:10.
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 10993
    (self primFontMetricsOf:fontId intoArray:rawData) isNil ifTrue:[
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10994
	self primitiveFailed.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10995
	^ self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10996
    ].
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 10997
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 10998
    info := DeviceWorkstation::DeviceFontMetrics new.
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 10999
    info
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 11000
      ascent:(rawData at:1)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 11001
      descent:(rawData at:2)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 11002
      maxAscent:(rawData at:3)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 11003
      maxDescent:(rawData at:4)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 11004
      minWidth:(rawData at:5)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 11005
      maxWidth:(rawData at:6)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 11006
      avgWidth:(rawData at:7).
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 11007
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 11008
    ^ info
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11009
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11010
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11011
fontsInFamily:aFamilyName face:aFaceName filtering:filter
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11012
    "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
 11013
     On WinWorkStations there is curently Face
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11014
     But only thise matching filter (if nonNil)."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11015
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11016
    |allFonts fonts|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11017
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11018
    allFonts := self listOfAvailableFonts.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11019
    allFonts isNil ifTrue:[^ nil].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11020
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11021
    fonts := Set new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11022
    allFonts do:[:fntDescr |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11023
	(aFamilyName sameAs:(fntDescr family)) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11024
	    (filter isNil or:[filter value:fntDescr]) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11025
		fonts add:fntDescr
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11026
	    ]
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11027
	]
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11028
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11029
    ^ fonts
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11030
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11031
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11032
fontsInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11033
    "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
 11034
     on this display.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11035
     On WinWorkStations there is curently no style or Face
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11036
     But only those matching filter (if nonNIl)."
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11037
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11038
    |allFonts fonts|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11039
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11040
    allFonts := self listOfAvailableFonts.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11041
    allFonts isNil ifTrue:[^ nil].
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11042
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11043
    fonts := Set new.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11044
    allFonts do:[:fntDescr |
4000
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11045
	(aFamilyName sameAs:(fntDescr family)) ifTrue:[
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11046
	    (aFaceName sameAs:(fntDescr face)) ifTrue:[
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11047
		(aStyleName sameAs:(fntDescr style)) ifTrue:[
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11048
		    (filter isNil or:[filter value:fntDescr]) ifTrue:[
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11049
			fonts add:fntDescr
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11050
		    ]
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11051
		]
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11052
	    ]
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11053
	]
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11054
    ].
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11055
    ^ fonts
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11056
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11057
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11058
getAvailableFontsMatching:pattern
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11059
    "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
 11060
    self halt.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11061
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11062
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11063
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11064
getDefaultFont
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11065
    "return a default font id - used when class Font cannot
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11066
     find anything usable"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11067
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11068
     ^ self createFontFor:'fixed'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11069
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11070
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11071
getFontWithFamily:familyString face:faceString
4000
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11072
	    style:styleArgString size:sizeArg encoding:encodingSym
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11073
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11074
    "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
 11075
     font."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11076
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11077
    |styleString theName theId xlatedStyle id spacing|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11078
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11079
    styleString := styleArgString.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11080
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11081
    "special: if face is nil, allow access to X-fonts"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11082
    faceString isNil ifTrue:[
4000
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11083
	sizeArg notNil ifTrue:[
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11084
	    theName := familyString , '-' , sizeArg printString
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11085
	] ifFalse:[
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11086
	    theName := familyString
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11087
	].
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11088
	theName isNil ifTrue:[
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11089
	    "
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11090
	     mhmh - fall back to the default font
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11091
	    "
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11092
	    theName := 'fixed'
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11093
	].
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11094
	theId := self createFontFor:theName.
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11095
	theId isNil ifTrue:[
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11096
	    theId := self getDefaultFont
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11097
	].
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11098
	^ theId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11099
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11100
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11101
    "/ spacing other than 'normal' is contained as last component
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11102
    "/ in style
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11103
    styleString notNil ifTrue:[
4000
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11104
	((styleString endsWith:'-narrow')
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11105
	 or:[styleString endsWith:'-semicondensed']) ifTrue:[
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11106
	    |i|
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11107
	    i := styleString lastIndexOf:$-.
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11108
	    spacing := styleString copyFrom:(i+1).
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11109
	    styleString := styleString copyTo:(i-1).
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11110
	] ifFalse:[
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11111
	    spacing := 'normal'.
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11112
	].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11113
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11114
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11115
    xlatedStyle := styleString.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11116
    xlatedStyle notNil ifTrue:[
4000
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11117
	xlatedStyle := xlatedStyle first asString
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11118
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11119
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11120
    id := self
4000
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11121
	    getFontWithFoundry:'*'
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11122
	    family:familyString asLowercase
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11123
	    weight:faceString
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11124
	    slant:styleString "/ xlatedStyle
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11125
	    spacing:spacing
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11126
	    pixelSize:nil
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11127
	    size:sizeArg
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11128
	    registry:'*'
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11129
	    encoding:encodingSym.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11130
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11131
    id isNil ifTrue:[
4000
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11132
	(encodingSym notNil and:[encodingSym ~= '*']) ifTrue:[
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11133
	    "/ too stupid: encodings come in both cases
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11134
	    "/
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11135
	    id := self
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11136
		    getFontWithFoundry:'*'
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11137
		    family:familyString asLowercase
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11138
		    weight:faceString
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11139
		    slant:styleString "/ xlatedStyle
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11140
		    spacing:spacing
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11141
		    pixelSize:nil
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11142
		    size:sizeArg
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11143
		    registry:'*'
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11144
		    encoding:encodingSym asUppercase.
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11145
	    id isNil ifTrue:[
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11146
		id := self
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11147
			getFontWithFoundry:'*'
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11148
			family:familyString asLowercase
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11149
			weight:faceString
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11150
			slant:styleString "/ xlatedStyle
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11151
			spacing:spacing
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11152
			pixelSize:nil
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11153
			size:sizeArg
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11154
			registry:'*'
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11155
			encoding:encodingSym asLowercase.
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11156
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11157
		id isNil ifTrue:[
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11158
		    id := self
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11159
			    getFontWithFoundry:'*'
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11160
			    family:familyString asLowercase
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11161
			    weight:faceString asLowercase
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11162
			    slant:styleString asLowercase
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11163
			    spacing:spacing
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11164
			    pixelSize:nil
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11165
			    size:sizeArg
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11166
			    registry:'*'
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11167
			    encoding:encodingSym asLowercase.
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11168
		]
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11169
	    ]
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11170
	]
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11171
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11172
    ^ id
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11173
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11174
    "Modified: 24.2.1996 / 22:37:24 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11175
    "Modified: 4.7.1996 / 11:38:47 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11176
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11177
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11178
getFontWithFoundry:foundry family:family weight:weight
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11179
	      slant:slant spacing:spc pixelSize:pixelSize size:pointSize
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11180
	      registry:registry encoding:encoding
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11181
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11182
    "get the specified font, if not available, return nil.
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11183
     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
 11184
     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
 11185
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11186
     foundry:   'adobe', 'misc', 'dec', 'schumacher' ... usually '*'
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11187
     family:    'helvetica' 'courier' 'times' ...
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11188
     weight:    'bold' 'medium' 'demi' ...
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11189
     slant:     'r(oman)' 'i(talic)' 'o(blique)'
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11190
     spacing:   'narrow' 'normal' semicondensed' ... usually '*'
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11191
     pixelSize: 16,18 ... usually left empty
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11192
     size:      size in point (1/72th of an inch)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11193
     registry:  iso8859, sgi ... '*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11194
     encoding:  vendor specific encoding (usually '*')
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11195
    "
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11196
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11197
    "
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11198
     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
 11199
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11200
	nHeight
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11201
	nWidth
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11202
	nEscapement
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11203
	nOrientation
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11204
	fnWeight        FW_DONTCARE, FW_NORMAL, FW_MEDIUM, FW_BOLD, ...
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11205
	fdwItalic       TRUE or FALSE
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11206
	fdwUnderline    TRUE or FALSE
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11207
	fdwStrikeOut    TRUE or FALSE
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11208
	fdwCharSet      ANSI_CHARSET, UNICODE_, SYMBOL_, SHIFTJIS_,...
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11209
	fdwOutputPrecision      DEFAULT, STRING, CHAR, ...
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11210
	fdwClipPrecision        DEFAULT, CHAR, STROKE, MASK, ...
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11211
	fdwQuality      DEFAULT, DRAFT, or PROOF.
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11212
	fdwPitchAndFamily
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11213
		DEFAULT, FIXED or VARIABLE pitch
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11214
		DECORATIVE, DONTCASE, MODERN, ROMAN, SCRIPT, or SWISS.
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11215
	lpszFace
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11216
		Typeface Name
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11217
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11218
      These two above descriptions will be matched as follows:
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11219
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11220
	foundry   - ignored
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11221
	family    - mapped to type face name.
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11222
	weight    - mapped to fnWeight
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11223
	slant     - used for style
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11224
	spacing   - NOT USED INITIALLY
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11225
	pixelSize - NOT USED INITIALLY
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11226
	size      - mapped to nHeight
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11227
	registry  - NOT USED INITIALLY
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11228
	encoding  - mapped to fdwCharSet
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11229
     "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11230
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 11231
    |logSize|
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 11232
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 11233
    pixelSize notNil ifTrue:[
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11234
	logSize := pixelSize
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 11235
    ] ifFalse:[
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11236
	logSize := (pointSize * (self getLogicalPixelSizeY) / 72.0) rounded.
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 11237
    ].
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 11238
%{ 
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11239
    HGDIOBJ hFont;
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 11240
    int  pointSize, nHeight, nWidth, nEscapement, nOrientation;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11241
    char* work;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11242
    char* work2;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11243
    DWORD fnWeight;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11244
    DWORD fdwItalic;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11245
    DWORD fdwUnderline;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11246
    DWORD fdwStrikeOut;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11247
    DWORD fdwCharSet;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11248
    DWORD fdwOutputPrecision;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11249
    DWORD fdwClipPrecision;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11250
    DWORD fdwQuality;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11251
    DWORD fdwPitchAndFamily;
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 11252
    static char faceName[256];
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11253
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11254
/* INITIALIZE */
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 11255
    strcpy( faceName, "NULL" );
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 11256
    nHeight   = 0;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11257
    nWidth   = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11258
    nEscapement = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11259
    nOrientation = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11260
    fnWeight = FW_NORMAL;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11261
    fdwItalic = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11262
    fdwUnderline = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11263
    fdwStrikeOut = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11264
    fdwOutputPrecision = OUT_DEFAULT_PRECIS;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11265
    fdwClipPrecision   = CLIP_DEFAULT_PRECIS;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11266
    fdwQuality         = DEFAULT_QUALITY;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11267
    fdwPitchAndFamily  = FF_DONTCARE;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11268
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11269
    fdwCharSet   = ANSI_CHARSET;
4013
cd666b168135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4009
diff changeset
 11270
    if ((encoding == @symbol('ms-ansi'))) {
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11271
	fdwCharSet   = ANSI_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 11272
    } else if (encoding == @symbol('ms-default')) {   
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11273
	fdwCharSet   = DEFAULT_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 11274
    } else if ((encoding == @symbol('ms-symbol'))
4001
cba68f3b0da9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
 11275
	    || (encoding == @symbol('misc-fontspecific'))) {   
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11276
	fdwCharSet   = SYMBOL_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 11277
    } else if ((encoding == @symbol('ms-shiftjis'))
4001
cba68f3b0da9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
 11278
	    || (encoding == @symbol('jisx0208.1983-0'))){   
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11279
	fdwCharSet   = SHIFTJIS_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 11280
    } else if ((encoding == @symbol('ms-gb2312'))
4001
cba68f3b0da9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
 11281
	    || (encoding == @symbol('gb2312.1980-0'))) {   
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11282
	fdwCharSet   = GB2312_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 11283
    } else if ((encoding == @symbol('ms-hangeul'))
4001
cba68f3b0da9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
 11284
	    || (encoding == @symbol('ksc5601.1987-0'))) {   
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11285
	fdwCharSet   = HANGEUL_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 11286
    } else if ((encoding == @symbol('ms-chinesebig5'))
4001
cba68f3b0da9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
 11287
	    || (encoding == @symbol('big5'))) {   
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11288
	fdwCharSet   = CHINESEBIG5_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 11289
    } else if (encoding == @symbol('ms-oem')) {   
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11290
	fdwCharSet   = OEM_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 11291
    } else if (encoding == @symbol('ms-johab')) {   
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11292
	fdwCharSet   = JOHAB_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 11293
    } else if ((encoding == @symbol('ms-hebrew'))
4013
cd666b168135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4009
diff changeset
 11294
	    || (encoding == @symbol('ms-cp1255'))) {   
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11295
	fdwCharSet   = HEBREW_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 11296
    } else if ((encoding == @symbol('ms-arabic'))   
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 11297
	    || (encoding == @symbol('ms-cp1256'))) {  
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11298
	fdwCharSet   = ARABIC_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 11299
    } else if ((encoding == @symbol('ms-greek'))
4013
cd666b168135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4009
diff changeset
 11300
	    || (encoding == @symbol('ms-cp1253'))) {   
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11301
	fdwCharSet   = GREEK_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 11302
    } else if ((encoding == @symbol('ms-turkish'))
4013
cd666b168135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4009
diff changeset
 11303
	    || (encoding == @symbol('ms-cp1254'))) {   
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11304
	fdwCharSet   = TURKISH_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 11305
    } else if ((encoding == @symbol('ms-russian')) 
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 11306
	    || (encoding == @symbol('ms-cp1251'))) {   
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11307
	fdwCharSet   = RUSSIAN_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 11308
    } else if ((encoding == @symbol('ms-easteurope'))  
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 11309
	    || (encoding == @symbol('ms-cp1250'))) {  
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11310
	fdwCharSet   = EASTEUROPE_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 11311
    } else if ((encoding == @symbol('ms-baltic'))   
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 11312
	    || (encoding == @symbol('ms-cp1257'))) {  
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11313
	fdwCharSet   = BALTIC_CHARSET;
4013
cd666b168135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4009
diff changeset
 11314
    } else if ((encoding == @symbol('ms-vietnamese'))) {   
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11315
	fdwCharSet   = VIETNAMESE_CHARSET;
4013
cd666b168135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4009
diff changeset
 11316
    } else if ((encoding == @symbol('ms-thai'))) {   
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11317
	fdwCharSet   = THAI_CHARSET;
4013
cd666b168135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4009
diff changeset
 11318
    } else if ((encoding == @symbol('ms-mac'))) {   
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11319
	fdwCharSet   = MAC_CHARSET;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11320
#ifdef UNICODE_CHARSET
4013
cd666b168135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4009
diff changeset
 11321
    } else if ((encoding == @symbol('ms-unicode'))) {   
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11322
	fdwCharSet   = UNICODE_CHARSET;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11323
#endif
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11324
    }
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11325
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11326
    if ( __isString( family ) ) {
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11327
	work = __stringVal( family );
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11328
	if (strcmp( work, "nil" ) != 0 ) {
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11329
	    strncpy( faceName, work, sizeof(faceName)-1 );
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11330
	}
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11331
    }
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11332
4000
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11333
    /* Q: should we allow those ? (they make ST/X programs less portable to X */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11334
    if( __isString( weight ) ) {
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11335
	work = __stringVal( weight );
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11336
	if (strcmp( work, "bold" ) == 0 ) {
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11337
	    fnWeight = FW_BOLD;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11338
	} else if (strcmp( work, "medium" ) == 0 ) {
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11339
	    fnWeight = FW_MEDIUM;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11340
	} else if (strcmp( work, "normal" ) == 0 ) {
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11341
	    fnWeight = FW_NORMAL;
4000
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11342
	} else if (strcmp( work, "light" ) == 0 ) {
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11343
	    fnWeight = FW_LIGHT;
4000
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 11344
	} else if (strcmp( work, "demi" ) == 0 ) {
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11345
	    fnWeight = FW_LIGHT;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11346
	} else if (strcmp( work, "heavy" ) == 0 ) {
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11347
	    fnWeight = FW_HEAVY;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11348
	} else if (strcmp( work, "extraBold" ) == 0 ) {
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11349
	    fnWeight = FW_EXTRABOLD;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11350
	} else if (strcmp( work, "semiBold" ) == 0 ) {
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11351
	    fnWeight = FW_SEMIBOLD;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11352
	} else if (strcmp( work, "thin" ) == 0 ) {
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11353
	    fnWeight = FW_THIN;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11354
	} else if (strcmp( work, "extraLight" ) == 0 ) {
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11355
	    fnWeight = FW_EXTRALIGHT;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11356
	}
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11357
    } else if (__isSmallInteger(weight)) {
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11358
	fnWeight = __intVal(weight);
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 11359
    }
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 11360
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 11361
    if(__isSmallInteger( logSize )) {
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11362
	nHeight = __intVal( logSize );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11363
    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11364
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11365
    if (__isString(slant)) {
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11366
	work2 = __stringVal( slant );
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11367
	work  = __stringVal( slant );
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11368
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11369
	if (strncmp(work2, "italic", 6) == 0)  {
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11370
	    fdwItalic = TRUE;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11371
	    if ( work2[6] = '-' )
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11372
		strncpy( work, &work2[7], ( strlen( work2) - 7) );
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11373
	} else {
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11374
	    if (strncmp(work2, "oblique", 7) == 0)  {
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11375
		fdwItalic = TRUE;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11376
		if ( work2[7] = '-' )
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11377
		    strncpy( work, &work2[8], ( strlen( work2) - 8) );
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11378
	    }
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11379
	}
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11380
	if (strncmp( work, "underline", 9 ) == 0 ) {
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11381
	    fdwUnderline = TRUE;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11382
	    if( work[10] == '-' )
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11383
		strncpy( work2, &work[11], ( strlen( work ) - 10 ) );
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11384
	}
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11385
	if (strncmp( work2, "strikeOut", 9 ) == 0 ) {
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11386
	    fdwStrikeOut = TRUE;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11387
	}
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 11388
    }
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 11389
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 11390
    DPRINTF(("CreateFont face:%s h=%d w=%d wght=%d\n", 
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11391
		faceName, nHeight, nWidth, fnWeight));
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 11392
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 11393
    hFont = CreateFont( -nHeight,   /* character height - not cell height */
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11394
			nWidth,
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11395
			nEscapement,
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11396
			nOrientation,
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11397
			fnWeight,
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11398
			fdwItalic,
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11399
			fdwUnderline,
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11400
			fdwStrikeOut,
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11401
			fdwCharSet,
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11402
			fdwOutputPrecision,
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11403
			fdwClipPrecision,
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11404
			fdwQuality,
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11405
			fdwPitchAndFamily,
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11406
			faceName );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11407
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11408
    if (hFont != NULL) {
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11409
	DPRINTF(("createFont: %x\n", hFont));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11410
#ifdef COUNT_RESOURCES
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11411
	__cnt_font++;
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11412
	RES1PRINTF(("CreateFont %d\n", __cnt_font));
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11413
#endif
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11414
	RETURN ( __MKOBJ(hFont) );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11415
    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11416
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11417
    DPRINTF(("***** ERROR createFontWithFoundry failed ERROR *****\n" ));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11418
%}.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11419
    ^ nil
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11420
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11421
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11422
     Display getFontWithFoundry:'*'
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11423
			 family:'courier'
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11424
			 weight:'medium'
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11425
			  slant:'r'
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11426
			spacing:nil
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11427
		      pixelSize:nil
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11428
			   size:13
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11429
		       registry:'iso8859'
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11430
		       encoding:'*'
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11431
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11432
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11433
    "new NT Version: 20.2.1997 / 22:33:29 / dq"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11434
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11435
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 11436
getLogicalPixelSizeY
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 11437
%{
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 11438
    RETURN( __MKSMALLINT(__logPixelSY) );
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 11439
%}
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 11440
!
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 11441
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11442
listOfAvailableFonts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11443
    "return a list with all available fonts on this display.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11444
     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
 11445
     next time. The elements of the returned collection are instances of
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11446
     FontDescription."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11447
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11448
    |list typeFaceList|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11449
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11450
    listOfFonts notNil ifTrue:[^ listOfFonts].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11451
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11452
    list := OrderedCollection new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11453
    typeFaceList := OrderedCollection new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11454
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11455
    [
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11456
      self primEnumFontTypesInto:typeFaceList.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11457
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11458
      "/Transcript showCR:typeFaceList.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11459
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11460
      typeFaceList do:[:typeFace |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11461
	  self primEnumFontsIn:typeFace into:list.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11462
	  0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11463
      ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11464
    ] valueUninterruptably.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11465
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11466
    "/ Transcript showCR:list.
2926
0f238dfe4207 italic font fix
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
 11467
    listOfFonts := OrderedCollection new.
0f238dfe4207 italic font fix
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
 11468
    list do:[:anInfoArray |
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 11469
	| fntDescr italicFontDescr |
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 11470
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 11471
	fntDescr := self fontDescriptionFromLogicalFontInfoArray:anInfoArray.
2926
0f238dfe4207 italic font fix
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
 11472
	listOfFonts add:fntDescr.
0f238dfe4207 italic font fix
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
 11473
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 11474
	"/ manually generate italic version (any font can be made italic here)
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 11475
	(fntDescr style startsWith:'roman') ifTrue:[
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 11476
	    italicFontDescr := FontDescription
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 11477
			    family:fntDescr family
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 11478
			    face:fntDescr face
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 11479
			    style:('italic' , (fntDescr style copyFrom:'roman' size+1))
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 11480
			    size:fntDescr size
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 11481
			    encoding:fntDescr encoding.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 11482
	    listOfFonts add:italicFontDescr.
2929
a0aa21f89019 italic fonts
Claus Gittinger <cg@exept.de>
parents: 2928
diff changeset
 11483
	].
2926
0f238dfe4207 italic font fix
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
 11484
    ].
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 11485
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11486
    ^ listOfFonts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11487
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11488
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11489
     Display listOfAvailableFonts.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11490
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11491
     Display getAvailableFontsMatching:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11492
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11493
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11494
    "Modified: 27.9.1995 / 10:54:47 / stefan"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11495
    "Modified: 17.4.1996 / 15:27:57 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11496
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11497
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11498
primEnumFontTypesInto:typeFaceList
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 11499
%{  
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11500
    if (__tmpDC) {
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11501
#ifdef USE_EnumFontFamiliesEx
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11502
	EnumFontFamiliesEx( __tmpDC, NULL, EnumFPTypeFaceProc, (DWORD)&(typeFaceList));
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11503
#else
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11504
	EnumFontFamilies( __tmpDC, NULL, EnumFPTypeFaceProc, (DWORD)&(typeFaceList));
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11505
#endif
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11506
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11507
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11508
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11509
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11510
primEnumFontsIn:typeFace into:fontList
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 11511
%{  
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11512
    char *cp;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11513
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11514
    if (__isString(typeFace)) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11515
	if (__tmpDC) {
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11516
#ifdef USE_EnumFontFamiliesEx
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11517
	    EnumFontFamiliesEx(__tmpDC, __stringVal(typeFace), EnumFontsProc, (DWORD)&(fontList));
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11518
#else
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11519
	    EnumFontFamilies(__tmpDC, __stringVal(typeFace), EnumFontsProc, (DWORD)&(fontList));
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 11520
#endif
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11521
	}
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11522
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11523
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11524
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11525
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 11526
primFontMetricsOf:fontId intoArray:rawData
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 11527
    "evaluate aBlock, passing a fonts metrics as arguments.
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 11528
     fill passed array as:
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 11529
      ascent     -> (data at:1)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 11530
      descent    -> (data at:2)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 11531
      maxAscent  -> (data at:3)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 11532
      maxDescent -> (data at:4)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 11533
      minWidth   -> (data at:5)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 11534
      maxWidth   -> (data at:6)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 11535
      avgWidth   -> (data at:7).
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 11536
"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11537
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 11538
%{  
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11539
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 11540
    if (__isExternalAddress(fontId)
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 11541
     && __isArray(rawData)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 11542
     && (__arraySize(rawData) >= 7)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11543
	SIZE size;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11544
	int avgWidth;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11545
	HGDIOBJ hFont;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11546
	HGDIOBJ prevFont;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11547
	TEXTMETRIC tmet;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11548
	static char *s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11549
	static int len;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11550
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11551
	hFont = _HGDIOBJVal(fontId);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11552
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11553
	/*
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 11554
	 * temporarily set this font in the tmpDC (root-) context
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11555
	 */
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 11556
#ifdef CACHE_LAST_TMP_FONT
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 11557
	if (__tmpDC_hfont != hFont) {
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 11558
	    prevFont = SelectObject(__tmpDC, hFont);
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 11559
	    if (__tmpDC_prev_hfont == NULL) {
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 11560
		__tmpDC_prev_hfont = prevFont;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 11561
	    }
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 11562
	    __tmpDC_hfont = hFont;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 11563
	}
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 11564
#else
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11565
	prevFont = SelectObject(__tmpDC, hFont);
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 11566
#endif
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11567
	GetTextMetrics(__tmpDC, &tmet);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11568
	if (len == 0) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11569
	    len = strlen(s);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11570
	}
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11571
	GetTextExtentPoint32(__tmpDC, s, len, &size);
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 11572
#ifndef CACHE_LAST_TMP_FONT
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11573
	SelectObject(__tmpDC, prevFont);
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 11574
#endif
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11575
	avgWidth = (size.cx / (len / 2) + 1) / 2;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11576
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 11577
	__ArrayInstPtr(rawData)->a_element[0] = __MKSMALLINT(tmet.tmAscent);        /* ascent     -> (data at:1) */
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 11578
	__ArrayInstPtr(rawData)->a_element[1] = __MKSMALLINT(tmet.tmDescent);       /* descent    -> (data at:2) */
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 11579
	__ArrayInstPtr(rawData)->a_element[2] = __MKSMALLINT(tmet.tmAscent);        /* maxAscent  -> (data at:3) */
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 11580
	__ArrayInstPtr(rawData)->a_element[3] = __MKSMALLINT(tmet.tmDescent);       /* maxDescent -> (data at:4) */
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 11581
	__ArrayInstPtr(rawData)->a_element[4] = __MKSMALLINT(avgWidth);             /* minWidth   -> (data at:5) */
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 11582
	__ArrayInstPtr(rawData)->a_element[5] = __MKSMALLINT(tmet.tmMaxCharWidth);  /* maxWidth   -> (data at:6) */
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 11583
	__ArrayInstPtr(rawData)->a_element[6] = __MKSMALLINT(avgWidth);             /* avgWidth   -> (data at:7) */
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 11584
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11585
	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
 11586
		    hFont, tmet.tmAscent, tmet.tmDescent, avgWidth, tmet.tmMaxCharWidth,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11587
		    tmet.tmAveCharWidth));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11588
	RETURN (self);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11589
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11590
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11591
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11592
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11593
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11594
releaseFont:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11595
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 11596
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11597
    if (__isExternalAddress(aFontId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11598
	HGDIOBJ hFont = _HGDIOBJVal(aFontId);
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 11599
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 11600
	if (hFont) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11601
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11602
	    __cnt_font--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11603
	   RES1PRINTF(("DestroyFont %d\n",__cnt_font));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11604
#endif
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11605
	   DPRINTF(("ReleaseFont: %x\n", hFont));
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 11606
	   _DeleteFont(hFont, __LINE__);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11607
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11608
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11609
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11610
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11611
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11612
sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11613
    "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
 11614
     on this display.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11615
     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
 11616
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11617
    |sizes|
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
    sizes := super sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11620
    (sizes notNil and:[sizes includes:0]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11621
	"special: in X11R5 and above, size 0 means:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11622
	 there are scaled versions in all sizes available"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11623
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11624
	^ #(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
 11625
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11626
    ^ sizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11627
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11628
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11629
     Display sizesInFamily:'courier' face:'bold' style:'roman'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11630
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11631
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11632
    "Created: 27.2.1996 / 01:38:15 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11633
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11634
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11635
widthOf:aString from:index1 to:index2 inFont:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11636
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 11637
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11638
    char *cp;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11639
    int len, n, i1, i2, l;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11640
    OBJ cls;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11641
    int nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11642
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11643
    if (__bothSmallInteger(index1, index2)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11644
     && __isExternalAddress(aFontId)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11645
     && __isNonNilObject(aString)) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11646
	HGDIOBJ hFont,prevFont;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11647
	SIZE tsize;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11648
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11649
	hFont = _HGDIOBJVal(aFontId);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11650
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11651
#ifdef CACHE_LAST_TMP_FONT
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11652
	if (__tmpDC_hfont != hFont) {
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11653
	    prevFont = SelectObject(__tmpDC, hFont);
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11654
	    if (__tmpDC_prev_hfont == NULL) {
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11655
		__tmpDC_prev_hfont = prevFont;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11656
	    }
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11657
	    __tmpDC_hfont = hFont;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11658
	}
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11659
#else
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11660
	prevFont = SelectObject(__tmpDC, hFont);
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11661
#endif
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11662
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11663
	i1 = __intVal(index1) - 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11664
	cls = __qClass(aString);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11665
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11666
	if (i1 >= 0) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11667
	    i2 = __intVal(index2) - 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11668
	    if (i2 < i1) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11669
		RETURN ( __MKSMALLINT( 0 ) );
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11670
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11671
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11672
	    cp = (char *) _stringVal(aString);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11673
	    l = i2 - i1 + 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11674
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11675
	    if ((cls == @global(String)) || (cls == @global(Symbol))) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11676
		n = _stringSize(aString);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11677
		if (i2 < n) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11678
		    cp += i1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11679
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11680
		    GetTextExtentPoint32(__tmpDC, cp, l, &tsize);
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11681
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11682
#ifdef SUPERDEBUG
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11683
		    if (__debug__) {
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11684
		      char buf[80];
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11685
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11686
		      GetTextFace(__tmpDC,80,buf);
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11687
		      printf("font1 %x %s >%s< l=%d dx=%d\n",hFont,buf,cp,l,tsize.cx);
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11688
		    }
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11689
#endif
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11690
#ifndef CACHE_LAST_TMP_FONT
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11691
		    SelectObject(__tmpDC, prevFont);
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11692
#endif
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11693
		    RETURN ( __MKSMALLINT(tsize.cx) );
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11694
		}
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11695
		RETURN (__MKSMALLINT(0));
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11696
	    }
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11697
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11698
	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11699
	    cp += nInstBytes;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11700
	    n = __byteArraySize(aString) - nInstBytes;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11701
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11702
	    if (__isBytes(aString)) {
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11703
		if (i2 < n) {
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11704
		    cp += i1;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11705
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11706
		    GetTextExtentPoint32(__tmpDC, cp, l, &tsize);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11707
#ifdef SUPERDEBUG
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11708
		    if (__debug__) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11709
		      char buf[80];
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11710
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11711
		      GetTextFace(__tmpDC,80,buf);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11712
		      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
 11713
		    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11714
#endif
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 11715
#ifndef CACHE_LAST_TMP_FONT
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11716
		    SelectObject(__tmpDC, prevFont);
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 11717
#endif
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11718
		    RETURN ( __MKSMALLINT(tsize.cx) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11719
		}
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11720
		RETURN (__MKSMALLINT(0));
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11721
	    }
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11722
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11723
	    /* Unicode */
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11724
	    if (__isWords(aString)) {
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11725
		n = n / 2;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11726
		if (i2 < n) {
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11727
		    WIDECHAR *w_cp = (WIDECHAR *)cp;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11728
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11729
		    w_cp += i1;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11730
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11731
		    GetTextExtentPoint32W(__tmpDC, w_cp, l, &tsize);
3493
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 11732
#ifndef CACHE_LAST_TMP_FONT
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 11733
		    SelectObject(__tmpDC, prevFont);
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 11734
#endif
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 11735
		    RETURN ( __MKSMALLINT(tsize.cx) );
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 11736
		}
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 11737
		RETURN (__MKSMALLINT(0));
3493
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 11738
	    }
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 11739
	}
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 11740
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11741
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11742
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11743
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11744
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11745
!WinWorkstation methodsFor:'grabbing '!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11746
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11747
allowEvents:mode
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11748
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11749
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11750
grabKeyboardIn:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11751
    "grab the keyboard"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11752
%{    
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11753
#ifdef NOT_YET_IMPLEMENTED
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11754
    if (__isExternalAddress(aWindowId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11755
      HWND hWnd = _HWNDVal(aWindowId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11756
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11757
      CPRINTF(("grabKeyboard in %x\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11758
    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11759
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11760
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11761
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11762
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11763
grabPointerIn:aWindowId withCursor:aCursorId pointerMode:pMode keyboardMode:kMode confineTo:confineId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11764
    "grap the pointer - return true if ok"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11765
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 11766
%{  
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11767
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11768
	HWND hWnd = _HWNDVal(aWindowId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11769
	HCURSOR hCursor = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11770
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11771
	if (__currentCapture != CAPTURE_NONE) {
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 11772
	    PostMessage(__currentPointerView, WM_THREAD_SETCAPTURE, 0, 0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11773
	    //ReleaseCapture();
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11774
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11775
#if 1
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11776
	/*
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11777
	 * place a special, invisible view above the root
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11778
	 */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11779
	if (hWnd == __rootWin) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11780
	    hWnd = __rootWinSpezial;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11781
	    ShowWindow(hWnd, SW_SHOWNOACTIVATE);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11782
	    //EnableWindow(hWnd,TRUE);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11783
	    SetWindowPos(hWnd, HWND_TOP,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11784
			 0, 0, 0, 0, 
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11785
			 SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 11786
			 | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11787
	    CPRINTF(("setRootCapture %x\n",hWnd));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11788
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11789
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11790
	if (__isExternalAddress(aCursorId)) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11791
	    hCursor = _HCURSORVal(aCursorId);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11792
	    CPRINTF(("grabPointerIn  SetCapture %x\n",hWnd));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11793
	}
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 11794
	PostMessage(hWnd, WM_THREAD_SETCAPTURE, (INT)hWnd, (INT)hCursor);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11795
	RETURN (true);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11796
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11797
%}.
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11798
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11799
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11800
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11801
ungrabKeyboard
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11802
    "release the keyboard"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11803
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11804
    activeKeyboardGrab := nil.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11805
%{    
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11806
#ifdef NOT_YET_IMPLEMENTED
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11807
    CPRINTF(("ungrabKeyboard\n"));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11808
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11809
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11810
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11811
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11812
ungrabPointer
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11813
    "release the pointer"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11814
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 11815
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11816
    CPRINTF(("ungrabPointer 1\n"));
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 11817
    PostThreadMessage(_dispatchThreadId, WM_THREAD_SETCAPTURE, 0, 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11818
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11819
    activePointerGrab := nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11820
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11821
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11822
!WinWorkstation methodsFor:'graphic context stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11823
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11824
noClipIn:aWindowId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11825
    "disable clipping rectangle"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11826
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 11827
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11828
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11829
    if (__isExternalAddress(aWindowId)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11830
     && __isExternalAddress(aGCId)) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11831
	struct gcData *gcData = _GCDATA(aGCId);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 11832
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 11833
	if (gcData->clipping != FALSE) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 11834
	    gcData->clipping = FALSE;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 11835
#ifdef CACHE_LAST_DC
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 11836
	    if (lastGcData == gcData) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11837
		SelectClipRgn(gcData->_hDC, NULL);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 11838
	    }
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 11839
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 11840
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11841
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11842
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11843
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11844
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11845
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11846
setBackground:bgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11847
    "set background color to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11848
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 11849
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11850
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11851
    if (__isExternalAddress(aGCId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11852
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11853
	COLORREF bgColor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11854
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11855
	bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11856
	if (bgColor != gcData->bgColor) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11857
	    gcData->bgColor = bgColor;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 11858
#ifdef CACHE_LAST_DC
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 11859
	    if (lastGcData == gcData) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 11860
		SetBkColor(gcData->_hDC, bgColor);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11861
		/*
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11862
		 * no need to flush pen - it does not depend upon
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11863
		 * the bg color
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11864
		 */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11865
	    }
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 11866
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11867
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11868
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11869
	CPRINTF(("setBackground: %x\n", bgColor));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11870
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11871
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11872
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11873
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11874
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11875
setBitmapMask:aBitmapId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11876
    "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
 11877
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 11878
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11879
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 11880
    if (__isExternalAddress(aGCId)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11881
	struct gcData *gcData = _GCDATA(aGCId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11882
	HBITMAP oldM;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11883
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11884
	oldM = gcData->hMask;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11885
	if (__isExternalAddress(aBitmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 11886
	    gcData->hMask = _HBITMAPVAL(aBitmapId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11887
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 11888
	    gcData->hMask = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11889
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11890
	if (oldM != gcData->hMask) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11891
	    FLUSH_CACHED_DC(gcData);
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11892
	    CPRINTF(("masks set to %x\n",gcData->hMask));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 11893
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11894
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11895
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11896
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11897
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11898
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 11899
setClipByChildren:aBool in:aWindowId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11900
    "enable/disable drawing into child views"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11901
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 11902
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11903
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 11904
    if (ISCONNECTED && __isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11905
	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
 11906
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 11907
	if (gcData && gcData->hWnd) {
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11908
	    int newClip;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11909
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11910
	    newClip = (aBool == true) ? TRUE : FALSE;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11911
	    if (newClip != gcData->clipByChildren) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11912
		/* set/clear clip by children */
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11913
		gcData->clipByChildren = newClip;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11914
		FLUSH_CACHED_DC(gcData);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 11915
	    }
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 11916
	} else {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11917
	    DPRINTF(("clipping by child failed - invalid window\n" ));
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 11918
	}
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 11919
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11920
%}.
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11921
    ^ self
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11922
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11923
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11924
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
 11925
    "clip to a rectangle"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11926
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11927
"
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11928
      p--w---
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11929
      |     |
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11930
      h     |  the clipping rectangle
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11931
      |     |
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11932
      -------
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11933
	  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
 11934
"
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11935
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 11936
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11937
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11938
    if (  __isExternalAddress(aGCId)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11939
       && __bothSmallInteger(clipX, clipY)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11940
       && __bothSmallInteger(clipWidth, clipHeight) ) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11941
	struct gcData *gcData = _GCDATA(aGCId);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 11942
	int cX, cY, cW, cH;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 11943
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 11944
	cX = __intVal(clipX);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 11945
	cY = __intVal(clipY);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 11946
	cW = __intVal(clipWidth);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 11947
	cH = __intVal(clipHeight);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 11948
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 11949
	if ((gcData->clipping != TRUE)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 11950
	 || (cX != gcData->clipX)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 11951
	 || (cY != gcData->clipY)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 11952
	 || (cW != gcData->clipW)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 11953
	 || (cH != gcData->clipH)) {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 11954
	    gcData->clipping = TRUE;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 11955
	    gcData->clipX = cX; 
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 11956
	    gcData->clipY = cY; 
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 11957
	    gcData->clipW = cW; 
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 11958
	    gcData->clipH = cH; 
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11959
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11960
#ifdef CACHE_LAST_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11961
	    /*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11962
	     * must update current cached DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11963
	     */
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11964
	    if (lastGcData == gcData) {
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 11965
		HRGN region = CreateRectRgn(cX, cY, cX + cW, cY + cH); 
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11966
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11967
		if (region == NULL ) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11968
		    fprintf(stderr, "WinWorkstat [warning]: clipping region creation failed\n");
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11969
		    FLUSH_CACHED_DC(gcData);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11970
		} else {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11971
		    if (SelectClipRgn(gcData->_hDC, region) == ERROR ) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11972
			fprintf(stderr, "WinWorkstat [warning]: select clipping region failed\n");
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11973
			FLUSH_CACHED_DC(gcData);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11974
		    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11975
		    _DeleteObject(region, __LINE__);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11976
		}
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11977
	    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11978
#endif
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 11979
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11980
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11981
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11982
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11983
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11984
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11985
setDashes:dashList dashOffset:offset in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11986
    "set line attributes"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11987
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 11988
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11989
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11990
    if (__isExternalAddress(aGCId)) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11991
	PRINTF(("WinWorkstat [warning]: dashes not (yet) implemented\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11992
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11993
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11994
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11995
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11996
setFont:aFontId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11997
    "set font to be drawn in"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11998
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 11999
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12000
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12001
    if (__isExternalAddress(aGCId)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12002
     && __isExternalAddress(aFontId))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12003
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12004
	struct gcData *gcData = _GCDATA(aGCId);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 12005
	HGDIOBJ prevFont, hFont;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12006
	TEXTMETRIC tmet;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12007
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12008
	hFont = _HGDIOBJVal(aFontId);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 12009
	if (gcData->hFont != hFont) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12010
	    gcData->hFont = hFont;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12011
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 12012
#ifdef CACHE_LAST_TMP_FONT
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 12013
	    if (__tmpDC_hfont != hFont) {
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 12014
		prevFont = SelectObject(__tmpDC, hFont);
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 12015
		if (__tmpDC_prev_hfont == NULL) {
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 12016
		    __tmpDC_prev_hfont = prevFont;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 12017
		}
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 12018
		__tmpDC_hfont = hFont;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 12019
	    }
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 12020
#else
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 12021
	    prevFont = SelectObject(__tmpDC, hFont);
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 12022
#endif
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 12023
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 12024
	    GetTextMetrics(__tmpDC, &tmet);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12025
	    gcData->fontAscent = tmet.tmAscent;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 12026
#ifdef SUPERDEBUG
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12027
	    if (__debug__) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12028
		char buf[80];
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12029
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 12030
		GetTextFace(__tmpDC, 80, buf);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 12031
		PRINTF(("setFont: %x %s\n", hFont, buf));
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 12032
	    }
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 12033
#endif
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 12034
#ifndef CACHE_LAST_TMP_FONT
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 12035
	    SelectObject(__tmpDC, prevFont);
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 12036
#endif
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 12037
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12038
#ifdef CACHE_LAST_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12039
	    /*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12040
	     * must update current cached DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12041
	     */
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 12042
	    if (lastGcData == gcData) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 12043
		prevFont = SelectObject(gcData->_hDC, hFont);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 12044
		if (! gcData->save_hFont) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 12045
		    gcData->save_hFont = prevFont;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 12046
		}
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 12047
	    }
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 12048
#endif
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12049
	    RETURN ( self );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12050
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12051
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12052
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12053
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12054
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12055
setForeground:fgColorIndex background:bgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12056
    "set foreground and background colors to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12057
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12058
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12059
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 12060
    if (__isExternalAddress(aGCId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12061
	struct gcData *gcData = _GCDATA(aGCId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12062
	COLORREF fg, bg, oldFg, oldBg;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12063
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12064
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12065
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12066
	oldFg = gcData->fgColor;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12067
	oldBg = gcData->bgColor;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12068
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12069
	if ((fg != oldFg) || (bg != oldBg)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12070
	    gcData->fgColor = fg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12071
	    gcData->bgColor = bg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12072
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12073
#ifdef CACHE_LAST_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12074
	    /*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12075
	     * must update or flush current cached DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12076
	     */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12077
	    if (lastGcData == gcData) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12078
		/* Pen only depends upon fg-color */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12079
		if (fg != oldFg) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12080
		    SetTextColor(gcData->_hDC, fg);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12081
		    FLUSH_CACHED_PEN(gcData);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12082
		}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12083
		if (bg != oldBg) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12084
		    SetBkColor(gcData->_hDC, bg);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12085
		}
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 12086
		FLUSH_CACHED_BRUSH(gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12087
	    }
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12088
#endif
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 12089
	    CPRINTF(("setForeground: %x background: %x\n", gcData->fgColor, gcData->bgColor));
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12090
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12091
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12092
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12093
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12094
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12095
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12096
setForeground:fgColorIndex background:bgColorIndex mask:aBitmapId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12097
    "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
 12098
     solid (if aBitmapId is nil)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12099
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12100
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12101
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 12102
    if (__isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12103
	struct gcData *gcData = _GCDATA(aGCId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12104
	COLORREF fg, bg, oldFg, oldBg;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12105
	HBITMAP m, oldM;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12106
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12107
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12108
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12109
	if (__isExternalAddress(aBitmapId))
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12110
	    m = _HBITMAPVAL(aBitmapId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12111
	else
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12112
	    m = 0;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12113
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12114
	oldFg = gcData->fgColor;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12115
	oldBg = gcData->bgColor;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12116
	oldM = gcData->hMask;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12117
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12118
	if ((oldFg != fg) || (oldBg != bg) || (oldM != m)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12119
	    gcData->fgColor = fg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12120
	    gcData->bgColor = bg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12121
	    gcData->hMask = m;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12122
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12123
#ifdef CACHE_LAST_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12124
	    /*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12125
	     * must update or flush current cached DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12126
	     */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12127
	    if (lastGcData == gcData) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12128
		if (oldM == m) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12129
		    /*
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12130
		     * only fg/bg changed
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12131
		     */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12132
		    /* Pen only depends upon fg-color */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12133
		    if (fg != oldFg) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12134
			SetTextColor(gcData->_hDC, fg);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12135
			FLUSH_CACHED_PEN(gcData);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12136
		    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12137
		    if (bg != oldBg) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12138
			SetBkColor(gcData->_hDC, bg);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12139
		    }
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 12140
		    FLUSH_CACHED_BRUSH(gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12141
		} else {
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12142
		    _releaseDC(gcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12143
		}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12144
	    }
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12145
#endif
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 12146
	    CPRINTF(("setForeground: %x background: %x mask: %x\n", gcData->fgColor, gcData->bgColor,gcData->hMask));
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12147
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12148
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12149
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12150
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12151
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12152
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12153
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
 12154
    "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
 12155
     solid (if aBitmapId is nil); also set lineWidth"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12156
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12157
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12158
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 12159
    if (__isExternalAddress(aGCId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12160
	struct gcData *gcData = _GCDATA(aGCId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12161
	COLORREF fg, bg, oldFg, oldBg;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12162
	HBITMAP m, oldM;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12163
	int lw, oldLw;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12164
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12165
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12166
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12167
	if (__isExternalAddress(aBitmapId))
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12168
	    m = _HBITMAPVAL(aBitmapId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12169
	else
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12170
	    m = 0;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12171
	lw = __intVal(aLineWidth);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12172
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12173
	oldFg = gcData->fgColor;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12174
	oldBg = gcData->bgColor;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12175
	oldLw = gcData->lineWidth;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12176
	oldM = gcData->hMask;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12177
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12178
	if ((oldFg != fg) || (oldBg != bg)
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12179
	 || (oldLw != lw) || (oldM != m)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12180
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12181
	    gcData->fgColor = fg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12182
	    gcData->bgColor = bg;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12183
	    gcData->lineWidth = lw;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12184
	    gcData->hMask = m;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12185
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12186
#ifdef CACHE_LAST_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12187
	    /*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12188
	     * must update or flush current cached DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12189
	     */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12190
	    if (lastGcData == gcData) {
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12191
		if ((oldM == m) && (oldLw == lw)) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12192
		    /*
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12193
		     * only fg/bg changed
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12194
		     */
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12195
		    /* Pen only depends upon fg-color */
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12196
		    if (fg != oldFg) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12197
			SetTextColor(gcData->_hDC, fg);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12198
			FLUSH_CACHED_PEN(gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12199
		    }
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12200
		    if (bg != oldBg) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12201
			SetBkColor(gcData->_hDC, bg);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12202
		    }
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12203
		    FLUSH_CACHED_BRUSH(gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12204
		} else {
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12205
		    _releaseDC(gcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12206
		}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12207
	    }
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12208
#endif
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 12209
	    CPRINTF(("setForeground: %x background: %x mask: %x linewidth: %d\n", 
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12210
			gcData->fgColor, gcData->bgColor,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12211
			gcData->hMask, gcData->lineWidth));
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12212
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12213
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12214
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12215
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12216
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12217
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12218
setForeground:fgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12219
    "set foreground color to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12220
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12221
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12222
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12223
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12224
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 12225
    if (__isExternalAddress(aGCId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12226
	struct gcData *gcData = _GCDATA(aGCId);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12227
	COLORREF fg;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12228
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12229
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12230
	if (fg != gcData->fgColor) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12231
	    gcData->fgColor = fg;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12232
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12233
#ifdef CACHE_LAST_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12234
	    /*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12235
	     * must update or flush current cached DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12236
	     */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12237
	    if (lastGcData == gcData) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12238
		/* Pen depends upon fg-color */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12239
		SetTextColor(gcData->_hDC, fg);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12240
		FLUSH_CACHED_PEN(gcData);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 12241
		FLUSH_CACHED_BRUSH(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12242
	    }
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12243
#endif
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 12244
	    CPRINTF(("setForeground: %x\n", gcData->fgColor));
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12245
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12246
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12247
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12248
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12249
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12250
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12251
setFunction:aFunctionSymbol in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12252
    "set alu function to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12253
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12254
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12255
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 12256
    if (__isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12257
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12258
	int fun = -1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12259
	int bfun = -1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12260
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 12261
	if (aFunctionSymbol == @symbol(copy)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12262
	    fun = R2_COPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12263
	    bfun = BITBLT_COPY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12264
	} else if (aFunctionSymbol == @symbol(copyInverted)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12265
	    fun = R2_NOTCOPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12266
	    bfun = BITBLT_COPYINVERTED;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12267
	} else if (aFunctionSymbol == @symbol(xor)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12268
	    fun = R2_XORPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12269
	    bfun = BITBLT_XOR;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12270
	} else if (aFunctionSymbol == @symbol(and)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12271
	    fun = R2_MASKPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12272
	    bfun = BITBLT_AND;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12273
	} else if (aFunctionSymbol == @symbol(or)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12274
	    fun = R2_MERGEPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12275
	    bfun = BITBLT_OR;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12276
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12277
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 12278
	if (fun != -1) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12279
#if 0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12280
	    printf("set func to");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12281
	    switch (bfun) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12282
		case BITBLT_COPY:
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12283
		    printf("BITBLT_COPY\n");
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12284
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12285
		case BITBLT_COPYINVERTED:
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12286
		    printf("BITBLT_COPYINVERTED\n");
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12287
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12288
		case BITBLT_XOR:
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12289
		    printf("BITBLT_XOR\n");
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12290
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12291
		case BITBLT_AND:
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12292
		    printf("BITBLT_AND\n");
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12293
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12294
		case BITBLT_OR:
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12295
		    printf("BITBLT_OR\n");
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12296
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12297
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12298
#endif
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12299
	} else {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12300
	    INFOPRINT( (stderr, "WinWorkstat [warning]: unsuported Rasterfunction\n") );
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12301
	    fun = R2_COPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12302
	    bfun = BITBLT_COPY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12303
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12304
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12305
	if ((fun != gcData->rop2)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12306
	 || (bfun != gcData->bitbltrop2)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12307
	    gcData->rop2 = fun;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12308
	    gcData->bitbltrop2 = bfun;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12309
#ifdef CACHE_LAST_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12310
	    /*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12311
	     * must update current cached DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12312
	     */
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 12313
	    if (gcData == lastGcData) {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 12314
		SetROP2(gcData->_hDC, fun);
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12315
	    }
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 12316
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12317
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12318
    } else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12319
	INFOPRINT((stderr, "WinWorkstation [warning]: Rasterfunction no GC\n"));
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12320
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12321
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12322
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12323
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12324
setGraphicsExposures:aBoolean in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12325
    "set or clear the graphics exposures flag"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12326
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12327
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12328
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12329
setLineWidth:aNumber style:lineStyle cap:capStyle join:joinStyle in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12330
    "set line attributes"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12331
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12332
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12333
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12334
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12335
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12336
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12337
     && __isSmallInteger(aNumber)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12338
	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
 12339
	int style;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12340
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12341
	gcData->lineWidth = __intVal(aNumber);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12342
	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
 12343
	    style = PS_SOLID;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12344
	} 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
 12345
	    style= PS_DASH;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 12346
	} 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
 12347
	    style= PS_DOT;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 12348
	} 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
 12349
	    style= PS_DASHDOT;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 12350
	} 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
 12351
	    style= PS_DASHDOTDOT;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12352
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12353
	    style= PS_SOLID;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12354
	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
 12355
	gcData->lStyle |= style;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12356
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12357
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12358
	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
 12359
	    style = PS_ENDCAP_ROUND;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12360
	} 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
 12361
	    style = PS_ENDCAP_SQUARE;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12362
	} 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
 12363
	    style = PS_ENDCAP_FLAT;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12364
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12365
	    style = PS_ENDCAP_FLAT;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12366
	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
 12367
	gcData->lStyle |= style;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12368
        
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12369
	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
 12370
	    style = PS_JOIN_BEVEL;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12371
	} 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
 12372
	    style = PS_JOIN_MITER;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12373
	} 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
 12374
	    style = PS_JOIN_ROUND;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12375
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12376
	    style = PS_JOIN_MITER;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12377
	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
 12378
	gcData->lStyle |= style;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12379
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12380
	FLUSH_CACHED_DC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12381
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12382
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12383
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12384
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12385
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12386
setMaskOriginX:orgX y:orgY in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12387
    "set the mask origin"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12388
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12389
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12390
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12391
    if (__isExternalAddress(aGCId)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12392
     && __bothSmallInteger(orgX,orgY)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12393
	struct gcData *gcData = _GCDATA(aGCId);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12394
	int oX, oY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12395
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12396
	oX = __intVal(orgX);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12397
	oY = __intVal(orgY);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12398
	if ((oX != gcData->maskOrgX)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12399
	 || (oY != gcData->maskOrgY)) {
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 12400
	    gcData->maskOrgX = __intVal(orgX);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 12401
	    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
 12402
	    FLUSH_CACHED_DC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12403
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 12404
	RETURN (self);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12405
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12406
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12407
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12408
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12409
setPixmapMask:aPixmapId in:aGCId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12410
    "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
 12411
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12412
%{  /* NOCONTEXT */
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 12413
    if (__isExternalAddress(aGCId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12414
	struct gcData *gcData = _GCDATA(aGCId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12415
	HBITMAP oldM;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12416
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12417
	oldM = gcData->hMask;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12418
	if (__isExternalAddress(aPixmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 12419
	    gcData->hMask = _HBITMAPVAL(aPixmapId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12420
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 12421
	    gcData->hMask = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12422
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12423
	if (oldM != gcData->hMask) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12424
	    FLUSH_CACHED_DC(gcData);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12425
	    DPRINTF(("PixmapMasks set to %x\n",gcData->hMask));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12426
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12427
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12428
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12429
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12430
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12431
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12432
!WinWorkstation methodsFor:'initialize / release'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12433
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12434
close
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12435
    "close down the connection to the display"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12436
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12437
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12438
3832
85b5220f7ade *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3828
diff changeset
 12439
initializeDefaultKeyboardMappingsIn:aKeyboardMap
85b5220f7ade *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3828
diff changeset
 12440
    aKeyboardMap bindValue:#Copy          to:#Ctrlc.     "copy selection to buffer"
85b5220f7ade *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3828
diff changeset
 12441
    aKeyboardMap bindValue:#Cut           to:#Ctrlx.     "cut selection into buffer"
85b5220f7ade *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3828
diff changeset
 12442
    aKeyboardMap bindValue:#Paste         to:#Ctrlv.     "paste buffer or external selection"
85b5220f7ade *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3828
diff changeset
 12443
 
85b5220f7ade *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3828
diff changeset
 12444
    aKeyboardMap bindValue:#UserInterrupt to:#Pause.     "interrupt window process"
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 12445
!
3832
85b5220f7ade *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3828
diff changeset
 12446
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12447
initializeDefaultValues
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 12448
    focusMode := #activeWindow.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 12449
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 12450
"/    self activateOnClick:true.
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 12451
"/    self ignoreButtonPressOnActivate:false.
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 12452
"/    self rightButtonIsLowerWindow:true.
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 12453
"/    self shiftedLeftButtonIsLowerWindow:true.
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 12454
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12455
    buttonTranslation := ButtonTranslation.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12456
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12457
    self initializeModifierMappings
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12458
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12459
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 12460
initializeDevice
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 12461
%{  
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12462
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12463
    int scr;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12464
    int maxRGBDepth;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12465
    int rgbRedMask, rgbGreenMask, rgbBlueMask;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12466
    int nvi, i;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12467
    char *type, *nm;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12468
    int dummy;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12469
    int mask, shift, nBits;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12470
    HDC _rootDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12471
    OBJ id;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12472
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12473
    if (firstInstance) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12474
	OSVERSIONINFO osvi;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12475
	WNDCLASS wc;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12476
	firstInstance = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12477
	DPRINTF(("first create - registerClass\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12478
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12479
	memset(&osvi, 0, sizeof(OSVERSIONINFO));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12480
	osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12481
	GetVersionEx (&osvi);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12482
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12483
	__INST(isWin95) = true;
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12484
	__INST(isWinXP) = false;
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12485
	__isWinNT = __isWinXP = 0;
3951
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
 12486
	__isWinNT_NEW_BEHAVIOUR = 0;
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12487
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
 12488
	if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) {
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12489
	    __INST(isWin95) = false;
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
 12490
	    __isWinNT = 1;
3951
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
 12491
	    __isWinNT_NEW_BEHAVIOUR = 1;
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
 12492
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12493
	    if ((osvi.dwMajorVersion >= 5) && (osvi.dwMinorVersion >= 1)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12494
		__INST(isWinXP) = true;
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12495
		__isWinXP = 1;
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12496
	    }
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
 12497
	    NUM_PEN_CACHED = NUM_PEN_CACHED_NT;
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
 12498
	    NUM_BRUSH_CACHED = NUM_BRUSH_CACHED_NT;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12499
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12500
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12501
	/*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12502
	 * register class: ST/X
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12503
	 */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12504
	wc.style = 0 
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12505
		   /* | CS_OWNDC */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12506
		   /* | CS_HREDRAW */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12507
		   /* | CS_VREDRAW */ 
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12508
		  | CS_DBLCLKS;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12509
	wc.lpfnWndProc = (WNDPROC) MainWndProc;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12510
	wc.cbClsExtra = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12511
	wc.cbWndExtra = N_WINDOW_PRIVATE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12512
	wc.hInstance = (HANDLE) __getHInstance();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12513
	wc.hIcon = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12514
	wc.hCursor = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12515
	wc.hbrBackground = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12516
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12517
	wc.lpszMenuName =  NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12518
	wc.lpszClassName = app_name;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12519
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12520
	if (!RegisterClass(&wc)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12521
	    DPRINTF(("RegisterClass failed\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12522
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12523
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12524
	/*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12525
	 * register class: ST/X:Root
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12526
	 */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12527
	wc.style = 0;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12528
	wc.lpfnWndProc = (WNDPROC) MainWndProc;;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12529
	wc.cbClsExtra = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12530
	wc.cbWndExtra = N_WINDOW_PRIVATE;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12531
	wc.hInstance = (HANDLE) __getHInstance();
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12532
	wc.hIcon = NULL;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12533
	wc.hCursor = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12534
	wc.hbrBackground = GetStockObject(HOLLOW_BRUSH);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12535
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12536
	wc.lpszMenuName =  NULL;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12537
	wc.lpszClassName = app_nameRoot;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12538
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12539
	if (! RegisterClass(&wc)) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12540
	    DPRINTF(("RegisterClass failed\n"));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12541
	}
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12542
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12543
	/*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12544
	 * register class: ST/X:Popup
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12545
	 */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12546
	wc.style = CS_SAVEBITS;
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12547
	if (__isWinXP) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12548
#ifndef CS_DROPSHADOW
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12549
# define CS_DROPSHADOW    0x020000
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12550
#endif
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12551
	    wc.style |= CS_DROPSHADOW;
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12552
	}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12553
	wc.lpfnWndProc = (WNDPROC) MainWndProc;;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12554
	wc.cbClsExtra = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12555
	wc.cbWndExtra = N_WINDOW_PRIVATE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12556
	wc.hInstance = (HANDLE) __getHInstance();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12557
	wc.hIcon = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12558
	wc.hCursor = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12559
	wc.hbrBackground = GetStockObject(HOLLOW_BRUSH);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12560
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12561
	wc.lpszMenuName =  NULL;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12562
	wc.lpszClassName = app_namePopup;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12563
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 12564
	if (! RegisterClass(&wc)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12565
	    DPRINTF(("RegisterClass failed\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12566
	}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12567
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12568
	/*
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12569
	 * register class: ST/X:Dialog
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12570
	 */
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12571
	wc.style = CS_SAVEBITS;
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12572
	wc.lpfnWndProc = (WNDPROC) MainWndProc;;
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12573
	wc.cbClsExtra = 0;
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12574
	wc.cbWndExtra = N_WINDOW_PRIVATE;
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12575
	wc.hInstance = (HANDLE) __getHInstance();
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12576
	wc.hIcon = NULL;
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12577
	wc.hCursor = 0;
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12578
	wc.hbrBackground = GetStockObject(HOLLOW_BRUSH);
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12579
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12580
	wc.lpszMenuName =  NULL;
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12581
	wc.lpszClassName = app_nameDialog;
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12582
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12583
	if (! RegisterClass(&wc)) {
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12584
	    DPRINTF(("RegisterClass failed\n"));
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12585
	}
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12586
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 12587
	/*
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12588
	 * generate my events
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12589
	 */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12590
	hNeverTriggered = CreateEvent(
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12591
				NULL,            /* no security attributes */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12592
				FALSE,
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12593
				FALSE,
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12594
				"Never"); 
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12595
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12596
	if (hNeverTriggered == NULL) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12597
	    fprintf(stderr, "WinWorkstation [fatal]: CreateEvent-1 failed\n");
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12598
	    exit(1);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12599
	}
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12600
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12601
	hCreateEvent = CreateEvent(
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12602
				NULL,            /* no security attributes */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12603
				FALSE,
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12604
				FALSE,
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12605
				"CreateEvents"); /* name of event */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12606
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12607
	if (hCreateEvent == NULL) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12608
	    fprintf(stderr, "WinWorkstation [fatal]: CreateEvent-2 failed\n");
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12609
	    exit(1);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12610
	}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12611
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12612
	hInputEvent = CreateEvent(
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12613
				NULL,            /* no security attributes */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12614
				FALSE,
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12615
				FALSE,
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12616
				"InputEvents");  /* name of event */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12617
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12618
	if (hInputEvent == NULL) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12619
	    fprintf(stderr, "WinWorkstation [fatal]: CreateEvent-3 failed\n");
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12620
	    exit(1);    
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12621
	}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12622
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12623
	hEventQMutex = CreateMutex(
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12624
				NULL,         /* no security attributes */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12625
				FALSE,        /* initially not owned */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12626
				"EvQMutex");  /* name of mutex */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12627
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12628
	if (hEventQMutex == NULL) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12629
	    fprintf(stderr, "WinWorkstation [fatal]: CreateMutex-1 failed\n");
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12630
	    exit(1);    
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12631
	}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12632
	DuplicateHandle(GetCurrentProcess(), 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12633
			hEventQMutex, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12634
			GetCurrentProcess(), 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12635
			&hEventQMutex, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12636
			DUPLICATE_SAME_ACCESS, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12637
			FALSE, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12638
			DUPLICATE_SAME_ACCESS);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12639
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12640
	hEventFreeListMutex = CreateMutex(
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12641
				NULL,          /* no security attributes */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12642
				FALSE,         /* initially not owned */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12643
				"EvFMutex");   /* name of mutex */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12644
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12645
	if (hEventFreeListMutex == NULL) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12646
	    fprintf(stderr, "WinWorkstation [fatal]: CreateMutex-2 failed\n");
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12647
	    exit(1);    
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12648
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12649
	DuplicateHandle(GetCurrentProcess(), 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12650
			hEventFreeListMutex, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12651
			GetCurrentProcess(), 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12652
			&hEventFreeListMutex, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12653
			DUPLICATE_SAME_ACCESS, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12654
			FALSE, 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12655
			DUPLICATE_SAME_ACCESS);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12656
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 12657
#ifdef USE_PAINT_MUTEX
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 12658
	hPaintMutex = CreateMutex(
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 12659
				NULL,           /* no security attributes */
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 12660
				FALSE,          /* initially not owned */
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 12661
				"PaintMutex");  /* name of mutex */
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 12662
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 12663
	if (hPaintMutex == NULL) {
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12664
	    fprintf(stderr, "WinWorkstation [fatal]: CreateMutex(PaintMutex) failed\n");
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 12665
	    exit(1);    
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 12666
	}
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 12667
	DuplicateHandle(GetCurrentProcess(), 
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 12668
			hPaintMutex, 
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 12669
			GetCurrentProcess(), 
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 12670
			&hPaintMutex, 
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 12671
			DUPLICATE_SAME_ACCESS, 
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 12672
			FALSE, 
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 12673
			DUPLICATE_SAME_ACCESS);
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 12674
#endif
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12675
#ifdef USE_DRAW_MUTEX
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12676
	hDrawMutex = CreateMutex(
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12677
				NULL,           /* no security attributes */
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12678
				FALSE,          /* initially not owned */
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12679
				"DrawMutex");   /* name of mutex */
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12680
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12681
	if (hDrawMutex == NULL) {
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12682
	    fprintf(stderr, "WinWorkstation [fatal]: CreateMutex(DrawMutex) failed\n");
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12683
	    exit(1);    
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12684
	}
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12685
	DuplicateHandle(GetCurrentProcess(), 
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12686
			hDrawMutex, 
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12687
			GetCurrentProcess(), 
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12688
			&hDrawMutex, 
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12689
			DUPLICATE_SAME_ACCESS, 
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12690
			FALSE, 
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12691
			DUPLICATE_SAME_ACCESS);
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12692
#endif
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 12693
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
 12694
#ifndef WIN32THREADS
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12695
	_masterThreadId = GetCurrentThreadId();
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12696
	DuplicateHandle(GetCurrentProcess(),
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12697
			GetCurrentThread(),
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12698
			GetCurrentProcess(),
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12699
			&_masterThread,
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12700
			DUPLICATE_SAME_ACCESS,
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12701
			FALSE,
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12702
			DUPLICATE_SAME_ACCESS);
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
 12703
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12704
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
 12705
	initEventqueue();
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12706
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12707
	/*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12708
	 * start the event dispatcher thread and wait for it to
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12709
	 * be ready
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12710
	 */
3828
95fb5ef238f9 *** empty log message ***
penk
parents: 3810
diff changeset
 12711
	__beginthreadNT(dispatchThread, EVENT_THREAD_STACKSIZE, 0, 0, 0, &_dispatchThreadId);
95fb5ef238f9 *** empty log message ***
penk
parents: 3810
diff changeset
 12712
	/* fprintf(stderr, "WinWorkstation [info]: dispatchThreadId=%d\n", _dispatchThreadId); */
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 12713
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12714
	if (WaitForSingleObject(hCreateEvent, 5000L) != WAIT_OBJECT_0) {
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
 12715
	    fprintf(stderr, "WinWorkstation [error]: oops - timeout waiting for eventThread to start\n");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12716
	}
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12717
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12718
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12719
#if 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12720
    __rootDesk = OpenDesktop ("Desktop0", 0, FALSE, GENERIC_ALL);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12721
    if (!__rootDesk) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12722
	PRINTF(("OpenDesktop fail\n"));
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 12723
	__rootDesk = CreateDesktop ("Desktop0", NULL, NULL, 0, DESKTOP_WRITEOBJECTS, NULL);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12724
	if (!__rootDesk) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12725
	    PRINTF(("CreateDesktop fail\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12726
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12727
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12728
#endif
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 12729
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12730
    __rootWin = GetDesktopWindow();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12731
    __PROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12732
    id = __MKOBJ(__rootWin);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12733
    __UNPROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12734
    __INST(rootWin) = id; __STORE(self, id);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12735
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12736
    _rootDC = __rootDC = CreateDC("DISPLAY", NULL, NULL, NULL);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12737
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12738
    __tmpDC = CreateCompatibleDC(_rootDC);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12739
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 12740
    __nullPen = GetStockObject(NULL_PEN);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 12741
    __blackPen = GetStockObject(BLACK_PEN);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 12742
    __whitePen = GetStockObject(WHITE_PEN);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 12743
    __blackBrush = GetStockObject(BLACK_BRUSH);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 12744
    __whiteBrush = GetStockObject(WHITE_BRUSH);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 12745
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12746
    __PROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12747
    id = __MKOBJ(_rootDC);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12748
    __UNPROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12749
    __INST(rootDC) = id; __STORE(self, id);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12750
%}.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12751
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12752
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12753
initializeEventBuffer
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12754
    |sz|
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12755
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12756
%{
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12757
    sz = __MKSMALLINT(sizeof(struct queuedEvent) + 100);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12758
%}.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12759
    eventBuffer isNil ifTrue:[
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12760
	eventBuffer := ByteArray new:sz.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12761
    ].
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12762
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12763
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12764
initializeFor:aDisplayName
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12765
    "initialize the receiver for a connection to the display;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12766
     the argument, aDisplayName is ignored under Win32.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12767
     (who knows - it may be used in the future to support multiple
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12768
      windows displays ...)"
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12769
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12770
    displayId notNil ifTrue:[
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12771
	"/ already connected - trying to trick me ?
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12772
	^ self
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12773
    ].
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12774
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12775
    displayId := self primInitializeFor:aDisplayName.
3632
a25578a48a6c Raise signal on device open error.
Stefan Vogel <sv@exept.de>
parents: 3589
diff changeset
 12776
    displayId isNil ifTrue:[
a25578a48a6c Raise signal on device open error.
Stefan Vogel <sv@exept.de>
parents: 3589
diff changeset
 12777
	self deviceOpenErrorSignal raiseWith:aDisplayName
a25578a48a6c Raise signal on device open error.
Stefan Vogel <sv@exept.de>
parents: 3589
diff changeset
 12778
    ].
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12779
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12780
    dispatching := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12781
    isSlow := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12782
    shiftDown := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12783
    ctrlDown := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12784
    metaDown := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12785
    altDown := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12786
    motionEventCompression := true.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12787
    buttonsPressed := 0.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12788
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12789
    self initializeScreenProperties.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12790
    self initializeDevice.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12791
    self initializeVariableScreenProperties.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12792
    self initializeVariableSettingsProperties.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12793
    self initializeDeviceResourceTables.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12794
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12795
    self initializeDefaultValues.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12796
    self initializeEventBuffer.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12797
    self initializeSpecialFlags.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12798
    self initializeKeyboardMap.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12799
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12800
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12801
initializeModifierMappings
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12802
    shiftModifiers := #(#'Shift_L' #'Shift_R' #'Shift').
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12803
    ctrlModifiers := #(#'Ctrl_L' #'Ctrl_R' #'Ctrl').
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12804
    metaModifiers := #(#'Alt_L' #'Alt').
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12805
    altModifiers := #(#'Alt_R').
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12806
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12807
2604
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 12808
initializeSpecialFlags
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 12809
    "perform additional special server implementation flags"
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 12810
!
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 12811
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12812
initializeVariableScreenProperties
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 12813
    "fetch properties which can be changed via the users display-settings.
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12814
     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
 12815
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12816
%{
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12817
    int nvi, i, val, capabilities, planes, numcolors, numpens;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12818
    RECT rect;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12819
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12820
    GetWindowRect(__rootWin, &rect);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12821
    __INST(width) = __MKSMALLINT(rect.right - rect.left);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12822
    __INST(height) = __MKSMALLINT(rect.bottom - rect.top);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12823
    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
 12824
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12825
    __realDepth = GetDeviceCaps(__rootDC, BITSPIXEL);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12826
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12827
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12828
    __depth = 24;  /* its a hack */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12829
#else
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12830
    __depth = __realDepth;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12831
    if (__depth == 15)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12832
	__depth = 16;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12833
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12834
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12835
#if 0
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12836
    numcolors = GetDeviceCaps(__rootDC, NUMCOLORS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12837
    numpens = GetDeviceCaps(__rootDC, NUMPENS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12838
    planes = GetDeviceCaps(__rootDC, PLANES);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12839
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12840
    DPRINTF(("screen has %d planes\n", planes));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12841
    DPRINTF(("numcolors is %d\n", numcolors));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12842
    DPRINTF(("numpens is %d\n", numpens));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12843
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12844
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12845
    __INST(depth) = __MKSMALLINT(__depth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12846
    __INST(ncells) = __MKSMALLINT(1<<__depth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12847
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12848
    val = GetDeviceCaps(__rootDC, HORZSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12849
    DPRINTF(("HORSIZE=%d\n",val));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12850
    __INST(widthMM) = __MKSMALLINT(val);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12851
    val = GetDeviceCaps(__rootDC, VERTSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12852
    DPRINTF(("VERTSIZE=%d\n",val));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12853
    __INST(heightMM) = __MKSMALLINT(val);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12854
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12855
    __logPixelSY = GetDeviceCaps(__rootDC, LOGPIXELSY);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12856
    capabilities = GetDeviceCaps(__rootDC, RASTERCAPS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12857
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12858
#ifdef LATER
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12859
    printf("device support:\n");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12860
    if (capabilities & RC_BANDING)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12861
	printf(" RC_BANDING");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12862
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12863
    if (capabilities & RC_BITBLT)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12864
	printf(" RC_BITBLT");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12865
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12866
    if (capabilities & RC_BITMAP64)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12867
	printf(" RC_BITMAP64");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12868
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12869
    if (capabilities & RC_DI_BITMAP)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12870
	printf(" RC_DI_BITMAP");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12871
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12872
    if (capabilities & RC_DIBTODEV)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12873
	printf(" RC_DIBTODEV");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12874
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12875
    if (capabilities & RC_FLOODFILL)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12876
	printf(" RC_FLOODFILL");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12877
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12878
    if (capabilities & RC_PALETTE)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12879
	printf(" RC_PALETTE");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12880
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12881
    if (capabilities & RC_SCALING)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12882
	printf(" RC_SCALING");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12883
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12884
    if (capabilities & RC_STRETCHBLT)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12885
	printf(" RC_STRETCHBLT");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12886
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12887
    if (capabilities & RC_STRETCHDIB)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12888
	printf(" RC_STRETCHDIB");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12889
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12890
    printf("\n");
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12891
    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
 12892
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12893
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12894
    __INST(whitepixel) = __MKSMALLINT(WhitePixel);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12895
    __INST(blackpixel) = __MKSMALLINT(BlackPixel);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12896
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12897
    __INST(monitorType) = @symbol(unknown);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12898
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12899
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12900
    __INST(hasColors) = true;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12901
    __INST(hasGreyscales) = true;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12902
    __INST(visualType) = @symbol(TrueColor);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12903
    __INST(redShift) = __MKSMALLINT(0);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12904
    __INST(greenShift) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12905
    __INST(blueShift) = __MKSMALLINT(16);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12906
    switch (__realDepth) {
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12907
	case 15:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12908
	case 16:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12909
	    __INST(bitsPerRGB) = __MKSMALLINT(5);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12910
	    break;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12911
	default:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12912
	    __INST(bitsPerRGB) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12913
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12914
    __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12915
    __INST(redMask) = __MKSMALLINT(0xFF);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12916
    __INST(greenMask) = __MKSMALLINT(0xFF00);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12917
    __INST(blueMask) = __MKSMALLINT(0xFF0000);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12918
#else
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12919
    if (! (capabilities & RC_PALETTE)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12920
	DPRINTF(("no palette\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12921
	if (__depth == 1) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12922
	    __INST(hasColors) = false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12923
	    __INST(hasGreyscales) = false;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12924
	    __INST(visualType) = @symbol(GrayScale);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12925
	    __INST(monitorType) = @symbol(monochrome);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12926
	} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12927
	    __INST(hasColors) = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12928
	    __INST(hasGreyscales) = true;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12929
	    if ((__depth == 16) || (__depth == 15)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12930
	      __INST(visualType) = @symbol(TrueColor);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12931
	      __INST(blueShift) = __MKSMALLINT(0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12932
	      __INST(greenShift) = __MKSMALLINT(5);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12933
	      __INST(redShift) = __MKSMALLINT(11);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12934
	      __INST(bitsPerRGB) = __MKSMALLINT(5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12935
	      __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12936
	      __INST(blueMask) = __MKSMALLINT(0x1f);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12937
	      __INST(greenMask) = __MKSMALLINT(0x7e0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12938
	      __INST(redMask) = __MKSMALLINT(0xf800);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12939
	    } else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12940
	      __INST(visualType) = @symbol(TrueColor);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12941
	      __INST(redShift) = __MKSMALLINT(0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12942
	      __INST(greenShift) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12943
	      __INST(blueShift) = __MKSMALLINT(16);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12944
	      __INST(bitsPerRGB) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12945
	      __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12946
	      __INST(redMask) = __MKSMALLINT(0xFF);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12947
	      __INST(greenMask) = __MKSMALLINT(0xFF00);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12948
	      __INST(blueMask) = __MKSMALLINT(0xFF0000);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12949
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12950
	}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12951
    } else {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12952
	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
 12953
	// printf("SizeofPalette %d\n",val);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12954
	__INST(ncells) = __MKSMALLINT(val);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12955
	__INST(blackpixel) = __MKSMALLINT(0);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12956
	__INST(whitepixel) = __MKSMALLINT(1);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12957
	__INST(hasColors) = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12958
	__INST(hasGreyscales) = true;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12959
	// __INST(usingSystemPalette) = true;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12960
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12961
	__INST(redShift) = __MKSMALLINT(0);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12962
	__INST(greenShift) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12963
	__INST(blueShift) = __MKSMALLINT(4);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12964
	__INST(bitsPerRGB) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12965
	__INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12966
	__INST(redMask) = __MKSMALLINT(0x3);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12967
	__INST(greenMask) = __MKSMALLINT(0xc); 
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12968
	__INST(blueMask) = __MKSMALLINT(0x30);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12969
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12970
#endif /* ! ALWAYSTRUECOLOR */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12971
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12972
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12973
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12974
initializeVariableSettingsProperties
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12975
    "fetch properties which can be changed via the user settings.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12976
     Invoked initially and as a result of the settingsChange event."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12977
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12978
%{
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12979
    UINT multiClickTime;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12980
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12981
    multiClickTime = GetDoubleClickTime();
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12982
    DPRINTF(("multiClickTime = %d\n", multiClickTime));
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12983
    __INST(multiClickTimeDelta) = __MKSMALLINT(multiClickTime);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12984
%}
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12985
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 12986
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12987
primInitializeFor:aDisplayName
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12988
    "initialize the receiver for a connection to a display;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12989
     the argument, aDisplayName may be nil (for the default display)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12990
     or the name of the display server as hostname:number
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12991
     (not yet under WIN32)"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12992
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12993
%{  /* NOCONTEXT */
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12994
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12995
    RETURN ( __MKSMALLINT(1) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12996
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12997
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12998
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12999
reinitialize
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13000
    rootWin := rootDC := nil.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13001
    super reinitialize.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13002
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13003
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13004
!WinWorkstation methodsFor:'keyboard mapping'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13005
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13006
altModifierMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13007
    "return the mask (in motionEvents) for the alt-key modifier.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13008
     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
 13009
     therefore return a variable here, which can be changed during startup."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13010
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13011
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13012
    RETURN (__MKSMALLINT(AltMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13013
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13014
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13015
    "Created: 23.3.1996 / 12:43:22 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13016
    "Modified: 23.3.1996 / 12:44:56 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13017
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13018
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13019
leftAltMask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13020
    "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
 13021
     See comment in altModifierMask: / metaModifierMask: for what
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13022
     this could be used."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13023
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13024
%{  /* NOCONTEXT */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13025
    RETURN (__MKSMALLINT(LeftAltMask));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13026
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13027
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13028
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13029
metaModifierMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13030
    "return the mask (in motionEvents) for the meta-key modifier.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13031
     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
 13032
     therefore return a variable here, which can be changed during startup."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13033
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13034
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13035
    RETURN (__MKSMALLINT(MetaMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13036
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13037
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13038
    "Created: 23.3.1996 / 12:43:39 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13039
    "Modified: 23.3.1996 / 12:45:09 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13040
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13041
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13042
modifierMapping
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13043
    "Get the Modifier Mapping.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13044
     We return an array of arrays of keycodes"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13045
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13046
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13047
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13048
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13049
rightAltMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13050
    "return the mask bit for the right Alt modifier key.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13051
     See comment in altModifierMask: / metaModifierMask: for what
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13052
     this could be used."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13053
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13054
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13055
    RETURN (__MKSMALLINT(RightAltMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13056
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13057
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13058
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13059
stringFromKeycode:code
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13060
    "Get a KeySymbol (a smalltalk symbol) from the keycode."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13061
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13062
    ^ ''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13063
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13064
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13065
	Display stringFromKeycode:28
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13066
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13067
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13068
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13069
!WinWorkstation methodsFor:'misc'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13070
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13071
beep
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13072
    "output an audible beep"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13073
3080
544b4061b1f0 *** empty log message ***
ps
parents: 2930
diff changeset
 13074
    UserPreferences current beepEnabled ifFalse:[^self].
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
 13075
%{  
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13076
#ifdef BEEP_IN_WINTHREAD
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13077
    PostThreadMessage(_dispatchThreadId, WM_THREAD_BEEP, 0, 0);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13078
#else
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
 13079
    MessageBeep( MB_ICONEXCLAMATION);
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13080
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13081
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13082
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13083
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13084
flush
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13085
    "send all buffered drawing to the display.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13086
     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
 13087
     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
 13088
     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
 13089
     (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
 13090
     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
 13091
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13092
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13093
     GdiFlush();
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13094
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13095
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13096
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13097
setInputFocusTo:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13098
    self setInputFocusTo:aWindowId revertTo:nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13099
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13100
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13101
setInputFocusTo:aWindowId revertTo:revertSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13102
    "set the focus to the view as defined by aWindowId.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13103
     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
 13104
     input until a new focus is set.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13105
     RevertSymbol specifies what should happen if the view becomes invisible;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13106
     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
 13107
     given to the parent view, the root view or no view."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13108
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13109
%{
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13110
    if (__isExternalAddress(aWindowId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13111
	HWND hWnd = _HWNDVal(aWindowId);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 13112
	int r = 0;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13113
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13114
	if (revertSymbol == @symbol(parent)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13115
	    r = 1;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13116
	} else if (revertSymbol == @symbol(root)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13117
	    r = 2;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13118
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13119
	if (hWnd) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13120
	    if (GetFocus() != hWnd) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13121
		CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13122
#ifdef SET_FOCUS_IN_WINTHREAD
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13123
		PostMessage(hWnd, WM_THREAD_SETFOCUS, (INT)hWnd, GetCurrentThreadId());
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13124
#else
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13125
		if (SetFocus(hWnd) == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13126
		    PRINTF(("SetFocus to %x failed.\n",hWnd));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13127
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13128
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13129
	    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13130
		CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r));
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 13131
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13132
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13133
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13134
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13135
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13136
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13137
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13138
!WinWorkstation methodsFor:'native dialogs'!
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 13139
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13140
nativeConfirm:aString title:titleString flags:flags initialAnswer:trueOrFalse
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13141
     ^ self 
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13142
	nativeMessageBoxFor:nil 
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13143
	text:aString 
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13144
	title:titleString
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13145
	flags:flags
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13146
	blocking:false
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13147
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13148
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13149
      Screen current
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13150
	nativeConfirm:'please confirm'  
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13151
	title:'Confirm' 
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13152
	flags:#( APPLMODAL ICONQUESTION OKCANCEL) 
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13153
	initialAnswer:true   
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13154
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13155
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13156
      Screen current
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13157
	nativeConfirm:'Yes or No' 
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13158
	title:'Confirm' 
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13159
	flags:#( APPLMODAL ICONQUESTION YESNO) 
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13160
	initialAnswer:true
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13161
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13162
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13163
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13164
nativeConfirmOKCancel:aString title:titleString initialAnswer:trueOrFalse
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13165
     ^ (self 
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13166
	nativeConfirm:aString
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13167
	title:titleString 
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13168
	flags:#( APPLMODAL ICONQUESTION OKCANCEL) 
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13169
	initialAnswer:trueOrFalse) == #IDOK
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13170
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13171
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13172
      Screen current
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13173
	nativeConfirmOKCancel:'please confirm' title:'Confirm' initialAnswer:true
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13174
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13175
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13176
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13177
nativeConfirmYesNo:aString title:titleString initialAnswer:trueOrFalse
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13178
     ^ (self 
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13179
	nativeConfirm:aString
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13180
	title:titleString 
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13181
	flags:#( APPLMODAL ICONQUESTION YESNO) 
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13182
	initialAnswer:trueOrFalse) == #IDYES
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13183
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13184
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13185
      Screen current
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13186
	nativeConfirmYesNo:'please confirm' title:'Confirm' initialAnswer:true
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13187
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13188
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13189
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13190
nativeFileDialogFor:ownerId save:isSaveDialog title:titleOrNil inDirectory:dirPathOrNil 
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13191
	     initialAnswer:initialOrNil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13192
	     filter:filterArrayOrNil extension:extensionOrNil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13193
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13194
    "start a native open-file dialog.
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13195
     If not cancelled, the selected fileName is returned; nil otherwise.
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13196
     Of course, this one looks like the
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13197
     Windows file dialog - no matter which viewStyle settings are active.
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13198
     Notice: if no ownerId is given, the dialog pops up at 0@0.
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13199
     filterArrayOrNil: if non nil, must be an array of 2-element arrays,
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13200
		       each element specifying filter commnet and filter
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13201
		       i.e. #( 'bitmap files (*.bmp)' '*.bmp' )
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13202
		       i.e. #( 'smalltalk files' '*.st' )
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13203
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13204
     EXPERIMENTAL & non-portable: use with caution"
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13205
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13206
    |flags|
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13207
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13208
    isSaveDialog ifTrue:[
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13209
	flags := #(
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13210
			#ENABLESIZING
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13211
			#HIDEREADONLY    
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13212
			#EXPLORER
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13213
			#ENABLESIZING
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13214
			#OVERWRITEPROMPT
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13215
		  )
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13216
    ] ifFalse:[
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13217
	flags := #(
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13218
			#ENABLESIZING
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13219
			#HIDEREADONLY    
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13220
			#EXPLORER
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13221
			#ENABLESIZING
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13222
		  )
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13223
    ].
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13224
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13225
    ^ self 
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13226
	nativeFileDialogFor:ownerId 
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13227
	save:isSaveDialog 
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13228
	title:titleOrNil 
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13229
	inDirectory:dirPathOrNil 
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13230
	initialAnswer:initialOrNil 
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13231
	flags:flags
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13232
	filter:filterArrayOrNil 
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13233
	extension:extensionOrNil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13234
	blocking:false
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13235
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13236
    "
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13237
     Display 
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13238
	nativeFileDialogFor:nil save:false
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13239
	title:'Test OpenFile Dialog'
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13240
	inDirectory:nil 
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13241
	initialAnswer:nil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13242
	filter:nil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13243
	extension:nil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13244
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13245
     Display 
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13246
	nativeFileDialogFor:nil save:true
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13247
	title:'Test SaveFile Dialog'
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13248
	inDirectory:nil 
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13249
	initialAnswer:nil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13250
	filter:nil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13251
	extension:nil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13252
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13253
     Display 
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13254
	nativeFileDialogFor:nil save:true
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13255
	title:'Test SaveFile Dialog'
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13256
	inDirectory:nil 
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13257
	initialAnswer:'newFile.bmp'
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13258
	filter:nil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13259
	extension:'bmp'
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13260
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13261
     Display 
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13262
	nativeFileDialogFor:nil save:false
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13263
	title:'Test OpenFile Dialog'
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13264
	inDirectory:nil 
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13265
	initialAnswer:nil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13266
	filter:#( 
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13267
		    #( 'all files'       '*.*' )
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13268
		    #( 'smalltalk files' '*.st' )
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13269
		    #( 'change files'    '*.chg' )
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13270
		    #( 'image files'     '*.img' )
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13271
		)
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13272
	extension:nil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13273
    "
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13274
!
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13275
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13276
nativeFileDialogFor:ownerId save:isSaveDialog title:titleOrNil inDirectory:dirPathOrNil 
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13277
	     initialAnswer:initialOrNil flags:flagArray
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13278
	     filter:filterArrayOrNil extension:extensionOrNil
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13279
	     blocking:blocking
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13280
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13281
    "start a native open-file dialog.
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13282
     If not cancelled, the selected fileName is returned; nil otherwise.
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13283
     Of course, this one looks like the
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 13284
     Windows file dialog - no matter which viewStyle settings are active.
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 13285
     Notice: if no ownerId is given, the dialog pops up at 0@0.
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13286
     filterArrayOrNil: if non nil, must be an array of 2-element arrays,
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13287
		       each element specifying filter commnet and filter
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13288
		       i.e. #( 'bitmap files (*.bmp)' '*.bmp' )
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13289
		       i.e. #( 'smalltalk files' '*.st' )
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13290
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13291
     EXPERIMENTAL & non-portable: use with caution"
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13292
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13293
    |rslt errorCode fileName|
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13294
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13295
%{  /* STACK: 32000*/
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13296
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13297
#ifndef NO_NATIVE_DIALOGS
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 13298
    OPENFILENAME ofn;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 13299
    HWND hWndOwner = NULL;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13300
    char fileNameBuffer[256] = "\0";
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13301
    char filterBuffer[1024*4] = "\0";
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13302
    BOOL __rslt;
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 13303
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 13304
    if (__isExternalAddress(ownerId)) {
3521
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 13305
	hWndOwner = _HWNDVal(ownerId);
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 13306
    }
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 13307
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13308
# ifdef OPENFILENAME_SIZE_VERSION_400
3526
e9c3f08c2305 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
 13309
    ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; // sizeof(ofn);
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13310
# else
3544
6c59714157cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3526
diff changeset
 13311
    ofn.lStructSize = sizeof(ofn);
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13312
# endif
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 13313
    ofn.hwndOwner = hWndOwner;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 13314
    ofn.hInstance = NULL;
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 13315
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13316
    if ((filterArrayOrNil != nil) && __isArray(filterArrayOrNil)) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13317
	char *dst = filterBuffer;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13318
	int idx;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13319
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13320
	for (idx=0; idx<__arraySize(filterArrayOrNil); idx++) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13321
	    OBJ el = __ArrayInstPtr(filterArrayOrNil)->a_element[idx];
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 13322
// printf("idx = %d\n", idx);
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13323
	    if (__isArray(el) && (__arraySize(el) == 2)) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13324
		OBJ descr, filter;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13325
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13326
		descr = __ArrayInstPtr(el)->a_element[0];
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13327
		filter = __ArrayInstPtr(el)->a_element[1];
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13328
		if (__isString(descr) && __isString(filter)) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13329
		    char *src = __stringVal(descr);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13330
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 13331
// printf("descr: %s filter: %s\n", __stringVal(descr), __stringVal(filter));
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13332
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13333
		    // append (incl 0-byte)
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13334
		    while (*src) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13335
			*dst++ = *src++;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13336
		    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13337
		    *dst++ = '\0';    
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13338
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13339
		    src = __stringVal(filter);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13340
		    // append (incl 0-byte)
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13341
		    while (*src) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13342
			*dst++ = *src++;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13343
		    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13344
		    *dst++ = '\0';    
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13345
		}
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13346
	    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13347
	}
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13348
	*dst++ = '\0';
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13349
	*dst = '\0';
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13350
	ofn.lpstrFilter = filterBuffer;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13351
	ofn.nFilterIndex = 1;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13352
    } else {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13353
	ofn.lpstrFilter = NULL;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13354
	ofn.nFilterIndex = 0;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13355
    }
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 13356
    ofn.lpstrCustomFilter = NULL;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 13357
    ofn.nMaxCustFilter = 0;
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 13358
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 13359
    if (__isString(initialOrNil)) {
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 13360
	strcpy(fileNameBuffer, __stringVal(initialOrNil));
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 13361
    }
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13362
    ofn.lpstrFile = fileNameBuffer;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13363
    ofn.nMaxFile = sizeof(fileNameBuffer);
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 13364
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 13365
    ofn.lpstrFileTitle = NULL;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 13366
    ofn.nMaxFileTitle = 0;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13367
    if (__isString(dirPathOrNil)) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13368
	ofn.lpstrInitialDir = __stringVal(dirPathOrNil);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13369
    } else {
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 13370
	ofn.lpstrInitialDir = NULL;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13371
    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13372
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13373
    if (__isString(titleOrNil)) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13374
	ofn.lpstrTitle = __stringVal(titleOrNil);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13375
    } else {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13376
	ofn.lpstrTitle = "";
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13377
    }
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 13378
    ofn.nFileOffset = 0;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 13379
    ofn.nFileExtension = 0;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13380
    if (__isString(extensionOrNil)) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13381
	ofn.lpstrDefExt = __stringVal(extensionOrNil);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13382
    } else {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13383
	ofn.lpstrDefExt = NULL;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13384
    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13385
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 13386
    ofn.lCustData = NULL;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 13387
    ofn.lpfnHook = NULL;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 13388
    ofn.lpTemplateName = NULL;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13389
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13390
    ofn.Flags = 0;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13391
    if (__isNonNilObject(flagArray) && __isArray(flagArray)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13392
	int i;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13393
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13394
	for (i=0; i<__arraySize(flagArray); i++) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13395
	    OBJ flag = __ArrayInstPtr(flagArray)->a_element[i];
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13396
	    int flagVal = 0;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13397
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13398
	    if (__isSmallInteger(flag)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13399
		flagVal = __intVal(flag);
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13400
	    } else if (flag == @symbol(READONLY)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13401
		flagVal = OFN_READONLY;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13402
	    } else if (flag == @symbol(OVERWRITEPROMPT)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13403
		flagVal = OFN_OVERWRITEPROMPT;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13404
	    } else if (flag == @symbol(HIDEREADONLY)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13405
		flagVal = OFN_HIDEREADONLY;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13406
	    } else if (flag == @symbol(NOCHANGEDIR)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13407
		flagVal = OFN_NOCHANGEDIR;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13408
	    } else if (flag == @symbol(SHOWHELP)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13409
		flagVal = OFN_SHOWHELP;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13410
	    } else if (flag == @symbol(ENABLEHOOK)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13411
		flagVal = OFN_ENABLEHOOK;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13412
	    } else if (flag == @symbol(ENABLETEMPLATE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13413
		flagVal = OFN_ENABLETEMPLATE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13414
	    } else if (flag == @symbol(ENABLETEMPLATEHANDLE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13415
		flagVal = OFN_ENABLETEMPLATEHANDLE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13416
	    } else if (flag == @symbol(NOVALIDATE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13417
		flagVal = OFN_NOVALIDATE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13418
	    } else if (flag == @symbol(ALLOWMULTISELECT)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13419
		flagVal = OFN_ALLOWMULTISELECT;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13420
	    } else if (flag == @symbol(EXTENSIONDIFFERENT)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13421
		flagVal = OFN_EXTENSIONDIFFERENT;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13422
	    } else if (flag == @symbol(PATHMUSTEXIST)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13423
		flagVal = OFN_PATHMUSTEXIST;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13424
	    } else if (flag == @symbol(FILEMUSTEXIST)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13425
		flagVal = OFN_FILEMUSTEXIST;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13426
	    } else if (flag == @symbol(CREATEPROMPT)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13427
		flagVal = OFN_CREATEPROMPT;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13428
	    } else if (flag == @symbol(SHAREAWARE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13429
		flagVal = OFN_SHAREAWARE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13430
	    } else if (flag == @symbol(NOREADONLYRETURN)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13431
		flagVal = OFN_NOREADONLYRETURN;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13432
	    } else if (flag == @symbol(NOTESTFILECREATE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13433
		flagVal = OFN_NOTESTFILECREATE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13434
	    } else if (flag == @symbol(NONETWORKBUTTON)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13435
		flagVal = OFN_NONETWORKBUTTON;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13436
	    } else if (flag == @symbol(NOLONGNAMES)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13437
		flagVal = OFN_NOLONGNAMES;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13438
# ifdef OFN_EXPLORER
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13439
	    } else if (flag == @symbol(EXPLORER)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13440
		flagVal = OFN_EXPLORER;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13441
# endif
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13442
# ifdef OFN_NODEREFERENCELINKS
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13443
	    } else if (flag == @symbol(NODEREFERENCELINKS)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13444
		flagVal = OFN_NODEREFERENCELINKS;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13445
# endif
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13446
# ifdef OFN_LONGNAMES
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13447
	    } else if (flag == @symbol(LONGNAMES)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13448
		flagVal = OFN_LONGNAMES;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13449
# endif
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13450
# ifdef OFN_ENABLEINCLUDENOTIFY
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13451
	    } else if (flag == @symbol(ENABLEINCLUDENOTIFY)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13452
		flagVal = OFN_ENABLEINCLUDENOTIFY;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13453
# endif
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13454
# ifdef OFN_ENABLESIZING
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13455
	    } else if (flag == @symbol(ENABLESIZING)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13456
		flagVal = OFN_ENABLESIZING;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13457
# endif
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13458
	    }
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13459
	    ofn.Flags |= flagVal;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13460
	}
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13461
    }
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 13462
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13463
    if (isSaveDialog == true) {
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13464
	if (blocking == true) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13465
	    __rslt = GetSaveFileName(&ofn);
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13466
	} else {
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 13467
	    do {
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 13468
		__threadErrno = 0;
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 13469
		__rslt = __STX_API_CALL1( "GetSaveFileName", (void *)GetSaveFileName, (void *)(&ofn));
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 13470
	    } while ((__rslt < 0) && (__threadErrno == EINTR));
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13471
	}
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13472
    } else {
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13473
	if (blocking == true) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13474
	    __rslt = GetOpenFileName(&ofn);
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13475
	} else {
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 13476
	    do {
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 13477
		__threadErrno = 0;
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 13478
		__rslt = __STX_API_CALL1( "GetOpenFileName", (void *)GetOpenFileName, (void *)(&ofn));
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 13479
	    } while ((__rslt < 0) && (__threadErrno == EINTR));
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13480
	}
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13481
    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13482
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13483
    if (__rslt == TRUE) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13484
	rslt = true;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13485
	fileName = __MKSTRING(fileNameBuffer);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13486
    } else {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13487
	rslt = false;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13488
	errorCode = __MKSMALLINT(CommDlgExtendedError());
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13489
    }
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13490
#else
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13491
    errorCode = __MKSMALLINT(-1);
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13492
#endif /* NO_NATIVE_DIALOGS */
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 13493
%}.
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13494
    (errorCode notNil) ifTrue:[
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 13495
	errorCode ~~ 0 ifTrue:[
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 13496
	    self primitiveFailed.
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 13497
	].
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 13498
	^ nil
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 13499
    ].
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 13500
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13501
    ^ fileName
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13502
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13503
    "
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13504
     Display 
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13505
	nativeFileDialogFor:nil save:false
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13506
	title:'Test OpenFile Dialog'
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 13507
	inDirectory:nil 
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 13508
	initialAnswer:nil
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13509
	flags:#( ENABLESIZING HIDEREADONLY EXPLORER ENABLESIZING )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13510
	filter:#( 
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13511
		    #( 'all files'       '*.*' )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13512
		    #( 'smalltalk files' '*.st' )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13513
		    #( 'change files'    '*.chg' )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13514
		    #( 'image files'     '*.img' )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13515
		)
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13516
	extension:nil
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13517
	blocking:false   
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13518
    "
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13519
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13520
    "
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13521
     Display 
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13522
	nativeFileDialogFor:nil save:false
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13523
	title:'Test OpenFile Dialog'
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13524
	inDirectory:nil 
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13525
	initialAnswer:nil
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13526
	flags:#( ENABLESIZING HIDEREADONLY EXPLORER ENABLESIZING )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13527
	filter:#( 
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13528
		    #( 'all files'       '*.*' )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13529
		    #( 'smalltalk files' '*.st' )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13530
		    #( 'change files'    '*.chg' )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13531
		    #( 'image files'     '*.img' )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13532
		)
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13533
	extension:nil
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 13534
	blocking:true   
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 13535
    "
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13536
!
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13537
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13538
nativeInformationOK:aString title:titleString 
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13539
     ^ self 
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13540
	nativeConfirm:aString
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13541
	title:titleString 
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13542
	flags:#( APPLMODAL ICONINFORMATION OK) 
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13543
	initialAnswer:nil
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13544
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13545
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13546
      Screen current
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13547
	nativeInformationOK:'Some Info' title:'Info'
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13548
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13549
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13550
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13551
nativeMessageBoxFor:ownerId text:textOrNil title:titleOrNil flags:flagArray blocking:blocking
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13552
    "start a native message box dialog.
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13553
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13554
     EXPERIMENTAL & non-portable: use with caution"
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13555
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13556
    |errorCode answer|
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13557
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13558
%{  /* STACK: 32000*/
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13559
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13560
#ifndef NO_NATIVE_DIALOGS
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13561
    HWND hWndOwner = NULL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13562
    int boxFlags = 0;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13563
    char *__title;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13564
    char *__text;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13565
    int __answer;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13566
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13567
    if (__isExternalAddress(ownerId)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13568
	hWndOwner = _HWNDVal(ownerId);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13569
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13570
    if (__isString(titleOrNil)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13571
	__title = __stringVal(titleOrNil);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13572
    } else {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13573
	__title = "";
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13574
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13575
    if (__isString(textOrNil)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13576
	__text = __stringVal(textOrNil);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13577
    } else {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13578
	__text = "";
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13579
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13580
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13581
    if (__isNonNilObject(flagArray) && __isArray(flagArray)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13582
	int i;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13583
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13584
	for (i=0; i<__arraySize(flagArray); i++) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13585
	    OBJ flag = __ArrayInstPtr(flagArray)->a_element[i];
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13586
	    int flagVal = 0;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13587
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13588
	    if (__isSmallInteger(flag)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13589
		flagVal = __intVal(flag);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13590
	    } else if (flag == @symbol(ABORTRETRYIGNORE)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13591
		flagVal = MB_ABORTRETRYIGNORE;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13592
	    } else if (flag == @symbol(APPLMODAL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13593
		flagVal = MB_APPLMODAL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13594
	    } else if (flag == @symbol(DEFAULT_DESKTOP_ONLY)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13595
		flagVal = MB_DEFAULT_DESKTOP_ONLY;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13596
	    } else if (flag == @symbol(DEFBUTTON1)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13597
		flagVal = MB_DEFBUTTON1;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13598
	    } else if (flag == @symbol(DEFBUTTON2)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13599
		flagVal = MB_DEFBUTTON2;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13600
	    } else if (flag == @symbol(DEFBUTTON3)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13601
		flagVal = MB_DEFBUTTON3;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13602
	    } else if (flag == @symbol(ICONASTERISK)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13603
		flagVal = MB_ICONASTERISK;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13604
	    } else if (flag == @symbol(ICONHAND)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13605
		flagVal = MB_ICONHAND;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13606
	    } else if (flag == @symbol(ICONINFORMATION)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13607
		flagVal = MB_ICONINFORMATION;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13608
	    } else if (flag == @symbol(ICONQUESTION)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13609
		flagVal = MB_ICONQUESTION;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13610
	    } else if (flag == @symbol(ICONSTOP)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13611
		flagVal = MB_ICONSTOP;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13612
	    } else if (flag == @symbol(OK)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13613
		flagVal = MB_OK;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13614
	    } else if (flag == @symbol(OKCANCEL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13615
		flagVal = MB_OKCANCEL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13616
	    } else if (flag == @symbol(RETRYCANCEL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13617
		flagVal = MB_RETRYCANCEL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13618
	    } else if (flag == @symbol(SETFOREGROUND)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13619
		flagVal = MB_SETFOREGROUND;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13620
	    } else if (flag == @symbol(SYSTEMMODAL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13621
		flagVal = MB_SYSTEMMODAL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13622
	    } else if (flag == @symbol(TASKMODAL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13623
		flagVal = MB_TASKMODAL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13624
	    } else if (flag == @symbol(YESNO)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13625
		flagVal = MB_YESNO;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13626
	    } else if (flag == @symbol(YESNOCANCEL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13627
		flagVal = MB_YESNOCANCEL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13628
	    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13629
	    boxFlags |= flagVal;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13630
	}
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13631
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13632
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13633
    if (blocking == true) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13634
	__answer = MessageBox(hWndOwner, 
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13635
		   __text,
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13636
		   __title,
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13637
		   boxFlags);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13638
    } else {
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 13639
	do {
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 13640
	    __threadErrno = 0;
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 13641
	    __answer = __STX_API_CALL4( "MessageBox",
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 13642
					(void *)MessageBox,
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 13643
					(void *)hWndOwner, 
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 13644
					(void *)__text,
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 13645
					(void *)__title,
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 13646
					(void *)boxFlags);
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 13647
	} while ((__answer < 0) && (__threadErrno == EINTR));
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13648
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13649
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13650
    switch (__answer) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13651
	case IDABORT:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13652
	    answer = @symbol(IDABORT);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13653
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13654
	case IDCANCEL:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13655
	    answer = @symbol(IDCANCEL);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13656
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13657
	case IDIGNORE:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13658
	    answer = @symbol(IDIGNORE);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13659
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13660
	case IDNO:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13661
	    answer = @symbol(IDNO);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13662
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13663
	case IDOK:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13664
	    answer = @symbol(IDOK);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13665
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13666
	case IDRETRY:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13667
	    answer = @symbol(IDRETRY);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13668
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13669
	case IDYES:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13670
	    answer = @symbol(IDYES);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13671
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13672
	default:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13673
	    answer = __MKSMALLINT(__answer);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13674
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13675
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13676
#else
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13677
    errorCode = __MKSMALLINT(-1);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13678
#endif /* NO_NATIVE_DIALOGS */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13679
%}.
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13680
    (errorCode notNil) ifTrue:[
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13681
	self primitiveFailed.
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 13682
	^ nil
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13683
    ].
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13684
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13685
    ^ answer
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13686
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13687
    "
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13688
     Display 
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13689
	nativeMessageBoxFor:nil 
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13690
	text:'Hello world' 
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13691
	title:'Message'
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13692
	flags:#( OK APPLMODAL ICONSTOP )
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13693
	blocking:true
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13694
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13695
     Display 
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13696
	nativeMessageBoxFor:nil 
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13697
	text:'Hello world' 
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13698
	title:'Message'
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13699
	flags:#( OK APPLMODAL ICONSTOP )
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13700
	blocking:false
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13701
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13702
     Display 
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13703
	nativeMessageBoxFor:nil 
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13704
	text:'Hello world' 
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13705
	title:'Message'
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13706
	flags:#( ABORTRETRYIGNORE ICONSTOP )
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13707
	blocking:false
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 13708
    "
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13709
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13710
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13711
nativeWarnOK:aString title:titleString 
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13712
     ^ self 
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13713
	nativeConfirm:aString
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13714
	title:titleString 
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13715
	flags:#( APPLMODAL ICONSTOP OK) 
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13716
	initialAnswer:nil
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13717
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13718
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13719
      Screen current
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
 13720
	nativeWarnOK:'some warning' title:'Warning'
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 13721
     "
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 13722
! !
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 13723
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13724
!WinWorkstation methodsFor:'pointer queries '!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13725
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13726
anyButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13727
    "return an integer for masking out any button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13728
     buttonStates value."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13729
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13730
    "/ should use ``Display buttonXMotionMask bitOr:....''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13731
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13732
%{  /* NOCONTEXT */
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 13733
    RETURN ( __MKSMALLINT(AnyButtonMask) );
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13734
%}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13735
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13736
    "Modified: 23.3.1996 / 12:41:33 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13737
    "Created: 23.3.1996 / 12:46:35 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13738
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13739
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13740
buttonStates
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13741
    "return an integer representing the state of the pointer buttons;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13742
     a one-bit in positions 0.. represent a pressed button.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13743
     See the button1Mask/button2Mask/button3Mask,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13744
     shiftMask/controlMask and modifierMask methods for the meaning of the bits."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13745
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13746
%{  /* NOCONTEXT */
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 13747
    int modifiers = 0;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 13748
    int b1m = Button1Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 13749
    int b3m = Button3Mask;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 13750
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 13751
    if (GetSystemMetrics(SM_SWAPBUTTON)) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 13752
	b3m = Button1Mask;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 13753
	b1m = Button3Mask;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 13754
    }
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 13755
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 13756
    if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 13757
	modifiers |= b1m;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 13758
    if (GetAsyncKeyState(VK_MBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 13759
	modifiers |= Button2Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 13760
    if (GetAsyncKeyState(VK_RBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 13761
	modifiers |= b3m;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 13762
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13763
    RETURN (__MKSMALLINT(modifiers));
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13764
%}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13765
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13766
    "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13767
     Display buttonStates
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13768
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13769
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13770
    "is the control-key pressed ?
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13771
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13772
     Display buttonStates bitTest:(Display controlMask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13773
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13774
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13775
    "is the alt/meta-key pressed ?
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13776
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13777
     Display buttonStates bitTest:(Display altModifierMask)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13778
     Display buttonStates bitTest:(Display metaModifierMask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13779
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13780
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13781
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13782
leftButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13783
    "return an integer for masking out the left button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13784
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13785
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13786
    "/ should use ``Display button1MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13787
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13788
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13789
    RETURN ( __MKSMALLINT(Button1Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13790
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13791
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13792
    "Modified: 23.3.1996 / 12:41:33 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13793
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13794
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13795
middleButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13796
    "return an integer for masking out the middle button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13797
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13798
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13799
    "/ should use ``Display button2MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13800
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13801
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13802
    RETURN ( __MKSMALLINT(Button2Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13803
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13804
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13805
    "Modified: 23.3.1996 / 12:41:43 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13806
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13807
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13808
pointerPosition
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
 13809
    "return the current pointer position in root-window (i.e. screen) coordinates"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13810
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13811
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13812
    POINT p;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13813
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13814
    if (! GetCursorPos(&p)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13815
	p.x = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13816
	p.y = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13817
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13818
    RETURN (__MKPOINT_INT(p.x, p.y));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13819
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13820
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13821
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13822
rightButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13823
    "return an integer for masking out the right button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13824
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13825
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13826
    "/ should use ``Display button3MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13827
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13828
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13829
    RETURN ( __MKSMALLINT(Button3Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13830
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13831
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13832
    "Modified: 23.3.1996 / 12:41:52 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13833
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13834
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13835
rootPositionOfLastEvent
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13836
    "return the position in root-window coordinates
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13837
     of the last button, key or pointer event"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13838
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13839
%{  /* NOCONTEXT */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13840
    RETURN (__MKPOINT_INT(evRootX, evRootY));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13841
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13842
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13843
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13844
setPointerPosition:newPosition
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13845
    "change the pointer position in root-window coordinates."
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13846
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13847
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13848
    if (__isPoint(newPosition)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13849
	OBJ xpos, ypos;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13850
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13851
	xpos = __point_X(newPosition);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13852
	ypos = __point_Y(newPosition);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13853
	if (__bothSmallInteger(xpos, ypos)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13854
	    SetCursorPos(__intVal(xpos), __intVal(ypos));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 13855
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13856
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13857
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13858
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13859
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13860
setPointerPosition:newPosition in:aWindowId
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13861
    "change the pointer position to a new position relative to the
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13862
     given windows origin (which may be the rootWindow).
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13863
     Be careful with this - its usually not very ergonimically
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13864
     to change the mousePointer position.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13865
     This interface is provided for special applications (presentation
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13866
     playback) and should not be used in normal applications."
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13867
3895
31caf29bcda1 there is no setCursorPosition (?!)
Claus Gittinger <cg@exept.de>
parents: 3850
diff changeset
 13868
"/    self setCursorPosition:(self translatePoint:newPosition from:aWindowId to:self rootView id).
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13869
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13870
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13871
!WinWorkstation methodsFor:'retrieving pixels'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13872
1461
6d8b022bfcd8 renamed getBitsFrom to getBitsFromId
Claus Gittinger <cg@exept.de>
parents: 1426
diff changeset
 13873
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
 13874
    "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
 13875
     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
 13876
     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
 13877
     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
 13878
     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
 13879
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13880
    |rawInfo info|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13881
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13882
    ((w <= 0) or:[h <= 0]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13883
	self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13884
	^ nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13885
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13886
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13887
    rawInfo := Array new:11.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13888
		  "1 -> bit order"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13889
		  "2 -> depth"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13890
		  "3 -> bytes_per_line"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13891
		  "4 -> byte_order"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13892
		  "5 -> format"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13893
		  "6 -> bitmap_unit"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13894
		  "7 -> bitmap_pad"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13895
		  "8 -> bits_per_pixel"
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13896
		  "9 -> red_mask"
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13897
		  "10 -> green_mask"
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13898
		  "11 -> blue_mask"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13899
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13900
    "/ 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
 13901
    "/ unlimitedStack (some implementations use alloca and require huge amounts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13902
    "/ of temporary stack space
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13903
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13904
    (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
 13905
	info := IdentityDictionary new.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13906
	info at:#bitOrder put:(rawInfo at:1).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13907
	info at:#depth put:(rawInfo at:2).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13908
	info at:#bytesPerLine put:(rawInfo at:3).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13909
	info at:#byteOrder put:(rawInfo at:4).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13910
	info at:#format put:(rawInfo at:5).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13911
	info at:#bitmapUnit put:(rawInfo at:6).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13912
	info at:#bitmapPad put:(rawInfo at:7).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13913
	info at:#bitsPerPixel put:(rawInfo at:8).
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13914
	info at:#redMask put:(rawInfo at:9).
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13915
	info at:#greenMask put:(rawInfo at:10).
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13916
	info at:#blueMask put:(rawInfo at:11).
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13917
	^ info
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13918
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13919
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13920
     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
 13921
     or is too small to hold the bits
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13922
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13923
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13924
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13925
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13926
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
 13927
    "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
 13928
     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
 13929
     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
 13930
     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
 13931
     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
 13932
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13933
    |rawInfo info|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13934
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13935
    ((w <= 0) or:[h <= 0]) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13936
	self primitiveFailed.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13937
	^ nil
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13938
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13939
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13940
    rawInfo := Array new:11.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13941
		  "1 -> bit order"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13942
		  "2 -> depth"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13943
		  "3 -> bytes_per_line"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13944
		  "4 -> byte_order"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13945
		  "5 -> format"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13946
		  "6 -> bitmap_unit"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13947
		  "7 -> bitmap_pad"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13948
		  "8 -> bits_per_pixel"
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13949
		  "9 -> red_mask"
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13950
		  "10 -> green_mask"
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13951
		  "11 -> blue_mask"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13952
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13953
    "/ 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
 13954
    "/ 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
 13955
    "/ of temporary stack space
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13956
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13957
    (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
 13958
	info := IdentityDictionary new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13959
	info at:#bitOrder put:(rawInfo at:1).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13960
	info at:#depth put:(rawInfo at:2).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13961
	info at:#bytesPerLine put:(rawInfo at:3).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13962
	info at:#byteOrder put:(rawInfo at:4).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13963
	info at:#format put:(rawInfo at:5).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13964
	info at:#bitmapUnit put:(rawInfo at:6).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13965
	info at:#bitmapPad put:(rawInfo at:7).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13966
	info at:#bitsPerPixel put:(rawInfo at:8).
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13967
	info at:#redMask put:(rawInfo at:9).
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13968
	info at:#greenMask put:(rawInfo at:10).
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 13969
	info at:#blueMask put:(rawInfo at:11).
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13970
	^ info
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13971
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13972
    "
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13973
     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
 13974
     or is too small to hold the bits
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13975
    "
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13976
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13977
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13978
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 13979
getPixelX:px y:py from:aDrawableId with:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13980
    "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
 13981
     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
 13982
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 13983
%{  /* NOCONTEXT */
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 13984
    if (__isExternalAddress(aGCId)
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 13985
     && __bothSmallInteger(px, py)) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 13986
	struct gcData *gcData = _GCDATA(aGCId);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 13987
	HDC hDC;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 13988
	int __x = __intVal(px), __y = __intVal(py);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 13989
	int pixel;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 13990
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 13991
	hDC = _getDC(gcData);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 13992
	pixel = GetPixel(hDC, __x, __y);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 13993
#ifndef CACHE_LAST_DC
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 13994
	_releaseDC(gcData);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 13995
#endif
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 13996
	/*
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 13997
	 * for compatibility, return the pixelValue
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 13998
	 * from a monochrome bitmap
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 13999
	 */
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 14000
	if (gcData->hBitmap) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 14001
	    if (gcData->bitmapColorBitCount == 1) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 14002
		pixel = (pixel == 0) ? 0 : 1;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 14003
	    }
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 14004
	}
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 14005
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 14006
	RETURN ( __MKSMALLINT(pixel & 0xFFFFFF) );
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 14007
    }
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 14008
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14009
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14010
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14011
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14012
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
 14013
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 14014
%{  
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 14015
    int     height, width;
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 14016
    int     numBytes;
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 14017
    HWND    hWnd;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14018
    HBITMAP hBitmap = 0;
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 14019
    HDC     bDC = 0;
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 14020
    struct {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14021
	BITMAPINFOHEADER bmiHeader;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14022
	DWORD r;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14023
	DWORD g;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14024
	DWORD b;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14025
    } bitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14026
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14027
    if (__isExternalAddress(aDrawableId)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14028
     && __bothSmallInteger(srcX, srcY)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14029
     && __bothSmallInteger(w, h)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14030
     && __isArray(info)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14031
     && __isByteArray(imageBits))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14032
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14033
	hWnd = _HWNDVal( aDrawableId );
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14034
	DPRINTF(("primGetBits %x\n",hWnd));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14035
	if( hWnd != 0 ) {
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 14036
	    HDC wDC;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14037
	    HANDLE prevBitmap;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14038
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14039
	    bDC = CreateCompatibleDC(__rootDC);
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 14040
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14041
	    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
 14042
	    height =  __intVal(h);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14043
	    width  =  __intVal(w);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14044
	    DPRINTF(("width %d height %d\n",width,height));
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
 14045
	    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
 14046
	    if (!hBitmap)
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14047
		goto fail;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14048
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14049
	    bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14050
	    bitmap.bmiHeader.biPlanes = 1;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14051
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14052
	    bitmap.bmiHeader.biCompression = BI_RGB;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14053
#else
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14054
	    if (__depth == 24) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14055
		bitmap.bmiHeader.biCompression = BI_RGB;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14056
	    } else if (__depth == 16) {
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14057
# if 0
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14058
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14059
		bitmap.b = 0x001f;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14060
		bitmap.g = 0x07e0;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14061
		bitmap.r = 0xf800;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14062
# else
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14063
		bitmap.b = 0;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14064
		bitmap.g = 0;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14065
		bitmap.r = 0;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14066
		bitmap.bmiHeader.biCompression = BI_RGB;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14067
# endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14068
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14069
#endif /* ALWAYSTRUECOLOR */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14070
	    bitmap.bmiHeader.biSizeImage = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14071
	    bitmap.bmiHeader.biXPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14072
	    bitmap.bmiHeader.biYPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14073
	    bitmap.bmiHeader.biClrUsed = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14074
	    bitmap.bmiHeader.biClrImportant = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14075
	    bitmap.bmiHeader.biBitCount = __depth;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14076
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
 14077
	    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
 14078
	    bitmap.bmiHeader.biHeight = -height;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14079
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 14080
	    wDC = GetDC(hWnd);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14081
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14082
	    SelectObject(bDC, hBitmap);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14083
	    if (BitBlt(bDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14084
		   0,0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14085
		   width,height,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14086
		   wDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14087
		   __intVal(srcX), __intVal(srcY),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14088
		   SRCCOPY)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14089
		 == 0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14090
		)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14091
	    {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14092
		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
 14093
	    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14094
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14095
#ifdef CACHE_LAST_DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14096
	    if (lastGcData && (lastGcData->_hDC == wDC)) {
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
 14097
# ifdef DEBUG_DC_REUSE
3126
5447d8c1d8d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3119
diff changeset
 14098
		fprintf(stderr, "WinWorkstation [info]: Oops - dont release - cachedDC reuse\n", __LINE__);
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
 14099
# endif
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14100
	    } else
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14101
#endif
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14102
#ifdef CACHE_LAST_WM_PAINT_DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14103
	    if (last_wm_paint_dc && (last_wm_paint_dc == wDC)) {
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
 14104
# ifdef DEBUG_DC_REUSE
3126
5447d8c1d8d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3119
diff changeset
 14105
		fprintf(stderr, "WinWorkstation [info]: Oops - dont release - last_wm_paint_dc reuse\n", __LINE__);
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
 14106
# endif
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14107
	    } else
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14108
#endif
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 14109
	    ReleaseDC(hWnd, wDC);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14110
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14111
	    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
 14112
	    {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14113
		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
 14114
		goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14115
	    }
3553
5a51330ea94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3548
diff changeset
 14116
	    DPRINTF(("bitmap info:%d %d %d %d\n", 
5a51330ea94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3548
diff changeset
 14117
			bitmap.bmiHeader.biWidth, bitmap.bmiHeader.biHeight,
5a51330ea94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3548
diff changeset
 14118
			bitmap.bmiHeader.biBitCount, bitmap.bmiHeader.biSizeImage));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14119
	    numBytes = bitmap.bmiHeader.biSizeImage;
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14120
	    if( numBytes != 0 ) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14121
		if (numBytes > __byteArraySize(imageBits)) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14122
		    /* imageBits too small */
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14123
		    INFOPRINT((stderr, "WinWorkstation [warning]: primGetBits - byteArray too small (is:%d need:%d; w:%d h%d)\n",
3553
5a51330ea94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3548
diff changeset
 14124
				__byteArraySize(imageBits), numBytes,
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14125
				bitmap.bmiHeader.biWidth, bitmap.bmiHeader.biHeight
3553
5a51330ea94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3548
diff changeset
 14126
			     ));
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14127
		    goto fail;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14128
		}
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14129
		DPRINTF(("numBytes %d\n",numBytes));
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14130
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14131
		bitmap.bmiHeader.biHeight = -height;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14132
		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
 14133
		{
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14134
		    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
 14135
		    goto fail;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14136
		}
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14137
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14138
		/* swap red and blue (windows delivers BGR) */
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14139
		{
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14140
		    char *cp = __ByteArrayInstPtr(imageBits)->ba_element;
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14141
		    int n = numBytes;
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14142
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14143
		    for ( ;n > 0; n -= 3, cp += 3) {
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14144
			  char b = cp[0];
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14145
			  cp[0] = cp[2];
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14146
			  cp[2] = b;
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14147
		    }
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14148
		}
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14149
	    } else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14150
		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
 14151
		goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14152
	    }
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14153
	} else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14154
	    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
 14155
	    goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14156
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14157
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14158
	__ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14159
	__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(1);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14160
	__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
 14161
	__ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14162
	__ArrayInstPtr(info)->a_element[4] = @symbol(XYPixmap);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14163
	__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14164
	__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(WIN32PADDING);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14165
	__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(bitmap.bmiHeader.biBitCount);
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14166
	__ArrayInstPtr(info)->a_element[8] = __MKSMALLINT(0x0000FF);   // redMask
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14167
	__ArrayInstPtr(info)->a_element[9] = __MKSMALLINT(0x00FF00);   // greenMask
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14168
	__ArrayInstPtr(info)->a_element[10] = __MKSMALLINT(0xFF0000);  // blueMask
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14169
	if (bDC)
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14170
	    DeleteDC(bDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14171
	if (hBitmap)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 14172
	    _DeleteObject(hBitmap, __LINE__);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14173
	RETURN ( true );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14174
    }
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14175
fail: ;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14176
    if (bDC)
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14177
	DeleteDC(bDC);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14178
    if (hBitmap)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 14179
	_DeleteObject(hBitmap, __LINE__);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14180
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14181
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14182
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14183
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14184
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
 14185
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 14186
%{  
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14187
    int            height, width;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14188
    int            numBytes;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14189
    unsigned char* ep = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14190
    HBITMAP        xBitmap;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14191
    HBITMAP hBitmap = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14192
    HDC bDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14193
    HDC xDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14194
    struct
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14195
    {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14196
	BITMAPINFOHEADER bmiHeader;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14197
	DWORD rgb[2];
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14198
    } bitmap;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14199
    BITMAP bitmapInfo;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14200
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14201
    if (__isExternalAddress(aDrawableId)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14202
     && __bothSmallInteger(srcX, srcY)
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14203
     && __bothSmallInteger(w, h)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14204
     && __isArray(info)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14205
     && __isByteArray(imageBits))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14206
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14207
	xBitmap = _HBITMAPVAL( aDrawableId );
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14208
	DPRINTF(("primGetBitsFromPixmap %x\n",xBitmap));
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 14209
	if (xBitmap != 0) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14210
	    xDC = GetDC(0);
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 14211
	    SelectObject(xDC, xBitmap);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14212
	    GetObject(xBitmap,sizeof(bitmapInfo),&bitmapInfo);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14213
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14214
	    bDC = CreateCompatibleDC(__rootDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14215
	    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
 14216
	    height =  __intVal(h);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14217
	    width  =  __intVal(w);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14218
	    DPRINTF(("width %d height %d\n",width,height));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14219
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14220
	    hBitmap = CreateCompatibleBitmap(xDC,width,height);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14221
	    if (!hBitmap)
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14222
		goto fail;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14223
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14224
	    SelectObject(bDC,hBitmap);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14225
	    if (BitBlt(bDC,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14226
		   0,0,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14227
		   width,height,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14228
		   xDC,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14229
		   __intVal(srcX), __intVal(srcY),
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14230
		   SRCCOPY)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14231
		 == 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14232
		)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14233
	    {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14234
		 DPRINTF(("ERROR in primGetBitsFromPixmap: BitBlt\n"));
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14235
		 goto fail;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14236
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14237
	    bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14238
	    bitmap.bmiHeader.biPlanes = 1;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14239
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14240
	    bitmap.bmiHeader.biCompression = BI_RGB;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14241
#else
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14242
	    if (__depth == 24) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14243
		/*bitmap.bmiHeader.biCompression = BI_BITFIELDS;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14244
		bitmap.r = 0xff0000;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14245
		bitmap.g = 0x00ff00;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14246
		bitmap.b = 0x0000ff;*/
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14247
		bitmap.bmiHeader.biCompression = BI_RGB;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14248
	    } else if (__depth == 16) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14249
		/*bitmap.bmiHeader.biCompression = BI_RGB;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14250
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14251
		bitmap.b = 0x001f;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14252
		bitmap.g = 0x07e0;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14253
		bitmap.r = 0xf800;*/
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14254
		bitmap.bmiHeader.biCompression = BI_RGB;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14255
	    } else {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14256
		DPRINTF(("primGetBitsFromPixmap: unsupported depth\n"));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14257
		got fail;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14258
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14259
#endif /* ALWAYSTRUECOLOR */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14260
	    bitmap.bmiHeader.biSizeImage = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14261
	    bitmap.bmiHeader.biXPelsPerMeter = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14262
	    bitmap.bmiHeader.biYPelsPerMeter = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14263
	    bitmap.bmiHeader.biClrUsed = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14264
	    bitmap.bmiHeader.biClrImportant = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14265
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14266
	    bitmap.bmiHeader.biWidth = width;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14267
	    bitmap.bmiHeader.biHeight = -height;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14268
	    bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14269
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14270
	    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
 14271
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14272
		DPRINTF(("noinfo returned\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14273
		goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14274
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14275
	    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
 14276
	    numBytes = bitmap.bmiHeader.biSizeImage;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14277
	    if ( numBytes != 0 ) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14278
		if (numBytes > __byteArraySize(imageBits)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14279
		    /* imageBits too small */
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14280
		    DPRINTF(("provided byteArray too small\n"));
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14281
		    goto fail;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14282
		}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14283
		DPRINTF(("numBytes %d\n",numBytes));
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14284
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14285
		bitmap.bmiHeader.biHeight = -height;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14286
		bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel; /*__depth;*/
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14287
		bitmap.rgb[0] = 0;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14288
		bitmap.rgb[1] = 0xffffff;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14289
		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
 14290
		{
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14291
		    DPRINTF(("zero bits returned\n"));
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14292
		    goto fail;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14293
		}
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14294
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14295
#if 0
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14296
		{
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14297
		    /* swap red and blue (windows delivers BGR) */
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14298
		    char *cp = __ByteArrayInstPtr(imageBits)->ba_element;
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14299
		    int n = numBytes;
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14300
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14301
		    for ( ;n > 0; n -= 3, cp += 3) {
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14302
			  char b = cp[0];
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14303
			  cp[0] = cp[2];
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14304
			  cp[2] = b;
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14305
		    }
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14306
		}
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14307
#endif
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14308
	    } else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14309
		DPRINTF(("unacceptable bitmap\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14310
		goto fail;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14311
	    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14312
	} else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14313
	    DPRINTF(("unacceptable bitmap\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14314
	    goto fail;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14315
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14316
	__ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14317
	__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(1);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14318
	__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
 14319
	__ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14320
	__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
 14321
	__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14322
	__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(WIN32PADDING);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14323
	__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(bitmap.bmiHeader.biBitCount);
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14324
	// attention: red and green are swapped
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14325
	__ArrayInstPtr(info)->a_element[8] = __MKSMALLINT(0x00FF00);   // redMask
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14326
	__ArrayInstPtr(info)->a_element[9] = __MKSMALLINT(0x0000FF);   // greenMask
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 14327
	__ArrayInstPtr(info)->a_element[10] = __MKSMALLINT(0xFF0000);  // blueMask
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14328
	if (bDC)
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14329
	    DeleteDC(bDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14330
	if (xDC)
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 14331
	    ReleaseDC(0, xDC); //DeleteDC(xDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14332
	if (hBitmap)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 14333
	    _DeleteObject(hBitmap, __LINE__);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14334
	RETURN ( true );
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14335
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14336
fail:
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14337
    if (bDC)
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14338
	DeleteDC(bDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14339
    if (xDC)
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 14340
	ReleaseDC(0, xDC); //DeleteDC(xDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14341
    if (hBitmap)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 14342
	_DeleteObject(hBitmap, __LINE__);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14343
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14344
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14345
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14346
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14347
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14348
!WinWorkstation methodsFor:'selections'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14349
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14350
getClipboardData
2797
e92e09d1c816 clipboard stuff
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
 14351
    "caveat: for now, only Text is supported"
e92e09d1c816 clipboard stuff
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
 14352
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14353
%{
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14354
    HANDLE hClip;
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14355
    HANDLE hData;
3499
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14356
    OBJ s;
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14357
    unsigned char *src, *p;
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14358
    WIDECHAR *w_src, *w_p;
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14359
3502
250667f59792 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3501
diff changeset
 14360
    /* Unicode */
3499
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14361
    if (IsClipboardFormatAvailable(CF_UNICODETEXT)) {
3521
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14362
	int nRemain, len, realLen;
3499
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14363
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14364
	hClip = OpenClipboard(NULL);
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14365
	if (hClip) {
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14366
	    int needUnicode = 0;
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14367
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14368
	    hData = GetClipboardData(CF_UNICODETEXT);
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14369
	    w_src = GlobalLock(hData);
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14370
	    len = w_src ? wcslen(w_src) : 0;
3502
250667f59792 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3501
diff changeset
 14371
	    /* 
250667f59792 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3501
diff changeset
 14372
	     * see how much we really need (when CRLF is replaced by LF)
3499
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14373
	     * and if result is really Unicode ...
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14374
	     */
4015
0ebf5ad92a72 bugfix in getClipboardData; allocation of string (too much space)
ca
parents: 4014
diff changeset
 14375
	    for (realLen=nRemain=len, w_p=w_src; nRemain; ) {
3499
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14376
		WIDECHAR w_ch;
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14377
4015
0ebf5ad92a72 bugfix in getClipboardData; allocation of string (too much space)
ca
parents: 4014
diff changeset
 14378
		w_ch = *w_p++; nRemain--;
3499
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14379
		if ((unsigned) w_ch > 0xFF) {
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14380
		    needUnicode = 1;
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14381
		}
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14382
		if (w_ch == 0x0D) {
3503
572f841dce6f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
 14383
		    if (nRemain && (*w_p == 0x0A)) {
4015
0ebf5ad92a72 bugfix in getClipboardData; allocation of string (too much space)
ca
parents: 4014
diff changeset
 14384
			w_p++; nRemain--;realLen--;
3503
572f841dce6f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
 14385
		    }
572f841dce6f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
 14386
		}
572f841dce6f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
 14387
	    }
3499
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14388
	    if (! needUnicode) {
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14389
		s = __MKEMPTYSTRING(realLen);
3503
572f841dce6f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
 14390
		if (s != nil) {
3521
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14391
		    for (p = __stringVal(s); len; ) {
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14392
			unsigned char ch;
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14393
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14394
			*p = ch = *w_src++;
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14395
			len--;
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14396
			if (len && (ch == 0x0D) && (*w_src == 0x0A)) {
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14397
			    *p = 0x0A;
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14398
			    w_src++;
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14399
			    len--;
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14400
			}
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14401
			p++;
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14402
		    }
3503
572f841dce6f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
 14403
		}
3499
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14404
	    } else {
3521
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14405
		s = __BYTEARRAY_NEW_INT(realLen * 2);
3503
572f841dce6f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
 14406
		if (s != nil) {
3521
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14407
		    __qClass(s) = @global(UnicodeString);
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14408
		    for (w_p = (WIDECHAR *)__stringVal(s); len; ) {
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14409
			WIDECHAR w_ch;
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14410
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14411
			*w_p = w_ch = *w_src++;
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14412
			len--;
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14413
			if (len && (w_ch == 0x0D) && (*w_src == 0x0A)) {
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14414
			    *w_p = 0x0A;
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14415
			    w_src++;
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14416
			    len--;
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14417
			}
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14418
			w_p++;
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14419
		    }
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14420
		}
3499
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14421
	    }
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14422
	    GlobalUnlock(hData);
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14423
	    CloseClipboard();
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14424
	    RETURN(s);
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14425
	}
619ebebcb0cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
 14426
    }
2794
93debab2f79f clipboard
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
 14427
93debab2f79f clipboard
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
 14428
    /* check for format CF_TEXT */
93debab2f79f clipboard
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
 14429
    if (IsClipboardFormatAvailable(CF_TEXT)) {
3521
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14430
	int nRemain, len, realLen;
3496
bc0065e67f3f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
 14431
2817
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14432
	hClip = OpenClipboard(NULL);
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14433
	if (hClip) {
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14434
	    hData = GetClipboardData(CF_TEXT);
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14435
	    src = GlobalLock(hData);
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14436
	    len = src ? strlen(src) : 0;
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14437
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14438
	    /* see how much we really need (when CRLF is replaced by LF) */
4015
0ebf5ad92a72 bugfix in getClipboardData; allocation of string (too much space)
ca
parents: 4014
diff changeset
 14439
	    for (realLen=nRemain=len, p=src; nRemain; ) {
2817
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14440
		unsigned char ch;
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14441
4015
0ebf5ad92a72 bugfix in getClipboardData; allocation of string (too much space)
ca
parents: 4014
diff changeset
 14442
		ch = *p++; nRemain--;
2817
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14443
		if (ch == 0x0D) {
3504
b53fe2fa6370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3503
diff changeset
 14444
		    if (nRemain && (*p == 0x0A)) {
4015
0ebf5ad92a72 bugfix in getClipboardData; allocation of string (too much space)
ca
parents: 4014
diff changeset
 14445
			p++; nRemain--;realLen--;
2817
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14446
		    }
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14447
		}
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14448
	    }
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14449
	    s = __MKEMPTYSTRING(realLen);
3503
572f841dce6f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
 14450
	    if (s != nil) {
3521
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14451
		for (p=__stringVal(s); len; ) {
3503
572f841dce6f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
 14452
		    unsigned char ch;
572f841dce6f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
 14453
572f841dce6f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
 14454
		    *p = ch = *src++;
2817
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14455
		    len--;
3503
572f841dce6f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
 14456
		    if (len && (ch == 0x0D) && (*src == 0x0A)) {
3521
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14457
			*p = 0x0A;
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14458
			src++;
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14459
			len--;
3503
572f841dce6f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
 14460
		    }
572f841dce6f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
 14461
		    p++;
572f841dce6f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
 14462
		}
2817
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14463
	    }
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14464
	    GlobalUnlock(hData);
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14465
	    CloseClipboard();
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14466
	    DDPRINTF((stderr, "WinWorkstation [info]: clipBoard data is <%s>\n", (char *)hData));
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14467
	    RETURN(s);
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14468
	}
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14469
    }
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14470
    RETURN(nil);
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14471
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14472
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14473
2797
e92e09d1c816 clipboard stuff
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
 14474
getCopyBuffer
e92e09d1c816 clipboard stuff
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
 14475
    "return the copyBuffers contents."
e92e09d1c816 clipboard stuff
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
 14476
e92e09d1c816 clipboard stuff
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
 14477
    |clip|
e92e09d1c816 clipboard stuff
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
 14478
3161
c32b47f8eedd textSelection fixes (added newLine);
Claus Gittinger <cg@exept.de>
parents: 3158
diff changeset
 14479
    ClipBoardObject notNil ifTrue:[
3416
d956e2fdbfad method defined in super
Stefan Vogel <sv@exept.de>
parents: 3261
diff changeset
 14480
	^ ClipBoardObject
3161
c32b47f8eedd textSelection fixes (added newLine);
Claus Gittinger <cg@exept.de>
parents: 3158
diff changeset
 14481
    ].
c32b47f8eedd textSelection fixes (added newLine);
Claus Gittinger <cg@exept.de>
parents: 3158
diff changeset
 14482
2800
e3c63c4b511d line-selections fixed
Claus Gittinger <cg@exept.de>
parents: 2798
diff changeset
 14483
    (clip := (self getSelectionFor:nil)) notNil ifTrue:[
3416
d956e2fdbfad method defined in super
Stefan Vogel <sv@exept.de>
parents: 3261
diff changeset
 14484
	^ clip
2797
e92e09d1c816 clipboard stuff
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
 14485
    ].
e92e09d1c816 clipboard stuff
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
 14486
    ^ copyBuffer
e92e09d1c816 clipboard stuff
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
 14487
e92e09d1c816 clipboard stuff
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
 14488
    "Created: / 13.7.1999 / 13:15:35 / cg"
3161
c32b47f8eedd textSelection fixes (added newLine);
Claus Gittinger <cg@exept.de>
parents: 3158
diff changeset
 14489
    "Modified: / 30.1.2000 / 12:01:13 / cg"
2797
e92e09d1c816 clipboard stuff
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
 14490
!
e92e09d1c816 clipboard stuff
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
 14491
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14492
getSelectionFor:drawableId
4015
0ebf5ad92a72 bugfix in getClipboardData; allocation of string (too much space)
ca
parents: 4014
diff changeset
 14493
    |s|
2800
e3c63c4b511d line-selections fixed
Claus Gittinger <cg@exept.de>
parents: 2798
diff changeset
 14494
e3c63c4b511d line-selections fixed
Claus Gittinger <cg@exept.de>
parents: 2798
diff changeset
 14495
    s := self getClipboardData.
e3c63c4b511d line-selections fixed
Claus Gittinger <cg@exept.de>
parents: 2798
diff changeset
 14496
    ^ s
e3c63c4b511d line-selections fixed
Claus Gittinger <cg@exept.de>
parents: 2798
diff changeset
 14497
3161
c32b47f8eedd textSelection fixes (added newLine);
Claus Gittinger <cg@exept.de>
parents: 3158
diff changeset
 14498
    "Modified: / 30.1.2000 / 02:26:47 / cg"
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14499
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14500
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 14501
setClipboardData:aString  
2797
e92e09d1c816 clipboard stuff
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
 14502
    "caveat: for now, only Text is supported"
e92e09d1c816 clipboard stuff
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
 14503
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 14504
%{
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 14505
    HANDLE hClip;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 14506
    HANDLE hData;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 14507
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 14508
    if (__isString(aString)) {
3521
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14509
	char *s, *p, *src, *dst;
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14510
	int n, len, realLen;
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14511
2817
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14512
	hClip = OpenClipboard(NULL);
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14513
	if (hClip) {
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14514
	    s = __stringVal(aString);
2817
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14515
	    /* must replace CR by CRLF */
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14516
	    len = realLen = __stringSize(aString);
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14517
	    for (src=s, n=len; n; n--) {
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14518
		if ((src[0] == 0x0A) && ((src == s) || (src[-1] != 0x0D))) {
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14519
		    realLen++;
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14520
		}
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14521
		src++;
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14522
	    }
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14523
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14524
	    hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, realLen+1);
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14525
	    if (hData) {
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14526
		char *t = GlobalLock(hData);
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14527
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14528
		if (t) {
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14529
		    for (src=s, dst=t, n=len; n;) {
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14530
			unsigned char ch;
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14531
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14532
			ch = src[0]; n--;
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14533
			if ((ch == 0x0A) && ((src == s) || (src[-1] != 0x0D))) {
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14534
			    *dst++ = 0x0D;
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14535
			    *dst++ = 0x0A;
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14536
			} else {
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14537
			    *dst++ = ch;
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14538
			}
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14539
			src++;
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14540
		    }
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14541
		    *dst = 0;
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14542
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14543
		    EmptyClipboard();
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14544
		    if (SetClipboardData(CF_TEXT, hData) != 0) {
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14545
			/* Note: After setting clipboard data, 
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14546
			 * the memory block previously allocated belongs to
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14547
			 * the clipboard - not to the app. 
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14548
			 */
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14549
			CloseClipboard();
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14550
			RETURN (true);
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14551
		    }
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14552
		    DPRINTF(("SetClipboardData error:%d\n", GetLastError()));
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14553
		    GlobalUnlock(hData);
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14554
		}
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14555
	    }
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14556
	    CloseClipboard();
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14557
	}
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 14558
	RETURN(false);
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 14559
    }
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14560
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14561
    /* Unicode */
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14562
    if (__isWords(aString)) {
3521
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14563
	WIDECHAR *w_s, *w_p, *w_src, *w_dst;
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 14564
	int n, len, realLen;
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14565
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14566
	hClip = OpenClipboard(NULL);
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14567
	if (hClip) {
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14568
	    OBJ cls;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14569
	    int nInstBytes;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14570
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14571
	    cls = __qClass(aString);
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14572
	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14573
	    w_s = (WIDECHAR *)(__stringVal(aString) + nInstBytes);
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14574
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14575
	    /* must replace CR by CRLF */
3495
6b755cf873f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3494
diff changeset
 14576
	    len = realLen = (__byteArraySize(aString) - nInstBytes) / 2;
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14577
	    for (w_src=w_s, n=len; n; n--) {
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14578
		if ((w_src[0] == 0x0A) && ((w_src == w_s) || (w_src[-1] != 0x0D))) {
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14579
		    realLen++;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14580
		}
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14581
		w_src++;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14582
	    }
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14583
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14584
	    hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, (realLen+1)*sizeof(WIDECHAR));
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14585
	    if (hData) {
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14586
		char *t = GlobalLock(hData);
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14587
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14588
		if (t) {
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14589
		    for (w_src=w_s, w_dst=t, n=len; n;) {
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14590
			WIDECHAR w_ch;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14591
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14592
			w_ch = w_src[0]; n--;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14593
			if ((w_ch == 0x0A) && ((w_src == w_s) || (w_src[-1] != 0x0D))) {
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14594
			    *w_dst++ = 0x0D;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14595
			    *w_dst++ = 0x0A;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14596
			} else {
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14597
			    *w_dst++ = w_ch;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14598
			}
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14599
			w_src++;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14600
		    }
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14601
		    *w_dst = 0;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14602
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14603
		    EmptyClipboard();
3497
2d43fa327c07 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
 14604
		    if (SetClipboardData(CF_UNICODETEXT, hData) != 0) {
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14605
			/* Note: After setting clipboard data, 
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14606
			 * the memory block previously allocated belongs to
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14607
			 * the clipboard - not to the app. 
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14608
			 */
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14609
			CloseClipboard();
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14610
			RETURN (true);
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14611
		    }
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14612
		    DPRINTF(("SetClipboardData error:%d\n", GetLastError()));
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14613
		    GlobalUnlock(hData);
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14614
		}
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14615
	    }
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14616
	    CloseClipboard();
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14617
	}
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14618
	RETURN(false);
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14619
    }
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 14620
%}.
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 14621
    self primitiveFailed.
2797
e92e09d1c816 clipboard stuff
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
 14622
!
e92e09d1c816 clipboard stuff
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
 14623
e92e09d1c816 clipboard stuff
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
 14624
setSelection:something owner:drawableId
3158
fbf44226ce80 dont wine with non-text selections
Claus Gittinger <cg@exept.de>
parents: 3126
diff changeset
 14625
    something isString ifTrue:[
3416
d956e2fdbfad method defined in super
Stefan Vogel <sv@exept.de>
parents: 3261
diff changeset
 14626
	ClipBoardObject := nil.
d956e2fdbfad method defined in super
Stefan Vogel <sv@exept.de>
parents: 3261
diff changeset
 14627
	^ self setClipboardData:something
3161
c32b47f8eedd textSelection fixes (added newLine);
Claus Gittinger <cg@exept.de>
parents: 3158
diff changeset
 14628
    ] ifFalse:[
3416
d956e2fdbfad method defined in super
Stefan Vogel <sv@exept.de>
parents: 3261
diff changeset
 14629
	ClipBoardObject := something.
3158
fbf44226ce80 dont wine with non-text selections
Claus Gittinger <cg@exept.de>
parents: 3126
diff changeset
 14630
    ]
2797
e92e09d1c816 clipboard stuff
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
 14631
e92e09d1c816 clipboard stuff
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
 14632
    "Created: / 13.7.1999 / 13:30:37 / cg"
3161
c32b47f8eedd textSelection fixes (added newLine);
Claus Gittinger <cg@exept.de>
parents: 3158
diff changeset
 14633
    "Modified: / 30.1.2000 / 11:59:41 / cg"
2798
c800a5103a6c clipBoard
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
 14634
!
c800a5103a6c clipBoard
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
 14635
c800a5103a6c clipBoard
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
 14636
setTextSelection:something owner:drawableId
3161
c32b47f8eedd textSelection fixes (added newLine);
Claus Gittinger <cg@exept.de>
parents: 3158
diff changeset
 14637
    ClipBoardObject := nil.
2798
c800a5103a6c clipBoard
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
 14638
    ^ self setClipboardData:something
c800a5103a6c clipBoard
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
 14639
c800a5103a6c clipBoard
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
 14640
    "Created: / 13.7.1999 / 13:36:43 / cg"
3161
c32b47f8eedd textSelection fixes (added newLine);
Claus Gittinger <cg@exept.de>
parents: 3158
diff changeset
 14641
    "Modified: / 30.1.2000 / 12:12:57 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14642
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14643
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14644
!WinWorkstation methodsFor:'style defaults'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14645
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14646
defaultStyleValueFor:aKey
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14647
    "return a default style value, given a key.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14648
     These defaults are used if nothing is specified
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14649
     in the style sheet
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14650
     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
 14651
     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
 14652
     where the systemDefaults are used ..."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14653
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14654
    |clr|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14655
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14656
"/    aKey == #shadowColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14657
"/        ^ Color black
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14658
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14659
"/    aKey == #lightColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14660
"/        ^ Color white
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14661
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14662
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14663
    aKey == #viewBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14664
	clr := self getSystemColor:#COLOR_WINDOW.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14665
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14666
    aKey == #textForegroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14667
	clr := self getSystemColor:#COLOR_WINDOWTEXT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14668
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14669
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14670
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14671
"/    aKey == #scrollerViewBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14672
"/        ^ Color white
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14673
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14674
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14675
"/    aKey == #textBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14676
"/        ^ Color white.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14677
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14678
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14679
    clr notNil ifTrue:[^ clr].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14680
    ^ super defaultStyleValueFor:aKey
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14681
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14682
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14683
!WinWorkstation methodsFor:'window stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14684
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 14685
activateWindow:aWindowId
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 14686
    "make a window active"
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 14687
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14688
%{  /* NOCONTEXT */
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 14689
    if (__isExternalAddress(aWindowId)) {
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 14690
	HWND win = _HWNDVal(aWindowId);
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 14691
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 14692
	if (win) {
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 14693
	    CPRINTF(("activateWindow %x\n",win));
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 14694
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 14695
#if 0
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 14696
/* does not help the low-licenceBox bug ... */
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 14697
	    SetWindowPos(win, HWND_TOP, 0, 0, 0, 0, 
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 14698
			 SWP_NOSENDCHANGING |
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 14699
			 SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 14700
#endif
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 14701
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14702
	    ShowWindowAsync(win, SW_SHOWNORMAL);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14703
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 14704
//            ShowWindow(win, SW_SHOW);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 14705
//            SetWindowPos(win, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW|/*SWP_NOACTIVATE|*/SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER);
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
 14706
//            enqEvent(0,win, WM_SHOWWINDOW, TRUE, 0, 0, 0, 0, EV_NOTIME);
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 14707
	}
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 14708
	RETURN ( self );
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 14709
    }
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 14710
%}
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 14711
!
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 14712
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14713
configureWindow:aWindowId sibling:siblingId stackMode:modeSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14714
    "configure stacking operation of aWindowId w.r.t siblingId"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14715
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14716
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14717
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14718
dropFilesWindow:aWindowId accept:doAccept
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14719
    "window accept Files from Shell"
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14720
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14721
%{  /*  */
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14722
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14723
    if (__isExternalAddress(aWindowId)) {
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14724
	HWND hWnd = _HWNDVal(aWindowId);
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14725
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14726
	if (hWnd) {
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14727
	    if (doAccept == true)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14728
	    DragAcceptFiles(hWnd, (doAccept == true) ? TRUE : FALSE);
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14729
	}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14730
	RETURN ( self );
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14731
    }
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14732
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14733
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 14734
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14735
getParentWindowIdOfWindowId:aChildWindowId
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14736
%{  /* NOCONTEXT */
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14737
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14738
    if (__isExternalAddress(aChildWindowId)) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14739
	HWND wChild = _HWNDVal(aChildWindowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14740
	HWND wParent;
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14741
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14742
	if (wChild) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14743
	    wParent = GetParent(wChild);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14744
	    if (wParent) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14745
		RETURN ( __MKEXTERNALADDRESS(wParent) );
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14746
	    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14747
	}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14748
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14749
%}.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14750
    ^ nil
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14751
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14752
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14753
     |top v|
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14754
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14755
     top := View new.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14756
     v := View in:top.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14757
     top realize.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14758
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14759
     self assert:(Display getParentWindowIdOfWindowId:(v id)) = top id.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14760
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14761
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14762
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14763
getThreadIdOfWindowId:windowId
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14764
%{  /* NOCONTEXT */
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14765
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14766
    if (__isExternalAddress(windowId)) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14767
	HWND hwnd = _HWNDVal(windowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14768
	DWORD id;
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14769
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14770
	if (hwnd) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14771
	    id = GetWindowThreadProcessId(hwnd, &id);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14772
	    RETURN ( __MKEXTERNALADDRESS(id) );
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14773
	}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14774
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14775
%}.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14776
    ^ nil
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14777
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14778
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14779
     |top|
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14780
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14781
     top := View new.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14782
     top realize.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14783
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14784
     self assert:(Display getThreadIdOfWindowId:(top id)) = OperatingSystem getProcessId.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14785
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14786
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14787
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14788
getWindowIdFromThreadId:id
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14789
    |l|
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14790
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14791
    l := OrderedCollection new.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14792
    self primEnumWindowsInto:l.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14793
    l do:[:eachWindowId |
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14794
	(self getParentWindowIdOfWindowId:eachWindowId) isNil ifTrue:[
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14795
	    "/ a topView
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14796
	    (self getThreadIdOfWindowId:eachWindowId) = id ifTrue:[
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14797
		^ eachWindowId
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14798
	    ].
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14799
	]
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14800
    ].
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14801
    ^ nil
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14802
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14803
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14804
     Display getWindowIdFromThreadId:(OperatingSystem getProcessId)
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14805
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14806
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 14807
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14808
lowerWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14809
    "bring a window to back"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14810
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14811
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14812
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14813
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14814
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14815
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14816
	if (win) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 14817
	    CPRINTF(("lowerWindow %x\n",win));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 14818
	    SetWindowPos(win, HWND_BOTTOM, 0, 0, 0, 0, 
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 14819
			 SWP_NOSENDCHANGING |
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 14820
			 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14821
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14822
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14823
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14824
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14825
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14826
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14827
mapView:aView id:aWindowId iconified:aBoolean atX:x y:y width:w height:h minExtent:minExt maxExtent:maxExt
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14828
    "make a window visible - either as icon or as a real view 
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14829
     in addition, allow change of extend, position, minExtend and maxExtent.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14830
     Needed for restart, to allow recreating a view as iconified,
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14831
     and to collaps/expand windows."
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14832
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14833
    |minW minH maxW maxH|
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14834
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14835
    minExt notNil ifTrue:[
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14836
	minW := minExt x.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14837
	minH := minExt y.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14838
    ].
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14839
    maxExt notNil ifTrue:[
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14840
	maxW := maxExt x.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14841
	maxH := maxExt y.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14842
    ].
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14843
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14844
%{ 
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14845
    if (__isExternalAddress(aWindowId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14846
	HWND win = _HWNDVal(aWindowId);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14847
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14848
	if (win) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14849
	    int bw;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14850
	    int flag = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14851
	    int __left, __top, __width, __height;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14852
	    int winStyleBits;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14853
	    int winExStyleBits;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14854
	    localWindowInfo *lI;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14855
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 14856
	    bw = GetWindow_bw(win);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14857
	    winStyleBits = GetWindowLong(win, GWL_STYLE);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14858
	    winExStyleBits = GetWindowLong(win, GWL_EXSTYLE);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14859
	    lI = GETLOCALWINDOWINFOPTR(win);
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14860
	    if (! lI) {
3126
5447d8c1d8d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3119
diff changeset
 14861
		fprintf(stderr, "WinWorkstation [info]: oops - no localInfo in mapView\n");
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14862
		RETURN (self);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14863
	    }
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14864
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14865
	    if (__bothSmallInteger(x, y)) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14866
		__left = __intVal(x) + bw;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14867
		__top = __intVal(y) + bw;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14868
	    } else {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14869
		__left = __top = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14870
		flag |= SWP_NOMOVE;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14871
	    }
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14872
	    if (__bothSmallInteger(w, h)) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14873
		__width = __intVal(w) - bw - bw;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14874
		__height = __intVal(h) - bw - bw;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14875
	    } else {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14876
		__width = __height = 100;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14877
		flag |= SWP_NOSIZE;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14878
	    }
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14879
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14880
	    if (__bothSmallInteger(minW, minH)) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14881
		RECT rec;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14882
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14883
		rec.left = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14884
		rec.top = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14885
		rec.right = __intVal(minW);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14886
		rec.bottom = __intVal(minH);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14887
#ifdef ADJUSTWINDOW
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14888
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14889
#endif
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14890
		lI->minWidth = rec.right - rec.left;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14891
		lI->minHeight = rec.bottom - rec.top;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14892
	    }
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14893
	    if (__bothSmallInteger(maxW, maxH)) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14894
		RECT rec;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14895
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14896
		rec.left = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14897
		rec.top = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14898
		rec.right = __intVal(maxW);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14899
		rec.bottom = __intVal(maxH);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14900
#ifdef ADJUSTWINDOW
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14901
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14902
#endif
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14903
		lI->maxWidth = rec.right - rec.left;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14904
		lI->maxHeight = rec.bottom - rec.top;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14905
	    }
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14906
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14907
#ifdef ADJUSTWINDOW
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14908
	    if (flag != (SWP_NOMOVE | SWP_NOSIZE)) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14909
		RECT rec;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14910
		int __left0, __top0, __width0, __height0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14911
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14912
		__left0   = __left;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14913
		__top0    = __top;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14914
		__width0  = __width;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14915
		__height0 = __height;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14916
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14917
		rec.left = __left;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14918
		rec.top = __top;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14919
		rec.right = __left + __width;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14920
		rec.bottom = __top + __height;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14921
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14922
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14923
		__left = rec.left;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14924
		__top = rec.top;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14925
		__width = rec.right - rec.left;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14926
		__height = rec.bottom - rec.top;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14927
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14928
		CPRINTF(("mapView %x %d/%d %d/%d -> %d/%d %d/%d\n",
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14929
			 win, 
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14930
			 __left0, __top0, __width0, __height0,
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14931
			 __left, __top, __width, __height));
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14932
	    }
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14933
#else
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14934
	    CPRINTF(("mapView %x %d/%d %d/%d\n",
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14935
		     win, 
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14936
		     __left, __top, __width, __height));
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14937
#endif                              
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14938
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14939
	    flag |= SWP_NOACTIVATE | SWP_NOSENDCHANGING | SWP_NOZORDER | SWP_NOOWNERZORDER;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14940
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14941
	    if (aBoolean == true) {
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14942
		/* iconified */
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14943
//              SetWindowPos(win, (HWND)0,
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14944
//                           __left, __top, __width, __height,
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14945
//                           flag);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14946
//                ShowWindow(win, SW_SHOWMINIMIZED);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14947
		ShowWindowAsync(win, SW_SHOWMINNOACTIVE);
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
 14948
/*
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
 14949
		enqEvent(0, win, WM_SHOWWINDOW, FALSE, 0, 0, 0, 0, EV_NOTIME);
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
 14950
*/
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14951
	    } else {
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14952
		/* normal */
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14953
		SetWindowPos(win, (HWND)0,
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14954
			     __left, __top, __width, __height,
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14955
			     flag);
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
 14956
/*
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
 14957
		enqEvent(0, win, WM_SHOWWINDOW, TRUE, 0, 0, 0, 0, EV_NOTIME);
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
 14958
*/
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 14959
		//ShowWindow(win, SW_RESTORE);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14960
		// ShowWindowAsync(win, SW_RESTORE);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14961
		ShowWindowAsync(win, SW_SHOWNOACTIVATE);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14962
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14963
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14964
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14965
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14966
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14967
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14968
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14969
mapWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14970
    "make a window visible"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14971
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14972
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14973
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14974
    if (__isExternalAddress(aWindowId)) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14975
	HWND hWnd = _HWNDVal(aWindowId);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14976
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14977
	if (hWnd) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14978
	    CPRINTF(("mapWindow %x\n", hWnd));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14979
	    if (GetParent(hWnd) == 0) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14980
		ShowWindowAsync(hWnd, SW_SHOWNOACTIVATE);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14981
	    } else {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14982
		ShowWindowAsync(hWnd, SW_SHOWNORMAL);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14983
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14984
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14985
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14986
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14987
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14988
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14989
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14990
moveResizeWindow:aWindowId x:x y:y width:w height:h
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14991
    "move and resize a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14992
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14993
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14994
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14995
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14996
     && __bothSmallInteger(x, y)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14997
     && __bothSmallInteger(w, h)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14998
	HWND win = _HWNDVal(aWindowId);
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 14999
	int bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15000
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15001
	if (win) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15002
	    bw = GetWindow_bw(win);
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15003
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15004
	    rec.left = __intVal(x) + bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15005
	    rec.top = __intVal(y) + bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15006
	    rec.right = rec.left + __intVal(w) - bw - bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15007
	    rec.bottom = rec.top + __intVal(h) - bw - bw;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
 15008
	    if (GetParent(win) == 0) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15009
#ifdef ADJUSTWINDOW
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
 15010
		AdjustWindowRectEx(&rec,GetWindowLong(win,GWL_STYLE),0,GetWindowLong(win,GWL_EXSTYLE));
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
 15011
#endif
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
 15012
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15013
	    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
 15014
			 rec.right - rec.left, rec.bottom - rec.top));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15015
	    SetWindowPos(win, (HWND)0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15016
			 rec.left, rec.top,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15017
			 rec.right - rec.left, rec.bottom - rec.top,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15018
			 SWP_NOSENDCHANGING | SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOOWNERZORDER);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15019
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15020
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15021
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15022
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15023
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15024
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15025
moveWindow:aWindowId x:x y:y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15026
    "move a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15027
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15028
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15029
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15030
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15031
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15032
     && __bothSmallInteger(x, y)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15033
	HWND win = _HWNDVal(aWindowId);
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15034
	int bw;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15035
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 15036
	if (win) {
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15037
	    bw = GetWindow_bw(win);
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15038
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15039
	    rec.left = __intVal(x) + bw;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15040
	    rec.top = __intVal(y) + bw;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
 15041
	    if (GetParent(win) == 0) {
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
 15042
		rec.right = rec.left + 10;  /* only needed to give adjust some valid numbers */
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
 15043
		rec.bottom = rec.top + 10;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15044
#ifdef ADJUSTWINDOW
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
 15045
		AdjustWindowRectEx(&rec, GetWindowLong(win,GWL_STYLE), 0, GetWindowLong(win,GWL_EXSTYLE));
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
 15046
#endif
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
 15047
	    }
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
 15048
	    CPRINTF(("move %x x:%d y:%d -> x:%d y:%d\n", win,
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
 15049
			__intVal(x), __intVal(y), rec.left, rec.top));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15050
	    SetWindowPos(win, (HWND)0,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15051
			 rec.left, rec.top,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15052
			 0, 0,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15053
			 SWP_NOSENDCHANGING | SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15054
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15055
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15056
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15057
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15058
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15059
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15060
primEnumChildWindowsOf:aWindowId into:handleList
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15061
%{  
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15062
    if (__isExternalAddress(aWindowId)) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15063
	HWND hwParent = _HWNDVal(aWindowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15064
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15065
	if ( EnumChildWindows( hwParent, EnumWindowsProc, (DWORD)&(handleList))) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15066
	    DPRINTF(("EnumChildWindows successful\n"));
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15067
	}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15068
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15069
%}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15070
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15071
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 15072
primEnumWindowsInto:handleList
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 15073
%{  
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 15074
    if ( EnumWindows( EnumWindowsProc, (DWORD)&(handleList))) {
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 15075
	DPRINTF(("EnumWindows successful\n"));
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 15076
    }
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 15077
%}
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 15078
!
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 15079
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15080
primEnumWindowsOf:threadId into:handleList
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15081
%{  
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15082
    if (__isSmallInteger(threadId)) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15083
	if ( EnumThreadWindows( __intVal(threadId), EnumWindowsProc, (DWORD)&(handleList))) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15084
	    DPRINTF(("EnumThreadWindows successful\n"));
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15085
	}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15086
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15087
%}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15088
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15089
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15090
primSetWindowIconId:wiconId maskId:wmaskId width:wiconWidth height:wiconHeight in:aWindowId
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 15091
%{  
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15092
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15093
    HBITMAP        xBitMap, maskBitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15094
    ICONINFO       iconInfo;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15095
    int            height, width;
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15096
    HICON          xIcon = (HICON)0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15097
    unsigned char  fastBits[10000];
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15098
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15099
    DPRINTF(("primSetWindowIconId\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15100
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15101
     && __isExternalAddress(wiconId)
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15102
     && __bothSmallInteger(wiconWidth, wiconHeight)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15103
	HWND win = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15104
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15105
	xBitMap = _HBITMAPVAL( wiconId );
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15106
	if ( xBitMap != 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15107
	    BITMAP bm;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15108
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15109
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15110
		BYTE *ep;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15111
		int privateMask = 0;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
 15112
		unsigned char  *allocatedBits = 0;
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15113
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15114
		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
 15115
		height = __intVal( wiconHeight );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15116
		width  = __intVal( wiconWidth  );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15117
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15118
		if ( __isExternalAddress(wmaskId) ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15119
		    maskBitmap = _HBITMAPVAL( wmaskId );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15120
		} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15121
		    if (wmaskId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15122
			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
 15123
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15124
		    maskBitmap = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15125
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15126
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15127
		/*
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15128
		 * if there is no mask, generate one
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15129
		 */
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15130
		if (maskBitmap == 0) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15131
		    int nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15132
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15133
		    nBytes = ( width + 31 ) / 8;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15134
		    nBytes = height * nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15135
		    if (nBytes < sizeof(fastBits)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15136
			ep = fastBits;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15137
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15138
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15139
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15140
		    if ( ep == 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15141
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15142
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15143
			memset(ep, 0, nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15144
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15145
			if ( maskBitmap == NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15146
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15147
			} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15148
			    privateMask = 1;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15149
			}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15150
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15151
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15152
		if ( maskBitmap != NULL ) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15153
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15154
		    iconInfo.fIcon = TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15155
		    iconInfo.hbmMask  =maskBitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15156
		    iconInfo.hbmColor = xBitMap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15157
		    xIcon = CreateIconIndirect( &iconInfo );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15158
		    DPRINTF(( "ICON CREATED!!!\n" ));
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15159
		    if (privateMask) {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 15160
			_DeleteObject( maskBitmap, __LINE__ );
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15161
		    } 
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15162
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15163
		    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
 15164
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15165
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15166
		if (allocatedBits) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15167
		    free(allocatedBits);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15168
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15169
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15170
	} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15171
	    DPRINTF(("WinWorkstat [warning]: xBitMap is zero \n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15172
	}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15173
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15174
	if (xIcon) {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 15175
#ifndef TOPWINDOWCLASS
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 15176
	    HICON oldIcon = (HICON)0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 15177
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 15178
	    oldIcon = (HICON) GetClassLong(win, GCL_HICON);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 15179
	    SetClassLong(win, GCL_HICON, (DWORD)xIcon);
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15180
/* It has to be checked whether this can be deleted!!!!! */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 15181
	    if ( oldIcon ) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 15182
		if (DestroyIcon( oldIcon )) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15183
		    DPRINTF(( "Old icon deleted\n" ));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 15184
		} else {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 15185
		    fprintf(stderr, "failed to delete old icon\n");
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 15186
		}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15187
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 15188
#else
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 15189
	    SendMessage(win, WM_SETICON,ICON_SMALL, (LPARAM)xIcon);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 15190
	    SendMessage(win, WM_SETICON,ICON_BIG, (LPARAM)xIcon);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 15191
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15192
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15193
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15194
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15195
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15196
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15197
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15198
raiseWindow:aWindowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15199
    "bring a window to front"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15200
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15201
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15202
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15203
    if (__isExternalAddress(aWindowId)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15204
	HWND hWnd = _HWNDVal(aWindowId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15205
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15206
	if (hWnd) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 15207
	    CPRINTF(("raiseWindow %x\n",hWnd));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15208
#if 1
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15209
	    SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, 
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15210
			 /* SWP_NOOWNERZORDER |*/ 
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15211
			 SWP_NOSENDCHANGING | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 15212
#else
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 15213
	    BringWindowToTop(hWnd);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 15214
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15215
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15216
	RETURN ( self );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15217
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15218
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15219
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15220
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15221
resizeWindow:aWindowId width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15222
    "resize a window"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15223
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15224
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15225
    RECT rec;
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15226
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15227
    if (__isExternalAddress(aWindowId)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15228
     && __bothSmallInteger(w, h)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15229
	HWND hWnd = _HWNDVal(aWindowId);
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 15230
	int bw;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15231
2593
1d2dad16f32c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2554
diff changeset
 15232
	if (hWnd) {
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 15233
	    bw = GetWindow_bw(hWnd);
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 15234
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 15235
	    rec.left = 0;  /* only needed to have a valid origin in adjust */
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 15236
	    rec.top = 0;   /* only needed to have a valid origin in adjust */
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 15237
	    rec.right = __intVal(w) - bw - bw;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 15238
	    rec.bottom = __intVal(h) - bw - bw;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15239
#ifdef ADJUSTWINDOW
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15240
	    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
 15241
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15242
	    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
 15243
	    SetWindowPos(hWnd, (HWND)0,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15244
			 0, 0,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15245
			 rec.right - rec.left, rec.bottom - rec.top,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15246
			 SWP_NOSENDCHANGING | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15247
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15248
	RETURN ( self );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15249
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15250
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15251
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15252
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15253
setBackingStore:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15254
    "turn on/off backing-store for a window"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 15255
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15256
    "/ 'WinWorkstation [info]: setBackingStore:in: not yet implemented' infoPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15257
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15258
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15259
setBitGravity:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15260
    "set bit gravity for a window"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 15261
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15262
    "/ 'WinWorkstation [info]: setBitGravity:in: not yet implemented' infoPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15263
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15264
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15265
setCursor:aCursorId in:aWindowId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15266
    "define a windows cursor
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15267
     Ignored here, since in windows, an application
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15268
     has to manage the cursor itself."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15269
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15270
%{  /* NOCONTEXT */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 15271
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 15272
    HCURSOR newCursor;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 15273
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 15274
    if (ISCONNECTED
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 15275
     && __isExternalAddress(aWindowId)
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 15276
     && __isExternalAddress(aCursorId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15277
	HWND win = _HWNDVal(aWindowId);
3951
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
 15278
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15279
	SetWindow_Cursor(win, _HCURSORVal(aCursorId));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15280
3951
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
 15281
	if( ! __isWinNT_NEW_BEHAVIOUR )
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
 15282
	{
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
 15283
	    /*
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
 15284
	     * test whether the pointer is currently in that window ...
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
 15285
	     */
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
 15286
	    POINT p;
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
 15287
	    GetCursorPos(&p);
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
 15288
	    if (WindowFromPoint(p) != win) {
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
 15289
		RETURN ( self );
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
 15290
	    }
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
 15291
	}
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 15292
	SetWindow_Cursor(win, _HCURSORVal(aCursorId));
3951
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
 15293
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15294
#ifdef SET_CURSOR_IN_WINTHREAD
3951
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
 15295
	PostMessage(win, WM_THREAD_SETCURSOR, 0, (INT)_HCURSORVal(aCursorId));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15296
#else
3951
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
 15297
	SetCursor(_HCURSORVal(aCursorId));
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
 15298
#endif
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
 15299
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 15300
	RETURN ( self );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 15301
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15302
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15303
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15304
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15305
setIconName:aString in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15306
    "define a windows iconname"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15307
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15308
%{  /* NOCONTEXT */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 15309
#if 0
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 15310
    if (__isExternalAddress(aWindowId)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 15311
     && (__isString(aString) || __isSymbol(aString))) {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 15312
	HWND win = _HWNDVal(aWindowId);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 15313
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 15314
	SetWindowText(win, __stringVal(aString));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 15315
	RETURN (self);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 15316
    }
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 15317
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15318
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15319
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15320
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15321
setParentWindowIdOf:aChildWindowId to:newParentWindowId
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15322
%{  /* NOCONTEXT */
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15323
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15324
    if (__isExternalAddress(aChildWindowId)
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15325
     && __isExternalAddress(newParentWindowId)) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15326
	HWND wChild = _HWNDVal(aChildWindowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15327
	HWND wNewParent = _HWNDVal(newParentWindowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15328
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15329
	if (wChild && wNewParent) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15330
	    SetParent(wChild, wNewParent);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15331
	}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15332
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15333
%}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15334
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 15335
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15336
setSaveUnder:yesOrNo in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15337
    "turn on/off save-under for a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15338
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15339
%{  /* NOCONTEXT */
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15340
    if (yesOrNo != false) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15341
	DPRINTF(("WinWorkstation [info]: setSaveUnder:in: not (yet) implemented\n"));
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15342
    }
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15343
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15344
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15345
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15346
setTransient:aWindowId for:aMainWindowId
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 15347
    "set aWindowId to be a transient of aMainWindow.
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 15348
     This will make the transient window to be iconified/deiconified
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 15349
     together with the mainWindow.
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 15350
     Typically, this is set for modal dialogs."
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 15351
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 15352
%{  /* NOCONTEXT */
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 15353
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 15354
#ifdef NOT_YET_SUPPORTED
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 15355
    if (__isExternalAddress(aWindowId)) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 15356
	HWND w;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 15357
	HWND cw = _HWNDVal(aWindowId);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 15358
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 15359
	if ((aMainWindowId == nil) || (aMainWindowId == __MKSMALLINT(0))) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 15360
	    w = (HWND) 0;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 15361
	} else {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 15362
	    if (__isExternalAddress(aMainWindowId)) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 15363
		w = _HWNDVal(aMainWindowId);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 15364
	    } else {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 15365
		goto getOutOfHere;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 15366
	    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 15367
	}
2417
1e40a40e56e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2416
diff changeset
 15368
	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
 15369
	//SetParent(cw, w);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 15370
	RETURN ( self );
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 15371
    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 15372
 getOutOfHere: ;
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 15373
#else
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 15374
    RETURN (self);
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 15375
#endif
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 15376
%}.
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 15377
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15378
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15379
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15380
setWindowBackground:aColorIndex in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15381
    "set the windows background color. This is the color with which
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15382
     the view is filled whenever exposed. Do not confuse this with
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15383
     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
 15384
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15385
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15386
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15387
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15388
     && (__isSmallInteger(aColorIndex))) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15389
	HWND hWnd = _HWNDVal(aWindowId);
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
 15390
	int clr;
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15391
	HBRUSH oldBrush;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15392
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15393
	if (oldBrush = GetWindow_viewBgBrush(hWnd)) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15394
	    SetWindow_viewBgBrush(hWnd, 0);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 15395
	    _DeleteBrushIfNotInCache(oldBrush, __LINE__);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15396
	}
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
 15397
	clr = st2RGB(__intVal(aColorIndex), 0);
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
 15398
	SetWindow_viewBgColor(hWnd, clr);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15399
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15400
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15401
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15402
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15403
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15404
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15405
setWindowBackgroundPixmap:aPixmapId in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15406
    "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
 15407
     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
 15408
     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
 15409
     with opaque drawing.
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15410
     NOTICE: due to the limitations of WIN95, 
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15411
	     background pixmaps which are not 8x8 pixels in size, 
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15412
	     are handled by smalltalk code in the WIN95 version."
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15413
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15414
%{  
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15415
    if (__isExternalAddress(aWindowId)) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15416
	HWND hWnd = _HWNDVal(aWindowId);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15417
	HBITMAP pixmap;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15418
	HBRUSH oldBrush, newBrush;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15419
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15420
	if (__isExternalAddress(aPixmapId))
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15421
	    pixmap = _HBITMAPVAL(aPixmapId);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15422
	else
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15423
	    pixmap = 0;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15424
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15425
	if (oldBrush = GetWindow_viewBgBrush(hWnd)) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15426
	    SetWindow_viewBgBrush(hWnd, 0);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 15427
	    _DeleteBrushIfNotInCache(oldBrush, __LINE__);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15428
	}
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15429
	if (pixmap) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15430
	    newBrush = CreatePatternBrush(pixmap);
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 15431
	    SetWindow_viewBgBrush(hWnd, newBrush);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15432
/*
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15433
 *            SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);       
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15434
 */
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15435
	}
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15436
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15437
	RETURN (self);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 15438
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 15439
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15440
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15441
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15442
setWindowBorderColor:aColorIndex in:aWindowId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 15443
    "set the windows border color.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 15444
     NOTICE: borders are not supported by the win32 version."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15445
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 15446
%{  /* NOCONTEXT */
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15447
    DPRINTF(("WinWorkstation [info]: setWindowBorderColor:in: not (yet) implemented\n"));
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15448
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15449
    if (__isExternalAddress(aWindowId)
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15450
     && __isSmallInteger(aColorIndex)) {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15451
	HWND win = _HWNDVal(aWindowId);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15452
	int clr;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15453
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15454
	if (GetParent(win) != 0) {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15455
	    clr = st2RGB(__intVal(aColorIndex), 0);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15456
	    SetWindow_bdColor(win, clr);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15457
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15458
	    {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15459
		/*
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15460
		 * force a redraw - even if we do not support
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15461
		 * border colors ... (see UIPainter code)
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15462
		 */
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15463
		RECT rect;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15464
		HRGN rgn;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15465
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15466
		GetWindowRect(win, &rect);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15467
		rgn = CreateRectRgn(rect.left, rect.top, rect.right, rect.bottom);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15468
		DefWindowProc(win, WM_NCPAINT, (WPARAM)rgn, 0);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15469
		_DeleteObject(rgn, __LINE__);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15470
	    }
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15471
	}
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15472
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 15473
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15474
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15475
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15476
setWindowBorderPixmap:aPixmapId in:aWindowId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 15477
    "set the windows border pattern.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 15478
     NOTICE: border pixmaps are not supported by the win32 version."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15479
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 15480
%{  /* NOCONTEXT */
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15481
    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
 15482
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15483
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15484
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15485
setWindowBorderWidth:aNumber in:aWindowId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 15486
    "set the windows border width.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 15487
     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
 15488
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 15489
%{  /* NOCONTEXT */
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15490
    int bw = (aNumber == __MKSMALLINT(0)) ? 0 : 1;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15491
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15492
    if (__isExternalAddress(aWindowId)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15493
	HWND win = _HWNDVal(aWindowId);
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15494
	int gwl;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15495
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15496
	gwl = GetWindowLong(win, GWL_STYLE);
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 15497
	if (gwl & WS_CHILD) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 15498
	    SetWindow_bw(win, bw);
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 15499
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 15500
	    if (bw) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 15501
		gwl |= WS_BORDER;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 15502
	    } else {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 15503
		gwl &= ~WS_BORDER;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 15504
	    }
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 15505
	    SetWindowLong(win, GWL_STYLE, gwl);
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15506
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15507
	    /*
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15508
	     * force a redraw - even if we do not support
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15509
	     * border colors ... (see UIPainter code)
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15510
	     */
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 15511
#if 0
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15512
	    PostMessage(win, WM_NCPAINT, 0, 0);
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 15513
#endif
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15514
	    {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15515
		RECT rect;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15516
		HRGN rgn;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15517
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15518
		GetWindowRect(win, &rect);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15519
		rgn = CreateRectRgn(rect.left, rect.top, rect.right, rect.bottom);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15520
		DefWindowProc(win, WM_NCPAINT, (WPARAM)rgn, 0);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15521
		_DeleteObject(rgn, __LINE__);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15522
	    }
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 15523
	}
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 15524
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 15525
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15526
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15527
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15528
setWindowClass:wClass name:wName in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15529
    "define class and name of a window.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15530
     This may be used by the window manager to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15531
     select client specific resources."
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 15532
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15533
%{  /* NOCONTEXT */
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15534
    DPRINTF(("WinWorkstation [info]: setWindowClass:name:in: not (yet) implemented\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15535
%}.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15536
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15537
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15538
setWindowGravity:how in:aWindowId
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15539
    "set the window gravity - this makes the view to move
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15540
     automatically and can avoid redraws (if used properly)"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15541
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 15542
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15543
    int gr = GRAVITY_NONE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15544
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15545
    if (__isExternalAddress(aWindowId)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15546
	HWND hWnd = _HWNDVal(aWindowId);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15547
	localWindowInfo *lI;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15548
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15549
	if (how == @symbol(South)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15550
	    gr = GRAVITY_S;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15551
	} else if (how == @symbol(SouthWest)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15552
	    gr = GRAVITY_SW;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15553
	} else if (how == @symbol(SouthEast)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15554
	    gr = GRAVITY_SE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15555
	} else if (how == @symbol(North)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15556
	    gr = GRAVITY_N;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15557
	} else if (how == @symbol(NorthWest)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15558
	    gr = GRAVITY_NW;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15559
	} else if (how == @symbol(NorthEast)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15560
	    gr = GRAVITY_NE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15561
	} else if (how == @symbol(East)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15562
	    gr = GRAVITY_E;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15563
	} else if (how == @symbol(West)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15564
	    gr = GRAVITY_W;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15565
	}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15566
	if (lI = GETLOCALWINDOWINFOPTR(hWnd)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15567
	    lI->viewGravity = gr;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15568
	}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15569
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 15570
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15571
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15572
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15573
setWindowIcon:aForm mask:aMaskForm in:aWindowId
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15574
    "set a windows icon & iconMask"
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15575
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15576
    |wiconId wmaskId wiconHeight wiconWidth|
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 15577
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 15578
    aForm notNil ifTrue:[
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 15579
	wiconId := aForm id.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 15580
	wiconHeight := aForm height.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 15581
	wiconWidth  := aForm width.
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15582
	aMaskForm notNil ifTrue:[
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15583
	    wmaskId := aMaskForm id
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15584
	].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15585
	self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15586
	    primSetWindowIconId:wiconId
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 15587
	    maskId:wmaskId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15588
	    width:wiconWidth
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15589
	    height:wiconHeight
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15590
	    in:aWindowId
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 15591
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15592
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15593
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15594
setWindowIconWindow:aView in:aWindowId
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15595
    "define a window to be used as icon.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15596
     This is not supported with Windows (is it possible at all ?)."
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15597
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15598
    'WinWorkstation [info]: setWindowIconWindow:in: not implemented' infoPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15599
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15600
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15601
setWindowMinExtent:minExt maxExtent:maxExt in:aWindowId
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15602
    "set a windows minimum & max extents.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15603
     nil arguments are ignored."
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15604
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15605
    |minW minH maxW maxH|
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15606
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15607
    minExt notNil ifTrue:[
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15608
	minW := minExt x.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15609
	minH := minExt y.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15610
    ].
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15611
    maxExt notNil ifTrue:[
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15612
	maxW := maxExt x.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15613
	maxH := maxExt y.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15614
    ].
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15615
%{ 
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15616
    if (__isExternalAddress(aWindowId)) {
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15617
	HWND win = _HWNDVal(aWindowId);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15618
	RECT rec;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15619
	int winStyleBits;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15620
	int winExStyleBits;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15621
	localWindowInfo *lI;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15622
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15623
	if (win) {
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15624
	    winStyleBits = GetWindowLong(win, GWL_STYLE);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15625
	    winExStyleBits = GetWindowLong(win, GWL_EXSTYLE);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15626
	    lI = GETLOCALWINDOWINFOPTR(win);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15627
	    if (! lI) {
3126
5447d8c1d8d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3119
diff changeset
 15628
		fprintf(stderr, "WinWorkstation [info]: oops - no localInfo in setMinMaxExt\n");
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15629
		RETURN (self);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15630
	    }
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15631
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15632
	    if (__bothSmallInteger(minW, minH)) {
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15633
		RECT rec;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15634
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15635
		rec.left = 0;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15636
		rec.top = 0;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15637
		rec.right = __intVal(minW);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15638
		rec.bottom = __intVal(minH);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15639
#ifdef ADJUSTWINDOW
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15640
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15641
#endif
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15642
		lI->minWidth = rec.right - rec.left;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15643
		lI->minHeight = rec.bottom - rec.top;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15644
	    }
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15645
	    if (__bothSmallInteger(maxW, maxH)) {
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15646
		RECT rec;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15647
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15648
		rec.left = 0;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15649
		rec.top = 0;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15650
		rec.right = __intVal(maxW);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15651
		rec.bottom = __intVal(maxH);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15652
#ifdef ADJUSTWINDOW
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15653
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15654
#endif
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15655
		lI->maxWidth = rec.right - rec.left;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15656
		lI->maxHeight = rec.bottom - rec.top;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15657
	    }
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15658
	}
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15659
    }
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15660
%}
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15661
!
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 15662
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15663
setWindowName:aString in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15664
    "define a windows name"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15665
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15666
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15667
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15668
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15669
     && (__isString(aString) || __isSymbol(aString))) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15670
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15671
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15672
	SetWindowText(win, __stringVal(aString));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15673
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15674
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15675
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15676
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15677
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15678
setWindowShapeEllipticalX:x Y:y width:w height:h in:aWindowId
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15679
    "set the windows shape to an elliptical region"
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15680
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15681
%{
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15682
    if (__isExternalAddress(aWindowId)
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15683
     && __bothSmallInteger(x, y)
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15684
     && __bothSmallInteger(w, h)) {
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15685
	HWND win = _HWNDVal(aWindowId);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15686
	int left = __intVal(x);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15687
	int top = __intVal(y);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15688
	int right = left + __intVal(w);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15689
	int bottom = top + __intVal(h);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15690
	HRGN rgn;
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15691
	HDC winDC;
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15692
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15693
	rgn = CreateEllipticRgn(left, top, right, bottom);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15694
	if (rgn) {
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15695
	    winDC = GetDCEx(win, 0, DCX_WINDOW);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15696
	    if (winDC) {
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15697
		if (SelectClipRgn(winDC, rgn) == ERROR ) {
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15698
		    fprintf(stderr, "select clipping region failed\n");
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15699
		}
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15700
		ReleaseDC(win, winDC);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15701
	    }
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15702
	    else
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15703
		fprintf(stderr, "getDC failed\n");
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15704
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 15705
	    _DeleteObject(rgn, __LINE__);
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15706
	}
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15707
	else
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15708
	    fprintf(stderr, "region creation failed\n");
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15709
	RETURN ( self );
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15710
    }
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15711
%}.
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15712
    self primitiveFailed
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15713
!
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 15714
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15715
unmapWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15716
    "make a window invisible"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15717
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15718
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15719
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15720
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15721
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15722
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15723
	if (win) {
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 15724
	    CPRINTF(("unmapWindow %x\n",win));
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 15725
	    SetWindow_unmapping(win, 1);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15726
	    ShowWindowAsync(win, SW_HIDE);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15727
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15728
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15729
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15730
%}
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15731
!
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15732
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15733
windowIsIconified:aWindowId
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15734
    "return true, if some window is iconified."
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15735
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15736
%{  /* NOCONTEXT */
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15737
    if (__isExternalAddress(aWindowId)) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15738
	HWND win = _HWNDVal(aWindowId);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15739
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15740
	if (win) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15741
	    if (GetWindow_iconified(win)) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15742
		RETURN (true);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15743
	    }
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15744
	}
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15745
    }
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15746
%}.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15747
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15748
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15749
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15750
!WinWorkstation class methodsFor:'documentation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15751
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15752
version
4015
0ebf5ad92a72 bugfix in getClipboardData; allocation of string (too much space)
ca
parents: 4014
diff changeset
 15753
    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.254 2004-02-16 14:59:16 ca Exp $'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15754
! !
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 15755
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15756
WinWorkstation initialize!